brad a écrit : > Tommy Nordgren wrote: > >>> def outer(avar=False): >>> print avar >>> if avar == True: >>> return >>> >>> def inner(avar=True): >>> print avar >>> return avar >>> >>> outer(inner()) >>> >>> outer() > > >> This is not a general solution to this problem. > > > Run my example code, it works (if I'm understanding your question > correctly). It sets outer to True... inner returns True to outer and > thus the var is set... am I missing something?
Yes: you forgot to rebind avar in inner and check the result in outer. -- http://mail.python.org/mailman/listinfo/python-list