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

2018-08-02 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-31 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 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-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 rep...@bugs.python.org http://bugs.python.org/issue1764286

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

2014-09-26 Thread Berker Peksag
Changes by Berker Peksag berker.pek...@gmail.com: -- stage: patch review - resolved ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1764286 ___ ___

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

2014-08-25 Thread Claudiu Popa
Changes by Claudiu Popa pcmantic...@gmail.com: -- stage: test needed - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1764286 ___ ___

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

2014-04-15 Thread Yury Selivanov
Changes by Yury Selivanov yselivanov...@gmail.com: -- assignee: - yselivanov ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1764286 ___ ___

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

2014-01-28 Thread Yury Selivanov
Changes by Yury Selivanov yselivanov...@gmail.com: -- nosy: +yselivanov versions: +Python 3.5 -Python 2.7, Python 3.2, Python 3.3, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1764286

[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 alexander.belopol...@gmail.com: -- assignee: belopolsky - ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1764286 ___

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

2013-01-27 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- versions: +Python 3.3, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1764286 ___ ___

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

2010-07-19 Thread Ray.Allen
Ray.Allen ysj@gmail.com 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

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

2010-07-18 Thread Alexander Belopolsky
Alexander Belopolsky belopol...@users.sourceforge.net 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

[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] http://bugs.python.org/issue1764286

[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