Re: member variables in python



On 2006-03-31, PyPK <superprad@xxxxxxxxx> 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
.



Relevant Pages

  • Re: CLOS and C++
    ... > But Scott Meyers is not advocating making all class member variables ... (defclass-with-privates foo () ...
    (comp.lang.lisp)
  • Re: Visual C Cdialog.DoModal()
    ... The fast solution is to simply declare the dialog in the ... But unless this function needs access to class member variables (in which case ... Essentially, there is no need, as far as I can tell, to have the dialog member in the ... without a class instance there simply isn't ANY member variable you can talk about. ...
    (microsoft.public.vc.mfc)
  • Re: The reality of Topmind (Was: Topic-Organized Object-Oriented Programming)
    ... It is, simply, classifying all of a class' member variables and member ... suppose the class is "Human" (a class with member functions ... "hierarchy" and tree are the same goddam ...
    (comp.object)
  • Re: CButton casts
    ... been called because OnInitDialog() has not been called; ... can't set any of this earlier as the hWnd of the control member variables ... So it seems it is necessary to intialise some temporary member variables ...
    (microsoft.public.vc.mfc)
  • Re: I want something weird
    ... > I now subclass it: ... > I do not wish to add a new member variable, ... Heightand other CRect member functions without having to ... There are no vertual member variables in C++, ...
    (microsoft.public.vc.mfc)