questions about imports and classes

Oleg Broytmann phd at phd.russ.ru
Mon Apr 24 17:46:21 CEST 2000


On Mon, 24 Apr 2000, Tim Iskander x7483 wrote:
> 1 - is it possisble to get the instance name of an object (similar to
> the class.__name__
>         attribute)

   It is impossible. Consider
a = A()
b = a
   Now both a and b points to the same instance; what is the name, a or b? :)

> 2 - has there been any/much discussion on extending the import command
> to allow

   You need __import__ builtin function.

Oleg.            (All opinions are mine and not of my employer)
---- 
    Oleg Broytmann      Foundation for Effective Policies      phd at phd.russ.ru
           Programmers don't die, they just GOSUB without RETURN.





More information about the Python-list mailing list