Matthew Barnett <pyt...@mrabarnett.plus.com> added the comment:
It's not just in the 'if' clause: >>> class Foo: ... a = ['a', 'b'] ... b = ['b', 'c'] ... c = [b for x in a] ... Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<stdin>", line 4, in Foo File "<stdin>", line 4, in <listcomp> NameError: name 'b' is not defined ---------- nosy: +mrabarnett _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue45899> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com