Code blocks and top posting

Josiah Carlson jcarlson at uci.edu
Sat Apr 10 16:19:53 EDT 2004


Clarification of my post necessary.

> 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.

I should clarify.  The above works, but the below...

> 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.

Is not available.

  - Josiah




More information about the Python-list mailing list