How to refer to class name and function name in a python program?
rt8396 at gmail.com
Sun Sep 20 18:17:47 CEST 2009
On Sep 20, 10:38 am, Peng Yu <pengyu... at gmail.com> wrote:
> I have the following code. I want to change the function body of
> __repr__ to something like
> return 'In %s::%s' % ($class_name, $function_name)
> I'm wondering what I should write for $class_name and $function_name in python.
> class A:
> def __init__(self):
> def __repr__(self):
> return 'In A::__repr__'
> a = A()
> print a
well thats easy ;-)
return 'A, __repr__'
was that too easy?
More information about the Python-list