Namespace puzzle, list comprehension fails within class definition

Ethan Furman ethan at stoneleaf.us
Tue Jan 13 07:00:27 CET 2015


On 01/12/2015 08:49 PM, Steven D'Aprano wrote:
> On Mon, 12 Jan 2015 12:40:13 -0800, Ethan Furman wrote:
>> 
>> [...] class name lookup skips nonlocal namespaces.
> 
> Actually, no it doesn't.
> [...] 
> The "problem" is that *functions* lookup don't include the class body in 
> their scope.

Ah, thanks for the correction!

--
~Ethan~

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/python-list/attachments/20150112/3ef14e29/attachment.sig>


More information about the Python-list mailing list