Are circular dependencies possible in Python?

John Machin sjmachin at lexicon.net
Sun Apr 10 04:15:29 EDT 2005


On Sun, 10 Apr 2005 07:34:02 GMT, Tim Tyler <tim at tt1lock.org>  wrote:

>Marc 'BlackJack' Rintsch <bj_666 at gmx.net> wrote or quoted:
>> In <IEosBE.GtB at bath.ac.uk>, Tim Tyler wrote:
>
>> > Like C, Python seems to insist I declare functions before calling
>> > them - rather than, say, scanning to the end of the current script
>> > when it can't immediately find what function I'm referring to.
>> 
>> They don't have to be declared but to be *defined* in Python before you
>> can call them. [...]
>
>That makes three of you who have called me on my use of "declare".
>
>AFAICT, I was using the standard dictionary definition of this word:
>
>  http://dictionary.reference.com/search?q=declare
>
>The term "declare" doesn't have the same meaning as the term "predeclare".

We don't need no steenking dictionaries; we're using "declare" and
"define" in the same manner as did K&R:

int foo(int bar); /* declaration */

int foo(int bar) { /* definition */
    return 42 * bar;
}






More information about the Python-list mailing list