Simon Charette <charett...@gmail.com> added the comment:

I stumble upon this bug when porting a Python 2 codebase to 3 and suddenly got 
a NameError for the following code.


    class Foo:
        a = [1,2,3]
        b = [4,5,6]
        c = [x * y for x in a for y in b]

    NameError: name 'b' is not defined

Not sure what could be done at this point but I thought I'd leave some feedback 
given I was surprised this would break given it works just fine if not defined 
at the class level.

    a = [1,2,3]
    b = [4,5,6]
    c = [x * y for x in a for y in b]

----------
nosy: +charettes

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue3692>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to