En Sun, 18 Feb 2007 04:20:33 -0300, goodwolf <[EMAIL PROTECTED]>  
escribió:

> I suppose that you wont get class name into its code (or before
> definition end) but not into a method definition.
>
>
> import sys
>
> def getCodeName(deap=0):
>     return sys._getframe(deap+1).f_code.co_name
>
>
> class MyClass (object):
>     name = getCodeName() + '!'

What's the advantage over MyClass.__name__?

-- 
Gabriel Genellina

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to