Code blocks and top posting

Josiah Carlson jcarlson at uci.edu
Sat Apr 10 15:18:00 EDT 2004


I understand your point, however...

     >>> def async_chain():
     ...     def do_step_1():
     ...         print 'Step 1.'
     ...         after_idle(do_step_2)
     ...     def do_step_2():
     ...         print 'Step 2.'
     ...         after_idle(do_step_3)
     ...     def do_step_3():
     ...         print 'Step 3.'
     ...     after_idle(do_step_1)
     ...
     >>> def after_idle(funct):
     ...     funct()
     ...
     >>> async_chain()
     Step 1.
     Step 2.
     Step 3.


And what you seem to want...

     if condition:
         funct()

     def funct():
         #body

... is not available in any modern programming language.  It is also not 
possible to handle syntactically in the Python interactive shell.

  - Josiah



More information about the Python-list mailing list