nested functions

Szabolcs Berecz szabolcs.berecz at gmail.com
Fri Apr 14 08:10:17 EDT 2006


On 14 Apr 2006 04:37:54 -0700, micklee74 at hotmail.com
<micklee74 at hotmail.com> wrote:
> def a():
>   def b():
>     print "b"
>   def c():
>     print "c"
>
> how can i call c() ??

Function c() is not meant to be called from outside function a().
That's what a nested function is for: localizing it's usage and
prevent cluttering the global namespace

Szabi



More information about the Python-list mailing list