too simple a question : forward declaration?

Helmut Jarausch jarausch at igpm.rwth-aachen.de
Wed May 14 03:48:28 EDT 2003


Sorry for this super simple question,
but I haven't found an answer in my
Python reference "Python in a nutshell"
which I like very much.

How can I do a forward declaration of a function
like in C, i.e. just the defining header
without the body.

E.g. the following doesn't work because
of the lack of such a forward declaration

Test();  # error  Test unknown

def Test():
   print "hello test"

Of course this is a trivial example and I could
of course put the function declaration before the
first call, but that's ugly for longer scripts.

Many thanks for a hint,

-- 
Helmut Jarausch

Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany





More information about the Python-list mailing list