[issue4998] fractions are mutable
New submission from Somelauw somel...@yahoo.com: f = Fraction() f.a = 5 f.__slots__ ('_numerator', '_denominator') f.a 5 f.__dict__ {} When I create my own object, this doesn't happen. class Slots: __slots__ = (slot1, slot2) a = Slots() a.slot3 = 6 Traceback (most recent call last): File pyshell#4, line 1, in module a.slot3 = 6 AttributeError: 'Slots' object has no attribute 'slot3' In python2 this only happens when __slots__ is a tuple. (When __slots__ is a list, it works correctly) class Slots: __slots__ = (slot1, slot2) a = Slots() a.slot3 = 8 Here is a copy-paste from the python3 documentation: Without a __dict__ variable, instances cannot be assigned new variables not listed in the __slots__ definition. Attempts to assign to an unlisted variable name raises AttributeError. If dynamic assignment of new variables is desired, then add '__dict__' to the sequence of strings in the __slots__ declaration. Any non-string iterable may be assigned to __slots__. Mappings may also be used; however, in the future, special meaning may be assigned to the values corresponding to each key. -- components: Library (Lib) messages: 80161 nosy: Somelauw severity: normal status: open title: fractions are mutable versions: Python 3.0 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4998 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4676] python3 closes + home keys
Somelauw somel...@yahoo.com added the comment: I'm using windows XP home edition SP2 Yes, my error message is similair to the one of ajaksu2 when I run the IDLE on the commandline. (when opened from windows explorer, it justs closes) Also problem 2 is similair. ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4676 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4676] python3 closes + home keys
Somelauw somel...@yahoo.com added the comment: I have found a way to reproduce this error: Open the idle Hold down shift: Press up 3 times Hold [fn] (on laptop) Press the home key Idle closes for no reason Any help? ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4676 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4676] python3 closes + home keys
New submission from Somelauw somel...@yahoo.com: I'm using python 3.0 final which was released on December the 3th. I also have python 2.5 installed. 2 bugs in python3 IDLE which might be related (but don't have to) 1. The Python3 IDLE sometimes suddenly closes. It always happens when I'm using it for a while, then press the shift + home or end key and then it just disappears and my unsaved work is lost. It really completely exits without an error and I also don't see it on the background. I'm unable to reproduce the error. But it usually happens when I have hold down shift and press the home key. 2. When I have some code then scroll down the code, then hold down shift and press up a few times, then press home the selected code completely switches. Instead some code above the cursor suddenly gets selected. The reason I think both are related is because both involve shift + home key. Both of the bugs have never happened in the IDLE 1.2.1 which was part of python 2.5.2 I think -- components: IDLE messages: 77921 nosy: Somelauw severity: normal status: open title: python3 closes + home keys versions: Python 3.0 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4676 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com