How to obtain an instance's name at runtime?
Dinu C. Gherman
gherman at my-deja.com
Thu Jul 1 07:27:45 EDT 1999
More information about the Python-list mailing list
Thu Jul 1 07:27:45 EDT 1999
- Previous message (by thread): Reflection in Python?
- Next message (by thread): How to obtain an instance's name at runtime?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
In article <37769B92.47EBE99C at compaq.com>, Greg Ewing <greg.ewing at compaq.com> wrote: > > The best solution by far would be to give the > object a name explicitly when you create it. > Is this possible, or do you want to retrofit > it onto existing code? The latter is what I'm planning to do. > It looks like you want it to be something like > "the name of the first variable to be assigned > a reference to the object". Does this apply to > local variables as well as globals? Instance > variables of another object? What if the object > is never assigned to a variable? What if it > is, but somewhere far removed from where it > is created? You're guessing very well... ;-) Actually, I will postpone some issues until some advance is made at other places of the code. Just that much: an object, that has not been assigned a name to, cannot exist (having a reference count of zero), can it (at least for user-defined objects)? In any case thanks so far! I think the problem is not a really fundamental one for the type of application I'm having in mind, after all. Bye, Dinu Sent via Deja.com http://www.deja.com/ Share what you know. Learn what you don't.
- Previous message (by thread): Reflection in Python?
- Next message (by thread): How to obtain an instance's name at runtime?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list