[issue1764286] inspect.getsource does not work with decorated functions

2018-08-01 Thread Eric Wieser
Eric Wieser added the comment: New issue opened at https://bugs.python.org/issue34305, along with a PR linked there. -- ___ Python tracker ___ _

[issue1764286] inspect.getsource does not work with decorated functions

2018-07-31 Thread Yury Selivanov
Yury Selivanov added the comment: > Should `getsourcefile` be changed to match? I'd say yes. There's no point in getsourcefile returning the file location of the topmost decorator. Feel free to open a new issue and submit a PR to fix this! -- ___

[issue1764286] inspect.getsource does not work with decorated functions

2018-07-30 Thread Eric Wieser
Eric Wieser added the comment: This now leaves `inspect.getsource` inconsistent with `inspect.getsourcefile`: >>> import inspect >>> from contextlib import contextmanager >>> @contextmanager ... def func(): ...yield >>> inspect.getsource(func) '@contextmanager\ndef func():\nyield\n'

[issue1764286] inspect.getsource does not work with decorated functions

2014-09-26 Thread Berker Peksag
Changes by Berker Peksag : -- stage: patch review -> resolved ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue1764286] inspect.getsource does not work with decorated functions

2014-09-26 Thread Yury Selivanov
Yury Selivanov added the comment: Thanks for the bug report and patch! Committed to 3.5. -- resolution: -> fixed status: open -> closed ___ Python tracker ___

[issue1764286] inspect.getsource does not work with decorated functions

2014-09-26 Thread Roundup Robot
Roundup Robot added the comment: New changeset ad9cc6124a19 by Yury Selivanov in branch 'default': inspect: Fix getsource() to support decorated functions. https://hg.python.org/cpython/rev/ad9cc6124a19 -- nosy: +python-dev ___ Python tracker

[issue1764286] inspect.getsource does not work with decorated functions

2014-08-25 Thread Claudiu Popa
Changes by Claudiu Popa : -- stage: test needed -> patch review ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe

[issue1764286] inspect.getsource does not work with decorated functions

2014-04-15 Thread Yury Selivanov
Changes by Yury Selivanov : -- assignee: -> yselivanov ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https

[issue1764286] inspect.getsource does not work with decorated functions

2014-01-28 Thread Yury Selivanov
Changes by Yury Selivanov : -- nosy: +yselivanov versions: +Python 3.5 -Python 2.7, Python 3.2, Python 3.3, Python 3.4 ___ Python tracker ___ __

[issue1764286] inspect.getsource does not work with decorated functions

2013-09-29 Thread Claudiu.Popa
Claudiu.Popa added the comment: Hello. Attached patch which uses the new inspect.unwrap, added in http://hg.python.org/cpython/rev/2aa6c1e35b8a. -- keywords: +patch nosy: +Claudiu.Popa Added file: http://bugs.python.org/file31902/inspect_getsource.patch

[issue1764286] inspect.getsource does not work with decorated functions

2013-08-04 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- assignee: belopolsky -> ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue1764286] inspect.getsource does not work with decorated functions

2013-01-27 Thread Ezio Melotti
Changes by Ezio Melotti : -- versions: +Python 3.3, Python 3.4 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue1764286] inspect.getsource does not work with decorated functions

2010-07-19 Thread Ray.Allen
Ray.Allen added the comment: I don't think this patch is correct, because we don't know if the closure[0] is the wrapped function, consider the following case: def fun(): abc = 1 def fun2(): print(abc) print(inspect.getsource(fun2)) In this case, the __closure__ of fun2 is

[issue1764286] inspect.getsource does not work with decorated functions

2010-07-18 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I did not test the patch, but if it really addresses the issue, I don't see why such a simple fix would not be applied. Guilherme, Can you add unit tests? Also, the second chunk in your patch is just a style fix which is a distraction for reviewers.

[issue1764286] inspect.getsource does not work with decorated functions

2008-02-07 Thread Guilherme Polo
Guilherme Polo added the comment: I am attaching a patch that address this issue. -- nosy: +gpolo Added file: http://bugs.python.org/file9384/inspect.py.diff _ Tracker <[EMAIL PROTECTED]> _

[issue1764286] inspect.getsource does not work with decorated functions

2008-01-17 Thread Antoine Pitrou
Antoine Pitrou added the comment: Rather than devising something specific to the co_firstlineno attribute, why not have functools.update_wrapper add a "wrapped_func" attribute pointing to the original function object? That way, each function inspecting the decorated function would have the opport

[issue1764286] inspect.getsource does not work with decorated functions

2007-11-23 Thread Christian Heimes
Christian Heimes added the comment: I'm setting the target to 2.6 and 3.0. Maybe somebody can come up with a sensible patch. -- nosy: +tiran title: Now: inspect.getsource does not work with decorated functions Was: inspect.getsource does not work with decorated functions versions: +