Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:
Thank you for your report and patch. Agree that the code does not look safe. Do you mind to create a pull request? Would be nice to add a test for it. The three references to the Python class are: * the __dict__ descriptor * the __weakref__ descriptor * the __mro__ tuple You can get rid of the first two by setting __slots__ = () in the class definition. But it is not so easy with the __mro__ tuple. I will try more. ---------- versions: +Python 3.7, Python 3.8 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue39382> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com