On Monday, January 12, 2015 at 12:41:30 PM UTC-8, Ethan Furman wrote: > In Foo 'f' is part of an unnamed namespace; the list comp 'g' has its own > namespace, effectively making be a nonlocal; > class name lookup skips nonlocal namespaces. > > Workaround: use an actual for loop.
Thanks, Ethan. That works. As you can see from my other post, I've just discovered that the scoping rules for list comprehensions were changed between Py2 and Py3. -- https://mail.python.org/mailman/listinfo/python-list