Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:

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)

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40116>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to