PyPK wrote:
> ok I reason I was going with globals is that i use this variable in
> another class something like this along with above
>
> testflag = 0
>
> class AA:
>def __init__(...):
>
> def methos(self,...):
>global testflag
>testflag = xx
>
> class BB:
> def __ini
PyPK wrote:
> ok I reason I was going with globals is that i use this variable in
> another class something like this along with above
>
> testflag = 0
>
> class AA:
>def __init__(...):
>
> def methos(self,...):
>global testflag
>testflag = xx
>
> class BB:
> def __ini
I see that.But here in my case the testflags is computed inside the
member function something like
class AA:
def __init__(self):
self.test_flag = 0 # initialize
def methods(self, value):
save_value = _munge(value)
self.test_flag = save_value
N
"PyPK" wrote:
> hi how do I write this better with member variables rather than global
> as you see below.
>
> eg:
>
> test-flag = 0
>
> class AA:
>def __init__(...):
>
> def methos(self,...):
>global test-flag
>test-flag = xx
>
> instead of something like above ..how do i pu
On 2006-03-31, PyPK <[EMAIL PROTECTED]> wrote:
> hi how do I write this better with member variables
Sorry, I don't know what "member variables" are.
> rather than global as you see below.
What you did below isn't global. It's scope is limited to the
module containing the class. If you got so
ok I reason I was going with globals is that i use this variable in
another class something like this along with above
testflag = 0
class AA:
def __init__(...):
def methos(self,...):
global testflag
testflag = xx
class BB:
def __init__(...):
def method2(..):
if
PyPK wrote:
> hi how do I write this better with member variables rather than global
> as you see below.
>
> eg:
>
> test-flag = 0
>
> class AA:
>def __init__(...):
>
> def methos(self,...):
>global test-flag
>test-flag = xx
>
> instead of something like above ..how do i
hi how do I write this better with member variables rather than global
as you see below.
eg:
test-flag = 0
class AA:
def __init__(...):
def methos(self,...):
global test-flag
test-flag = xx
instead of something like above ..how do i put it i terms of member
variables?
--
h