Author Barney Stratford
Recipients Barney Stratford
Date 2018-11-04.14:46:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1541342806.22.0.788709270274.issue35162@psf.upfronthosting.co.za>
In-reply-to
Content
>>> 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.
History
Date User Action Args
2018-11-04 14:46:46Barney Stratfordsetrecipients: + Barney Stratford
2018-11-04 14:46:46Barney Stratfordsetmessageid: <1541342806.22.0.788709270274.issue35162@psf.upfronthosting.co.za>
2018-11-04 14:46:46Barney Stratfordlinkissue35162 messages
2018-11-04 14:46:46Barney Stratfordcreate