Author ezio.melotti
Recipients chepner, ezio.melotti, michael.foord
Date 2014-08-05.04:37:01
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
The issue seems to affect special attributes that can't be deleted.
In Lib/unittest/, patch() tried to delete the attribute, and then, if it doesn't exist, it restores the previous value.  However some special attributes exist even after they are deleted, but their initial value is lost:
>>> def foo(x:int=5, y:int=3): return x + y
>>> foo.__defaults__
(5, 3)
>>> del foo.__defaults__
>>> foo.__defaults__
>>> foo.__annotations__
{'y': <class 'int'>, 'x': <class 'int'>}
>>> del foo.__annotations__
>>> foo.__annotations__
>>> foo.__qualname__
>>> del foo.__qualname__
TypeError: __qualname__ must be set to a string object
Date User Action Args
2014-08-05 04:37:01ezio.melottisetrecipients: + ezio.melotti, michael.foord, chepner
2014-08-05 04:37:01ezio.melottisetmessageid: <>
2014-08-05 04:37:01ezio.melottilinkissue22138 messages
2014-08-05 04:37:01ezio.melotticreate