STINNER Victor <vstin...@redhat.com> added the comment:

Calling directly __new__() is very unusual, so I'm not surprised that you found 
bugs. Calling __init__() twice is also an unusal practice. I concur with 
Serhiy: implementing new instead of init should prevent such bug. I recall that 
some objects decided instead to raise an exception if they are not fully 
initialized (if init has not been called), but using new instead of init seems 
to be safer approach if we can implement it.

In the meanwhile, I blocked by the memory leak (handle leak) in bz2 and lzma: 
bpo-33916. I proposed a very simple fix: PR 7843. I propose to apply this one 
since it's easy to backport it to all branches, whereas replacing init with new 
would be more difficult and risky to backport: I would suggest to only make 
this change in the master.

What do you think?

----------
nosy: +vstinner

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

Reply via email to