Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment: For the test you can use "nonlocal". ---------- _______________________________________ Python tracker <report at bugs.python.org> <https://bugs.python.org/issue35780> _______________________________________