On Oct 25, 7:28 am, NoName <[EMAIL PROTECTED]> wrote:
> I try it:
>
> def b():
>   ...
>   a()
>   ...
>
> def a():
>   ...
>   b()
>   ...
>
> b()
> it's not work.

Probably all those dots!

> Is it possible pre-define function like in c++ or place functions code
> after main block?

Python binds names to objects dynamically: this means that when a() is
compiled, the "b()" line in its definition is compiled to something
that says "look for the object currently bound to the name 'b' in the
global dictionary, and execute the __call__ method of that object with
no arguments".  It doesn't make any difference what object 'b' is
bound to at this time.

HTH

--
Arnaud


-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to