Message286119
The following might be either a bug in the pydoc module or in the inspect module:
$ python
Python 2.7.12 (default, Nov 19 2016, 06:48:10)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pydoc
>>> pydoc.help(lambda (a,): lambda x: a) # this fails
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/pydoc.py", line 1797, in __call__
self.help(request)
File "/usr/lib/python2.7/pydoc.py", line 1844, in help
else: doc(request, 'Help on %s:')
File "/usr/lib/python2.7/pydoc.py", line 1581, in doc
pager(render_doc(thing, title, forceload))
File "/usr/lib/python2.7/pydoc.py", line 1576, in render_doc
return title % desc + '\n\n' + text.document(object, name)
File "/usr/lib/python2.7/pydoc.py", line 363, in document
if inspect.isroutine(object): return self.docroutine(*args)
File "/usr/lib/python2.7/pydoc.py", line 1321, in docroutine
args, varargs, varkw, defaults = inspect.getargspec(object)
File "/usr/lib/python2.7/inspect.py", line 817, in getargspec
args, varargs, varkw = getargs(func.func_code)
File "/usr/lib/python2.7/inspect.py", line 791, in getargs
args[i] = stack[0]
IndexError: list index out of range
>>> pydoc.help(lambda (a,): lambda x: x) # this succeeds
>>> |
|
Date |
User |
Action |
Args |
2017-01-23 21:50:38 | Elias Vanderstuyft | set | recipients:
+ Elias Vanderstuyft |
2017-01-23 21:50:38 | Elias Vanderstuyft | set | messageid: <1485208238.9.0.161996393795.issue29354@psf.upfronthosting.co.za> |
2017-01-23 21:50:38 | Elias Vanderstuyft | link | issue29354 messages |
2017-01-23 21:50:38 | Elias Vanderstuyft | create | |
|