Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
c95c93d4
Commit
c95c93d4
authored
May 24, 2019
by
Cheryl Sabella
Committed by
GitHub
May 24, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-20285: Improve help docs for object (GH-4759)
parent
f1e17e9f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
3 deletions
+11
-3
Lib/pydoc.py
Lib/pydoc.py
+2
-2
Misc/NEWS.d/next/Documentation/2017-12-08-20-30-37.bpo-20285.cfnp0J.rst
...xt/Documentation/2017-12-08-20-30-37.bpo-20285.cfnp0J.rst
+3
-0
Objects/typeobject.c
Objects/typeobject.c
+6
-1
No files found.
Lib/pydoc.py
View file @
c95c93d4
...
...
@@ -867,7 +867,7 @@ class HTMLDoc(Doc):
thisclass
=
attrs
[
0
][
2
]
attrs
,
inherited
=
_split_list
(
attrs
,
lambda
t
:
t
[
2
]
is
thisclass
)
if
thisclass
is
builtins
.
object
:
if
object
is
not
builtins
.
object
and
thisclass
is
builtins
.
object
:
attrs
=
inherited
continue
elif
thisclass
is
object
:
...
...
@@ -1327,7 +1327,7 @@ location listed above.
thisclass
=
attrs
[
0
][
2
]
attrs
,
inherited
=
_split_list
(
attrs
,
lambda
t
:
t
[
2
]
is
thisclass
)
if
thisclass
is
builtins
.
object
:
if
object
is
not
builtins
.
object
and
thisclass
is
builtins
.
object
:
attrs
=
inherited
continue
elif
thisclass
is
object
:
...
...
Misc/NEWS.d/next/Documentation/2017-12-08-20-30-37.bpo-20285.cfnp0J.rst
0 → 100644
View file @
c95c93d4
Expand object.__doc__ (docstring) to make it clearer.
Modify pydoc.py so that help(object) lists object methods
(for other classes, help omits methods of the object base class.)
Objects/typeobject.c
View file @
c95c93d4
...
...
@@ -4750,6 +4750,11 @@ static PyMethodDef object_methods[] = {
{
0
}
};
PyDoc_STRVAR
(
object_doc
,
"object()
\n
--
\n\n
"
"The base class of the class hierarchy.
\n\n
"
"When called, it accepts no arguments and returns a new featureless
\n
"
"instance that has no instance attributes and cannot be given any.
\n
"
);
PyTypeObject
PyBaseObject_Type
=
{
PyVarObject_HEAD_INIT
(
&
PyType_Type
,
0
)
...
...
@@ -4772,7 +4777,7 @@ PyTypeObject PyBaseObject_Type = {
PyObject_GenericSetAttr
,
/* tp_setattro */
0
,
/* tp_as_buffer */
Py_TPFLAGS_DEFAULT
|
Py_TPFLAGS_BASETYPE
,
/* tp_flags */
PyDoc_STR
(
"object()
\n
--
\n\n
The most base type"
),
/* tp_doc */
object_doc
,
/* tp_doc */
0
,
/* tp_traverse */
0
,
/* tp_clear */
object_richcompare
,
/* tp_richcompare */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment