Antoine Pitrou added the comment: > No matter how it sounds, it certainly looks cleaner in code.
It's also unsafe and invasive, since it's a process-wide setting. An iterator can be long-lived if it's being consumed slowly, so you've disabled garbage collection for an unknown amount of time, without the user knowing about it. Another thread could kick in and perhaps re-enable it for whatever reason. Oh if someone calls gc.collect() explicitly, the solution is suddenly defeated. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue7105> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com