Serhiy Storchaka added the comment: Using a generator doesn't prevents state to be saved and restored. ---------- _______________________________________ Python tracker <report at bugs.python.org> <http://bugs.python.org/issue18844> _______________________________________