On 9/2/2011 12:53 PM, Travis Parks wrote:
On Sep 2, 12:36 pm, "Gabriel Genellina"<gagsl-...@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
    global getDictValues
before the if statement in order for the assignments to have global effect.

--
Terry Jan Reedy

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to