nested functions

Gordon McMillan gmcm at hypernet.com
Fri Feb 25 00:45:45 CET 2000


Alexander V. Voinov wrote:
> 
> Please remind me, if there are any performance penalties in nesting
> functions like this:
> 
> def f1():
> 	....
> 	def f2(x)
> 		....
> 
> 	y = f2(x)
> 
> 
> or one should follow the C style? (Definition of f2 in _not_ in a loop,
> of course)

The main issue is scoping and names. Nested functions get 
really messy when they need reference to something outside 
themselves.

- Gordon




More information about the Python-list mailing list