[Python-3000] help() broken?
Amaury Forgeot d'Arc
amauryfa at gmail.com
Thu Apr 24 10:57:46 CEST 2008
Humberto Diogenes wrote:
> Hi,
>
> It seems that help() doesn't work on instances in py3k.
>
> Is this what this ticket is about?
> http://bugs.python.org/issue1883
>
>
> Python 3.0a4+ (py3k:62469M, Apr 23 2008, 20:46:05)
> [GCC 4.0.1 (Apple Inc. build 5465)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
> >>> class C:
> ... """Bla"""
> ...
> >>> help(C)
> Help on class C in module __main__:
>
> class C(builtins.object)
> | Bla
> |
> | Data descriptors defined here:
> |
> | __dict__
> | dictionary for instance variables (if defined)
> |
> | __weakref__
> | list of weak references to the object (if defined)
>
> >>> c = C()
> >>> help(c)
> Help on C in module __main__:
>
> <__main__.C object at 0x4a8ab8>
>
>
> help(instance) should give the same answer as help(Class), right?
Yes. A bug was introduced in the pydoc.render_doc() function, during
the removal of classic classes:
The "not (inspect.ismodule...)" test should be in a "if" statement,
not a "elif".
If nobody does it before, I will take care of this tonight.
--
Amaury Forgeot d'Arc
More information about the Python-3000
mailing list