469,599 Members | 2,617 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,599 developers. It's quick & easy.

let me simplify my question about scope of vars

"code"
var=1
class CLASS:
def METHOD1:
def METHOD2:
var+=var
return var
METHOD2() #line8
return var
METHOD1() #line10
Q1: does class CLASS inherit var=0 from line1?
Q2: does def METHOD1 inherit var=0 from line1?
Q3: does def METHOD2 inherit var=0 from line1?
Q3: does line8 return '2'?
Q4: does line10 return '2\n2'?
Dec 23 '06 #1
0 795

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Tom | last post: by
4 posts views Thread by Joe | last post: by
reply views Thread by Uwe Mayer | last post: by
3 posts views Thread by Matthew Crouch | last post: by
10 posts views Thread by glenn | last post: by
12 posts views Thread by IchBin | last post: by
8 posts views Thread by Erik de Castro Lopo | last post: by
14 posts views Thread by MartinRinehart | last post: by
2 posts views Thread by ray | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.