some questions....

Dennis Lee Bieber wlfraed at ix.netcom.com
Tue Nov 26 20:19:44 EST 2002


Tim Roberts fed this fish to the penguins on Monday 25 November 2002 
11:34 pm:

> 
> At this point, the variable "C" does not exist.  That's why you get an
> error.  What surprises ME is that it was able to find "c".  What that
> tells me is that the interpreter creates the object, assigns it to
> "c", and THEN
> calls __init__.  __init__, then, is able to find the global variable
> "c".

        Look closely at the conditional in the __init__ -- it doesn't attempt 
to access "c" during that assignment.
> 
>>    d = simple(b)

        THAT assignment, passing "b" (=4) activates the "print c" line.


-- 
 > ============================================================== <
 >   wlfraed at ix.netcom.com  | Wulfraed  Dennis Lee Bieber  KD6MOG <
 >      wulfraed at dm.net     |       Bestiaria Support Staff       <
 > ============================================================== <
 >        Bestiaria Home Page: http://www.beastie.dm.net/         <
 >            Home Page: http://www.dm.net/~wulfraed/             <




More information about the Python-list mailing list