[EMAIL PROTECTED] writes:

> Hello all,
> For some reason, the following does not work :
>
>
> class C:
>     TYPES = [None]
>     DICT = {}
>     for Type in TYPES:
>         DICT.update((E,Type) for E in [1])
>
>>>> NameError: global name 'Type' is not defined
>
>
> What do you think? Is this a bug?

It works if you change the generator expression to a list
comprehension, by adding [] around it.  Feels like a bug to me, but
there might be subtleties involved.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to