Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-101100: Fix most Sphinx nitpicks in the glossary andstdtypes.rst#112757

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

AlexWaygood
Copy link
Member

@AlexWaygoodAlexWaygood commentedDec 5, 2023
edited by github-actionsbot
Loading

This doesn't get rid of all the Sphinx warnings in either file (there are some tricky ones in both that I'd rather defer for now), but it gets rid of most in both.


📚 Documentation preview 📚:https://cpython-previews--112757.org.readthedocs.build/

Comment on lines +5241 to +5242
The :meth:`!__or__` method for type objects was added to support the syntax
``X | Y``. If a metaclass implements :meth:`!__or__`, the Union may
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I considered linking tohttps://docs.python.org/3/reference/datamodel.html#object.__or__, but the data model only discusses implementing__or__ in the context of emulating numeric types, and that's pretty distinct to the purpose oftype.__or__

@@ -383,7 +385,7 @@ Glossary

file object
An object exposing a file-oriented API (with methods such as
:meth:`read()` or :meth:`write()`) to an underlying resource. Depending
:meth:`!read` or :meth:`!write`) to an underlying resource. Depending

Choose a reason for hiding this comment

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

It can refer toio.BaseIO.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I'm not sure there's anything we could specifically link to for either method.io.IOBase does not haveread() orwrite() as abstract methods, so neitherIOBase.read norIOBase.write is explicitly documented currently.

https://docs.python.org/3/library/io.html#io.IOBase

Here's all theIOBase docs say onread andwrite:

Even thoughIOBase does not declare read() or write() because their signatures will vary, implementations and clients should consider those methods part of the interface. Also, implementations may raise aValueError (orUnsupportedOperation) when operations they do not support are called.

Specific subclasses ofIOBase implement versions ofread andwrite that either only work with raw binary streams or only work with text streams

Choose a reason for hiding this comment

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

Well, and there is a reason to not declare them there. But there are many other references toread andwrite. It would be nice to have the general interface of them be documented somewhere. It is a different issue.

AlexWaygood reacted with thumbs up emoji
@@ -383,7 +385,7 @@ Glossary

file object
An object exposing a file-oriented API (with methods such as
:meth:`read()` or :meth:`write()`) to an underlying resource. Depending
:meth:`!read` or :meth:`!write`) to an underlying resource. Depending

Choose a reason for hiding this comment

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

Well, and there is a reason to not declare them there. But there are many other references toread andwrite. It would be nice to have the general interface of them be documented somewhere. It is a different issue.

AlexWaygood reacted with thumbs up emoji
@AlexWaygoodAlexWaygood merged commite3f670e intopython:mainDec 6, 2023
@AlexWaygoodAlexWaygood deleted the sphinx-glossary-stdtypes branchDecember 6, 2023 08:44
@miss-islington-app
Copy link

Thanks@AlexWaygood for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestDec 6, 2023
…es.rst` (pythonGH-112757)(cherry picked from commite3f670e)Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
@bedevere-app
Copy link

GH-112789 is a backport of this pull request to the3.12 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.12only security fixes labelDec 6, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestDec 6, 2023
…es.rst` (pythonGH-112757)(cherry picked from commite3f670e)Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
@bedevere-app
Copy link

GH-112790 is a backport of this pull request to the3.11 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.11only security fixes labelDec 6, 2023
AlexWaygood added a commit that referenced this pull requestDec 6, 2023
…pes.rst` (GH-112757) (#112789)gh-101100: Fix most Sphinx nitpicks in the glossary and `stdtypes.rst` (GH-112757)(cherry picked from commite3f670e)Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
AlexWaygood added a commit that referenced this pull requestDec 6, 2023
…pes.rst` (GH-112757) (#112790)gh-101100: Fix most Sphinx nitpicks in the glossary and `stdtypes.rst` (GH-112757)(cherry picked from commite3f670e)Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
aisk pushed a commit to aisk/cpython that referenced this pull requestFeb 11, 2024
Glyphack pushed a commit to Glyphack/cpython that referenced this pull requestSep 2, 2024
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@serhiy-storchakaserhiy-storchakaserhiy-storchaka approved these changes

Assignees
No one assigned
Labels
docsDocumentation in the Doc dirskip news
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@AlexWaygood@serhiy-storchaka

[8]ページ先頭

©2009-2025 Movatter.jp