Message397244
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) |
|
Date |
User |
Action |
Args |
2021-07-10 10:07:00 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, rhettinger |
2021-07-10 10:07:00 | serhiy.storchaka | set | messageid: <1625911620.03.0.357876719646.issue43838@roundup.psfhosted.org> |
2021-07-10 10:07:00 | serhiy.storchaka | link | issue43838 messages |
2021-07-10 10:06:59 | serhiy.storchaka | create | |
|