You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
help() appears to be broken; doesn't display __doc__ for class type when called as help(type) #57790
bpo-1785: "inspect" gets broken by some descriptors
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2011-12-21.09:18:54.799>created_at=<Date2011-12-11.18:26:28.407>labels= ['interpreter-core', 'type-bug', 'docs']
title="help() appears to be broken; doesn't display __doc__ for class type when called as help(type)"updated_at=<Date2011-12-21.09:18:54.797>user='https://bugs.python.org/christopherthemagnificent'
| Data descriptors defined here:
|
| __abstractmethods__
|
| __base__
|
| __bases__
|
| __basicsize__
|
| __dict__
|
| __dictoffset__
|
| __flags__
|
| __itemsize__
|
| __mro__
|
| __weakrefoffset__
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| __new__ = <built-in method __new__ of type object at 0x145600>
| T.__new__(S, ...) -> a new object with type S, a subtype of T
|
| __prepare__ = <built-in method __prepare__ of type object at 0x145600>
| __prepare__() -> dict
| used to create the namespace for the class statement
>>> type.__doc__
"type(object) -> the object's type\ntype(name, bases, dict) -> a new type"
>>>
observe help(type) and type.__doc__ in Python 3.2:
>>> help(type)
Help on class type in module builtins:
type = <class 'type'>
>>> type.__doc__
"type(object) -> the object's type\ntype(name, bases, dict) -> a new type"
>>>
It appears that the __doc__ attribute of <class 'type'> is unchanged from Python 3.1 to 3.2, but it is not being displayed by the help function in Python 3.2.
The help function is very important to using Python! This should be fixed.
Activity
christopherthemagnificent commentedon Dec 11, 2011
observe help(type) and type.__doc__ in Python 3.1:
| Data descriptors defined here:
|
| __abstractmethods__
|
| __base__
|
| __bases__
|
| __basicsize__
|
| __dict__
|
| __dictoffset__
|
| __flags__
|
| __itemsize__
|
| __mro__
|
| __weakrefoffset__
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| __new__ = <built-in method __new__ of type object at 0x145600>
| T.__new__(S, ...) -> a new object with type S, a subtype of T
|
| __prepare__ = <built-in method __prepare__ of type object at 0x145600>
| __prepare__() -> dict
| used to create the namespace for the class statement
observe help(type) and type.__doc__ in Python 3.2:
It appears that the __doc__ attribute of <class 'type'> is unchanged from Python 3.1 to 3.2, but it is not being displayed by the help function in Python 3.2.
The help function is very important to using Python! This should be fixed.
amauryfa commentedon Dec 11, 2011
It fails for the same reason as bpo-1785:
python-dev commentedon Dec 21, 2011
New changeset 902f694a7b0e by Antoine Pitrou in branch '3.2':
Issue bpo-1785: Fix inspect and pydoc with misbehaving descriptors.
http://hg.python.org/cpython/rev/902f694a7b0e
New changeset b08bf8df8eec by Antoine Pitrou in branch 'default':
Issue bpo-1785: Fix inspect and pydoc with misbehaving descriptors.
http://hg.python.org/cpython/rev/b08bf8df8eec
python-dev commentedon Dec 21, 2011
New changeset 13f56cd8dec1 by Antoine Pitrou in branch '2.7':
Issue bpo-1785: Fix inspect and pydoc with misbehaving descriptors.
http://hg.python.org/cpython/rev/13f56cd8dec1
pitrou commentedon Dec 21, 2011
Now fixed in all 3 branches.