Pablo Galindo Salgado <pablog...@gmail.com> added the comment:
I am not convinced about this. One of the problems I dislike is that the gc will take permanent ownership of the file descriptor (so is basically leaked). Is also not clear how this will behave during the delicate stages of finalization (the stream object provided can be anything that we have no control over during finalization) and also, it makes it a bit riskier as this can execute arbitrary python code in the middle of the gc. On the other hand, is possible to use the gc callbacks to gather similar statistics about collections doing whatever you need there (like writing to file descriptors and the such). ---------- nosy: +pablogsal _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue5851> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com