[PEAK] how to use "help()" ?
Phillip J. Eby
pje at telecommunity.com
Wed Jan 11 14:48:08 EST 2006
At 02:16 PM 1/11/2006 -0500, Michael Bayer wrote:
>My apologies if this issue is already posted somewhere, I was not able to
>find a mention on the mailing list or in the docs -
>
>I have a user who wants to use the "help()" function on a module that was
>installed as an egg by setuptools. It seems that help() has some
>dependency on the module being linked to a .py file inside real directory:
>
>
>Trying to use help() under python interperter, and get error:
>
> >>> import sqlalchemy
> >>> help(sqlalchemy)
>
>.....
>
>OSError: [Errno 20] Not a directory:
>'/usr/local/lib/python2.4/site-packages/SQLAlchemy-0.91alpha-py2.4.egg/sqlalchemy'
>
>is this just a known issue with help() ?
Yes; the pydoc module is heavily broken with respect to packages,
especially in the presence of zipimport, namespace packages, and PEP 302
import hooks. It needs an overhaul, which I'm thinking about supplying via
monkeypatches in setuptools (as well as official patches to fix it in
future Python versions).
In the meantime, note that it is not a problem for individual modules; you
could do a help() on a specific module or class within sqlalchemy, just not
the package itself. You can also install an egg using --always-unzip, and
it will be extracted to the filesystem so that tools like this will work.
More information about the PEAK
mailing list