[IPython-User] class decorators in class introspection: MyClass??
Nikolas Tezak
ntezak@stanford....
Mon Aug 27 15:16:24 CDT 2012
Hi there,
I was wondering if there was some way to reconfigure IPython's "display source"-functionality such that it shows class decorators.
Say I have:
def changeSomething(cls):
cls.something_changed = True
@changeSomething
class MyClass(object):
pass
Then, in ipython,
>>>MyClass??
will start printing the source with the first line being
'class MyClass(object):'
Wouldn't it make sense to print any existing decorators above the class definition, too?
Thanks,
Nik
More information about the IPython-User
mailing list