Re: Retrieving the name of the class calling an instance method

2008-09-05 Thread Emile van Sebille
mercado mercado wrote: In Python, is it possible for an instance method to know the name of the class which is calling it? Well, the class name is in __class__ so changing 'print x' to 'print __class__' will show foo in both cases, which is in fact the name of the class which is calling i

Re: Retrieving the name of the class calling an instance method

2008-09-05 Thread Maric Michaud
Le Friday 05 September 2008 17:29:39 mercado mercado, vous avez écrit : > In Python, is it possible for an instance method to know the name of the > class which is calling it? For example, in the sample below, I would like > for the someMethod method to print the name of the class calling it ("bar"

Retrieving the name of the class calling an instance method

2008-09-05 Thread mercado mercado
In Python, is it possible for an instance method to know the name of the class which is calling it? For example, in the sample below, I would like for the someMethod method to print the name of the class calling it ("bar" in the first case, "again" in the second). -