name of object inside it's methods?

Gerrit Holl gerrit at nl.linux.org
Mon Feb 28 03:25:44 EST 2000


<quote name="Moshe Zadka" date="951723805">
> On Mon, 28 Feb 2000, Michal Wallace (sabren) wrote:
> 
> > A) you could recursively loop through all the namespaces
> >    available to your program and do an "is" check against
> >    everything you find.... 
> 
> Which wouldn't work if the object doesn't have a Python visible name,
> like a Python object inside a list.
> 
> > B) you could give the object a .Name attribute and just
> >    use that instead. :)
> 
> class foo():
> 	pass
> b = foo()
> b.Name = "b"
> a = b
> print a

<nitpick>
  File "<stdin>", line 1
    class foo():
              ^
SyntaxError: invalid syntax
</nitpick>

regards,
Gerrit.

-- 
Comparison Python GUI's: http://www.nl.linux.org/~gerrit/gui.html
Please comment!




More information about the Python-list mailing list