Creating a local variable scope.
Bearophile
bearophileHUGS at lycos.com
Fri Sep 11 22:07:55 EDT 2009
Steven D'Aprano:
> (3) Create an inner function, then call that.
Several people after someone gives this anwer.
> My personal opinion is that if you really need a local scope inside a function, the function is doing too much and should be split up.<
I agree. And a way to split a function is to define an inner function,
that's one of their main purposes. No need to add other things to the
language as the OP suggests.
Bye,
bearophile
More information about the Python-list
mailing list