8000 bpo-40304: Correct type(name, bases, dict) doc by verhovsky · Pull Request #19553 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-40304: Correct type(name, bases, dict) doc #19553

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

Merged
merged 9 commits into from
Jan 22, 2021
Prev Previous commit
Next Next commit
Update Doc/library/functions.rst
Co-authored-by: Tal Einat <532281+taleinat@users.noreply.github.com>
  • Loading branch information
terryjreedy and taleinat authored Jan 21, 2021
commit 5de9bac68a26cf71d5956bb296c758cfbb11796d
2 changes: 1 addition & 1 deletion Doc/library/functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1709,7 +1709,7 @@ are always available. They are listed here in alphabetical order.
:attr:`~class.__bases__` attribute; if empty, :class:`object`, the
ultimate base of all classes, is added. The *dict* dictionary contains
attribute and method definitions for the class body; it may be copied
or wrapped before becoming the :attr:`~class.__bases__` attribute.
or wrapped before becoming the :attr:`~class.__dict__` attribute.
Copy link
Member
@merwok merwok Jan 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where does this link go?

class.__bases__ is at https://docs.python.org/3/library/stdtypes.html#class.__bases__
does class.__dict__ go to https://docs.python.org/3/reference/datamodel.html#index-48 ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No link is created!

Ideas:

  • keep object.__dict__ but amend the doc there (in library/stdtypes) to describe __dict__ for class objects
  • change the reference to be to __dict__ (class attribute)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since I changed object to class and that does not work, I changed it back for this issue, so it continues to link to
file:///F:/dev/3x/Doc/build/html/library/stdtypes.html#object.dict
Since 'objects' include 'classes', the current text is not incorrect. I consider changing it a separate issue.
If classes were the only objects with dict attribute (I am not sure), and object.dict should be class.dict, a change would require grepping for other references to change. This would be a different issue also.

The following two statements create identical :class:`type` objects:

>>> class X:
Expand Down
0