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
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.
--
__
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
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
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
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
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