Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

broken native python doc abilities #20

Open
AloisMahdal opened this issue Mar 26, 2015 · 0 comments
Open

broken native python doc abilities #20

AloisMahdal opened this issue Mar 26, 2015 · 0 comments

Comments

@AloisMahdal
Copy link

i3 module is not able to support traditional ways of accessing documentation and exploring the module.

For example, pydoc i3 gives this traceback:

Traceback (most recent call last):
  File "/usr/bin/pydoc", line 5, in <module>
    pydoc.cli()
  File "/usr/lib64/python2.7/pydoc.py", line 2361, in cli
    help.help(arg)
  File "/usr/lib64/python2.7/pydoc.py", line 1829, in help
    elif request: doc(request, 'Help on %s:')
  File "/usr/lib64/python2.7/pydoc.py", line 1568, in doc
    pager(render_doc(thing, title, forceload))
  File "/usr/lib64/python2.7/pydoc.py", line 1563, in render_doc
    return title % desc + '\n\n' + text.document(object, name)
  File "/usr/lib64/python2.7/pydoc.py", line 357, in document
    if inspect.ismodule(object): return self.docmodule(*args)
  File "/usr/lib64/python2.7/pydoc.py", line 1111, in docmodule
    for importer, modname, ispkg in pkgutil.iter_modules(object.__path__):
  File "/usr/lib64/python2.7/pkgutil.py", line 143, in iter_modules
    importers = map(get_importer, path)
TypeError: argument 2 to map() must support iteration

Also, the module object cannot iterate its members:

$ python
Python 2.7.8 (default, Nov 10 2014, 08:19:18) 
[GCC 4.9.2 20141101 (Red Hat 4.9.2-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import i3
>>> dir(i3)
['__module__', '__name__']
>>> 

which has also the effect that tab completion does not work in smart python shells like IPython.

I think this is caused by the fact that the module object is somehow assembled on the fly but does not support all necessary methods.

(I may be looking into this and come up with more specifics or even a PR ... if I have time, which I can't promise now :/)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant