staticmethod() problems

Aum spam-me at no-thanks.com
Thu Jan 23 17:25:28 EST 2003


Thomas Heller wrote:

>> Firstly, python excels at empowering the programmer, and removing a vast
>> number of the restrictions which make other languages a total pain. So
>> why *shouldn't* there be a way for a static method to know (if it wants
>> to) if it's been invoked via the class or via an instance? And to
>> determine the exact class or subclass from which it's been invoked?
> 
> I posted a recipe some time ago which IMO allows you to do it:
> 
> http://tinyurl.com/4shq

That... is *soooo* totally kewl! :)
Works perfectly!

That should really go into the standard.

Thank you so much - you're a life-saver!

(I'd better knuckle down now and learn all these obscure low level class 
internals.)

Cheers
A





More information about the Python-list mailing list