Is this a bug, or is it me?
cokofreedom at gmail.com
cokofreedom at gmail.com
Thu Jan 17 10:14:08 EST 2008
On Jan 17, 4:05 pm, cptnwill... at gmail.com wrote:
> 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?
Do not use those names...really poor choice...
thingydingy = [None]
my = {}
for dingaling in thingydingy:
my.update([(E,dingaling ) for E in [1]])
print my
More information about the Python-list
mailing list