I want a custom str rapresentation for a class object... something like
<MyStrRapresentation of class A>
class A(object): pass
I think the best way to do this is with a class method, something like
... def __str__(klass):
... return "MyStrRapresentation of class %s" % klass.__name__
... __str__ = classmethod(__str__)
"MyStrRapresentation of class A"
I think it must pass for a metaclass, something like this
... def __str__(self):
... return "MyStrRapresentation of ??"
<MyStrRapresentation of ??>
that is quite fine, but cannot "fill it" with something usefull like ids or
Any idea? Or better, someone can point me where I'm doing wrong?
Thanks in advance!