Message329231
>>> class Eggs (object):
... def __init__ (self, number):
... self.__number = number
... def __repr__ (self):
... return "{} eggs".format (self.__number)
...
>>> Eggs (4)
4 eggs
>>> del Eggs.__new__
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: __new__
>>> # As expected
...
>>> Eggs (4)
4 eggs
>>> Eggs.__new__ = None
>>> del Eggs.__new__
>>> Eggs (4)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: object() takes no parameters
>>> # Wrong! Eggs has no __new__, so this should respond as earlier
...
This bug seems to be because the slotdef isn't updated when __new__ is deleted. |
|
Date |
User |
Action |
Args |
2018-11-04 14:46:46 | Barney Stratford | set | recipients:
+ Barney Stratford |
2018-11-04 14:46:46 | Barney Stratford | set | messageid: <1541342806.22.0.788709270274.issue35162@psf.upfronthosting.co.za> |
2018-11-04 14:46:46 | Barney Stratford | link | issue35162 messages |
2018-11-04 14:46:46 | Barney Stratford | create | |
|