Re: member variables in python
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

Re: member variables in python

From: Grant Edwards <grante@visi.com>
Date: Fri Mar 31 2006 - 18:16:32 CEST

On 2006-03-31, PyPK <superprad@gmail.com> 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 something that's used
by multiple classes in the module, then module-scope seems like
the logical choice.

> 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?

Dunno. What are "member varibles"?

-- 
Grant Edwards                   grante             Yow!  Don't SANFORIZE me!!
                                  at               
                               visi.com            
Received on Sun Apr 30 21:47:43 2006