U
Uwe Mayer
Hi,
I need to access class variables of a class I'd like to make private:
i.e.
class __Bar(object):
pass
class __Foo(__Bar):
def __init__(self):
super(__Foo, self).__init__()
Name Error: global name '_Foo__Foo' is not defined
Here I want to prevent the user of instanciating __Foo from outside of the
module.
i.e.
class __A:
a_list = []
def __init__(self):
__A.a_list.append(self)
NameError: global name '_A__A' is not defined
Here I want to keep a list of instanciated objects of class __A, so I can
update internal values if they are changed.
Any ideas?
Thanks
Uwe
I need to access class variables of a class I'd like to make private:
i.e.
class __Bar(object):
pass
class __Foo(__Bar):
def __init__(self):
super(__Foo, self).__init__()
Name Error: global name '_Foo__Foo' is not defined
Here I want to prevent the user of instanciating __Foo from outside of the
module.
i.e.
class __A:
a_list = []
def __init__(self):
__A.a_list.append(self)
NameError: global name '_A__A' is not defined
Here I want to keep a list of instanciated objects of class __A, so I can
update internal values if they are changed.
Any ideas?
Thanks
Uwe