This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author takluyver
Recipients takluyver
Date 2012-09-03.15:13:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1346685224.9.0.738134714561.issue15856@psf.upfronthosting.co.za>
In-reply-to
Content
Since bug #1006219 was fixed, inspect.getsource(func) has returned the source of a function including any decorators on the function. But doing the same with a class, the returned source doesn't include decorators.

With functions, the co_firstlineno attribute of the code object points to the start of the decorators. With classes, that's not possible, so it's likely that a bit more regex trickery will be needed to scan back to decorators.

I've confirmed the same thing happens in 3.2 and 2.7, and looking at the code of inspect.py in trunk, it looks like it will do the same thing.
History
Date User Action Args
2012-09-03 15:13:44takluyversetrecipients: + takluyver
2012-09-03 15:13:44takluyversetmessageid: <1346685224.9.0.738134714561.issue15856@psf.upfronthosting.co.za>
2012-09-03 15:13:44takluyverlinkissue15856 messages
2012-09-03 15:13:44takluyvercreate