This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients rhettinger, serhiy.storchaka
Date 2021-07-10.10:06:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1625911620.03.0.357876719646.issue43838@roundup.psfhosted.org>
In-reply-to
Content
Example of modifying a builtin type:

>>> class Sneaky:
...     def __eq__(self, other):
...         other['real'] = 42
... 
>>> int.__dict__ == Sneaky()
>>> (1).real
42

But it can also lead to crash (due to outdated type cache):

>>> class Sneaky:
...     def __eq__(self, other):
...         other['bit_length'] = 42
... 
>>> int.__dict__ == Sneaky()
>>> (1).bit_length
Segmentation fault (core dumped)
History
Date User Action Args
2021-07-10 10:07:00serhiy.storchakasetrecipients: + serhiy.storchaka, rhettinger
2021-07-10 10:07:00serhiy.storchakasetmessageid: <1625911620.03.0.357876719646.issue43838@roundup.psfhosted.org>
2021-07-10 10:07:00serhiy.storchakalinkissue43838 messages
2021-07-10 10:06:59serhiy.storchakacreate