Scope of variable inside list comprehensions?

Roy Smith roy at panix.com
Mon Dec 5 17:36:48 EST 2011


Well, in my defense, I did ask a pretty narrow question, "Is id guaranteed to be in scope in the print statement?".  While I will admit that not knowing whether I could alter the exception, or whether id masked a builtin or not does complexify answering some questions, those are questions I didn't ask :-)



More information about the Python-list mailing list