Message365320
But the following class should not lead to unlimited memory consumption when create new instances:
class C:
count = 0
def __init__(self):
count = self.__class__.count
self.__class__.count = count + 1
setattr(self, f'a{count}', count) |
|
Date |
User |
Action |
Args |
2020-03-30 15:23:07 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, methane, Mark.Shannon |
2020-03-30 15:23:07 | serhiy.storchaka | set | messageid: <1585581787.02.0.925294798639.issue40116@roundup.psfhosted.org> |
2020-03-30 15:23:07 | serhiy.storchaka | link | issue40116 messages |
2020-03-30 15:23:06 | serhiy.storchaka | create | |
|