STINNER Victor added the comment: > I don't like _dealloc_warn() at all. It looks as a dirty hack and doesn't > work with custom file-like objects.
I tried to support emitting a ResourceWarning when the close() method is overriden in a subclass, but then I saw that io doesn't support this use case neither: --- import io import os class MyFile(io.FileIO): def close(self): os.close(self.fileno()) f = MyFile('/etc/issue') f = None --- => no warning Ok, now I have to read again Martin's patches since I didn't understand them at the first read :-) ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue19829> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com