nest class name problem

Thomas Wouters thomas at xs4all.net
Tue Jun 20 03:56:26 EDT 2000


On Mon, Jun 19, 2000 at 05:18:11PM -0700, Bob van der Poel wrote:

> Rainer Deyke wrote:
> > 
> > Jeff Massung <jmassung at magpiesystems.com> wrote in message
> > news:riu35.36$JM5.4708 at news.uswest.net...
> > > you can use Goption.__name instead of self.__name?

> > This would indeed work if it wasn't for name mangling.  Don't call it __name
> > if you want to access it from a nested class.

> Yes, but I'm using __name to keep the variable private/static to a
> particular instance of the Goption(). 
> 

Then you'll have to provide an access method:

class Goption:
	__name = ""
	def getname(self):
		return self.__name

-- 
Thomas Wouters <thomas at xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!




More information about the Python-list mailing list