[issue21217] inspect.getsourcelines finds wrong lines when lambda used argument to decorator

2014-04-14 Thread Thomas Ballinger
New submission from Thomas Ballinger: https://gist.github.com/thomasballinger/10666031 """ inspect.getsourcelines incorrectly guesses what lines correspond to the function foo see getblock in inspect.py once it finds a lambda, def or class it finishes it then stops so get

[issue21217] inspect.getsourcelines finds wrong lines when lambda used argument to decorator

2014-04-14 Thread Thomas Ballinger
Thomas Ballinger added the comment: "The code object's co_lnotab is how inspect should be getting the sourcelines of the code, instead of looking for the first codeblock." I'm looking at this now, thanks to Yhg1s for the above. -- __

[issue16782] No curses.initwin: Incorrect package docstring for curses

2012-12-25 Thread Thomas Ballinger
New submission from Thomas Ballinger: Lib/curses/__init__.py has `curses.initwin()` in the docstring example code, but this function does not exist (should be `initscr()`) Bad in at least back to 2.4 -- assignee: docs@python components: Documentation files: docfix.patch keywords

[issue21217] inspect.getsourcelines finds wrong lines when lambda used argument to decorator

2015-04-13 Thread Thomas Ballinger
Thomas Ballinger added the comment: v4 of patch, with tests updated for changed lines in inspect fodder file -- Added file: http://bugs.python.org/file38959/issue21217-v4.patch ___ Python tracker <http://bugs.python.org/issue21

[issue21217] inspect.getsourcelines finds wrong lines when lambda used argument to decorator

2015-04-13 Thread Thomas Ballinger
Thomas Ballinger added the comment: Patch reformatted to be non-git style, NEWS item removed -- Added file: http://bugs.python.org/file38965/issue21217-v5.patch ___ Python tracker <http://bugs.python.org/issue21

[issue21217] inspect.getsourcelines finds wrong lines when lambda used argument to decorator

2015-04-13 Thread Thomas Ballinger
Thomas Ballinger added the comment: Use dis.findlinestarts() to find lines of function instead of grubbing with co_lnotab manually, making dis module dependency non-optional. -- Added file: http://bugs.python.org/file38970/issue21217-v6.patch

[issue21217] inspect.getsourcelines finds wrong lines when lambda used argument to decorator

2015-04-14 Thread Thomas Ballinger
Thomas Ballinger added the comment: Thanks Antoine! Could you add Allison Kaptur to NEWS and ACKS? This was an update to her original patch, and we paired on the whole thing. -- ___ Python tracker <http://bugs.python.org/issue21