Skip to content
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

gh-60712: Include the "object" type in the lists of documented types #103036

Open
wants to merge 28 commits into
base: main
Choose a base branch
from

Conversation

furkanonder
Copy link
Contributor

@furkanonder furkanonder commented Mar 25, 2023

Lib/test/test_class.py Outdated Show resolved Hide resolved
@terryjreedy
Copy link
Member

The original author was Martin Panter, @vadmium. I fixed the co-authorship note.

@terryjreedy terryjreedy requested review from vadmium and removed request for Eclips4 March 29, 2023 17:56
@CAM-Gerlach CAM-Gerlach added the docs Documentation in the Doc dir label Mar 29, 2023
Copy link
Member

@CAM-Gerlach CAM-Gerlach left a comment

Choose a reason for hiding this comment

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

Standard reminder: You can directly apply all the suggestions you want in one go by going to Files changed -> Clicking Add to batch on each suggestion -> When done, clicking Commit

Thanks! Various further textual, syntactic and formatting fixes.

Doc/library/stdtypes.rst Outdated Show resolved Hide resolved
Doc/reference/datamodel.rst Outdated Show resolved Hide resolved
Doc/reference/datamodel.rst Outdated Show resolved Hide resolved
Doc/reference/datamodel.rst Outdated Show resolved Hide resolved
Doc/reference/datamodel.rst Outdated Show resolved Hide resolved
Doc/reference/datamodel.rst Outdated Show resolved Hide resolved
Doc/reference/datamodel.rst Outdated Show resolved Hide resolved
Doc/reference/datamodel.rst Outdated Show resolved Hide resolved
Doc/reference/datamodel.rst Outdated Show resolved Hide resolved
Doc/reference/datamodel.rst Outdated Show resolved Hide resolved
furkanonder and others added 5 commits March 30, 2023 12:48
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
furkanonder and others added 3 commits April 1, 2023 01:12
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
'dictionaries' to 'dict'

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
@terryjreedy terryjreedy self-assigned this Jun 18, 2023
Copy link
Member

@terryjreedy terryjreedy left a comment

Choose a reason for hiding this comment

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

I have not reviewed changes to special methods section. Will make other changes on my local copy.

Doc/reference/datamodel.rst Outdated Show resolved Hide resolved
Doc/library/stdtypes.rst Outdated Show resolved Hide resolved
Doc/reference/datamodel.rst Outdated Show resolved Hide resolved
Lib/test/test_class.py Show resolved Hide resolved
Lib/test/test_class.py Outdated Show resolved Hide resolved
@bedevere-bot
Copy link

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@furkanonder furkanonder changed the title GH-60712: Include the "object" type in the lists of documented types gh-60712: Include the "object" type in the lists of documented types Aug 6, 2023
Doc/library/stdtypes.rst Outdated Show resolved Hide resolved
Doc/reference/datamodel.rst Outdated Show resolved Hide resolved
Doc/reference/datamodel.rst Outdated Show resolved Hide resolved
Copy link
Contributor

@willingc willingc left a comment

Choose a reason for hiding this comment

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

Thanks for the changes to the standard library docs and the additional test.

I recommend that several of the additions to the Language Reference should be removed. For the language reference, we are trying to be concise and focus on syntax and semantics of the language with less focus on the implementation details (which would be appropriate in the standard library docs)..

Doc/reference/datamodel.rst Outdated Show resolved Hide resolved
Doc/reference/datamodel.rst Outdated Show resolved Hide resolved
Doc/reference/datamodel.rst Outdated Show resolved Hide resolved
Doc/reference/datamodel.rst Outdated Show resolved Hide resolved
Doc/reference/datamodel.rst Outdated Show resolved Hide resolved
Doc/reference/datamodel.rst Outdated Show resolved Hide resolved
@@ -1733,10 +1741,10 @@ Basic customization

.. method:: object.__str__(self)
Copy link
Member

@merwok merwok Oct 19, 2024

Choose a reason for hiding this comment

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

I thought we had a doc bug years ago where we came up with a convention to differentiate object.__str__ (actual method that exists in the object class), anyclass.__bases__ (method that exists on all class; explaining the data model) and someclass.__str__ (method you can define in your class to implement a protocol)

I guess we didn’t…

Copy link
Contributor

@willingc willingc left a comment

Choose a reason for hiding this comment

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

Thanks @furkanonder.

@furkanonder
Copy link
Contributor Author

furkanonder commented Oct 20, 2024

Thanks @furkanonder.

You are welcome.

Co-authored-by: Éric <merwok@netwok.org>
Doc/library/stdtypes.rst Outdated Show resolved Hide resolved
@@ -2043,10 +2044,10 @@ Basic customization

.. method:: object.__str__(self)

Called by :func:`str(object) <str>` and the built-in functions
:func:`format` and :func:`print` to compute the "informal" or nicely
Called by :func:`str(object) <str>`, the default :meth:`__format__` implementation,
Copy link
Member

Choose a reason for hiding this comment

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

Does this role (without class reference) create a proper link to the __format__ method doc?

Copy link
Contributor Author

@furkanonder furkanonder Oct 21, 2024

Choose a reason for hiding this comment

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

When you click on :meth:`__format__, it directs you to object.__format__(self, format_spec)

Doc/reference/datamodel.rst Outdated Show resolved Hide resolved
:class:`tuples <tuple>`) or :term:`mappings <mapping>` (like
:class:`dictionaries <dict>`),
:term:`dictionaries <dictionary>`),
Copy link
Member

Choose a reason for hiding this comment

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

🤔 Hm… on the line before, we see a general term used (with a link to glossary) and a concrete example in parens (list and tuple links), then we have the general/glossary term mappings and should keep the specific type dict in parens to keep the intent of the text. On the other hand, if the glossary term for dictionaries is a better explanation than the dict type/function doc, and more specific than the term for mappings, the changed link could be an improvement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.14 new features, bugs and security fixes awaiting merge docs Documentation in the Doc dir tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.