[issue15856] inspect.getsource(SomeClass) doesn't show @decorators

2020-04-18 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:


New changeset 696136b993e11b37c4f34d729a0375e5ad544ade by Karthikeyan 
Singaravelan in branch 'master':
bpo-35113: Fix inspect.getsource to return correct source for inner classes 
(#10307)
https://github.com/python/cpython/commit/696136b993e11b37c4f34d729a0375e5ad544ade


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15856] inspect.getsource(SomeClass) doesn't show @decorators

2019-08-31 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> inspect.getsource returns incorrect source for classes when 
class definition is part of multiline strings

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15856] inspect.getsource(SomeClass) doesn't show @decorators

2019-04-27 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

This should be resolved by issue35113 . I have rewritten the getsource function 
for classes to use AST to deal with nested classes. The PR adds support for 
showing the decorator in the source. I would propose closing this as a 
duplicate of the other issue.

--
nosy: +xtreak
versions: +Python 3.8 -Python 3.4, Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15856] inspect.getsource(SomeClass) doesn't show @decorators

2019-04-26 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15856] inspect.getsource(SomeClass) doesn't show @decorators

2014-07-10 Thread Mark Lawrence

Mark Lawrence added the comment:

@Thomas sorry about the delay in getting back to you.

--
nosy: +BreamoreBoy, yselivanov
versions: +Python 3.4, Python 3.5 -Python 3.2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15856
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15856] inspect.getsource(SomeClass) doesn't show @decorators

2012-09-03 Thread Thomas Kluyver

New submission from Thomas Kluyver:

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.

--
components: Library (Lib)
messages: 169767
nosy: takluyver
priority: normal
severity: normal
status: open
title: inspect.getsource(SomeClass) doesn't show @decorators
type: behavior
versions: Python 3.2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15856
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com