make order of function definitions irrelevant

Peter Hansen peter at engcorp.com
Mon Nov 10 13:57:50 EST 2003


Joerg Schuster wrote:
> 
> according to
> 
> http://mail.python.org/pipermail/tutor/2001-July/007246.html
> 
> the order of function definitions does matter in python. Does anyone
> know a trick to avoid this? 

No.


> Is there a way to "declare" functions without defining them?

No.

> (Making the order of function definitions irrelevant would be useful
> for automatically generated python scripts.)

No, it would not.

Basically, the problem you believe is here is not a problem
in actual practice.  You could add declarations to Python-the-language,
but they're irrelevant until the function is actually called.
When the function is called, it has to have been defined (not just
declared) and so the declaration would be completely redundant.

-Peter




More information about the Python-list mailing list