Handling 2.7 and 3.0 Versions of Dict
tjreedy at udel.edu
Fri Sep 2 22:22:35 CEST 2011
On 9/2/2011 12:53 PM, Travis Parks wrote:
> On Sep 2, 12:36 pm, "Gabriel Genellina"<gagsl-... at yahoo.com.ar>
>> Those if/else are at global scope. An 'if' statement does not introduce a
>> new scope; so getDictValues, despite being "indented", is defined at
>> global scope, and may be used anywhere in the module.
> Does that mean the rules would be different inside a function?
Yes. Inside a function, you would have to add
before the if statement in order for the assignments to have global effect.
Terry Jan Reedy
More information about the Python-list