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 Mark.Shannon, methane, serhiy.storchaka
Date 2020-03-30.15:23:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1585581787.02.0.925294798639.issue40116@roundup.psfhosted.org>
In-reply-to
Content
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)
History
Date User Action Args
2020-03-30 15:23:07serhiy.storchakasetrecipients: + serhiy.storchaka, methane, Mark.Shannon
2020-03-30 15:23:07serhiy.storchakasetmessageid: <1585581787.02.0.925294798639.issue40116@roundup.psfhosted.org>
2020-03-30 15:23:07serhiy.storchakalinkissue40116 messages
2020-03-30 15:23:06serhiy.storchakacreate