| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
For context, I am aware of gh-88427 (the SocketType documentation being called misleading) and the open deprecation proposal in #126272. This change is limited to the directive role: it switches .. data:: to .. class:: so existing :class: cross-references resolve, and leaves the deprecation question untouched. While SocketType remains public it should carry the correct role; if it is deprecated later, this can be revisited. |
Sorry, something went wrong.
Documentation build overview83 files changed · + 1 added · ± 82 modified + Added ± Modified |
Sorry, something went wrong.
|
Amended: this now also corrects the misleading description (SocketType is the base class of socket.socket, not type(socket(...))), addressing gh-88427. That overlaps with #93288, which fixes the wording alone; this combines it with the role change. |
Sorry, something went wrong.
|
Backward-compatibility check. No independent :data: references were found, and SocketType is already proposed for deprecation (gh-88427). Minimal breakage. |
Sorry, something went wrong.
socket.SocketType is a class (re-exported from _socket as an alias of _socket.socket, the base class of socket.socket), but was documented with the ".. data::" directive, so ":class:" cross-references to it cannot resolve against a py:class target. Switch the entry to ".. class::", correct the misleading description (SocketType is the base class of the socket type, not "type(socket(...))" which is socket.socket; addresses pythongh-88427), move it into the Socket Objects section, and document the socket object methods and attributes nested under the socket class, dropping the redundant "socket." prefix.
There was a problem hiding this comment.
Ah thank you! The rendered documentation is much better like that!
There is now a bunch of warnings on the documentation, such as: "c:func reference target not found: connect [ref.func]". I suggested fixes.
Sorry, something went wrong.
Suppress C-domain cross-references that have no target by using the non-link form (``:c:func:`!connect```, ``!setsockopt``, ``!SCM_RIGHTS``) and mark the absent ``read``/``write`` methods as non-links, as suggested in review. The underlying ``close`` call refers to the C library function, so use ``:c:func:`!close``` rather than a Python method role.
Drop the Socket Objects restructure and the second `.. class:: socket` that required `:noindex:`. Keep only the change of `SocketType` from `.. data::` to `.. class::`, in its original place after the `socket` class, with a corrected description: SocketType is the base class of socket re-exported from _socket, not `type(socket(...))`.
…et methods" This reverts commit c08bf8c.
Per review, document SocketType after the socket class rather than before it.
There was a problem hiding this comment.
LGTM.
Sorry, something went wrong.
|
Thanks @gaborbernat for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.15. |
Sorry, something went wrong.
|
GH-151244 is a backport of this pull request to the 3.15 branch. |
Sorry, something went wrong.
|
Thanks @gaborbernat for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13. |
Sorry, something went wrong.
|
Thanks @gaborbernat for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. |
Sorry, something went wrong.
|
Sorry, @gaborbernat and @vstinner, I could not cleanly backport this to 3.13 due to a conflict. cherry_picker a621e8ad811e7d51d69b0969a2bd07888a02db1e 3.13 |
Sorry, something went wrong.
|
Sorry, @gaborbernat and @vstinner, I could not cleanly backport this to 3.14 due to a conflict. cherry_picker a621e8ad811e7d51d69b0969a2bd07888a02db1e 3.14 |
Sorry, something went wrong.
|
GH-151245 is a backport of this pull request to the 3.14 branch. |
Sorry, something went wrong.
|
Merged. Thanks for your contribution. |
Sorry, something went wrong.
…151244) gh-89554: Document socket.SocketType as a class (GH-150683) socket.SocketType is a class (re-exported from _socket as an alias of _socket.socket, the base class of socket.socket), but was documented with the ".. data::" directive, so ":class:" cross-references to it cannot resolve against a py:class target. Switch the entry to ".. class::", correct the misleading description (SocketType is the base class of the socket type, not "type(socket(...))" which is socket.socket; addresses gh-88427), move it into the Socket Objects section, and document the socket object methods and attributes nested under the socket class, dropping the redundant "socket." prefix. (cherry picked from commit a621e8a) Co-authored-by: Bernát Gábor <gaborjbernat@gmail.com>
…1245) gh-89554: Document socket.SocketType as a class (#150683) socket.SocketType is a class (re-exported from _socket as an alias of _socket.socket, the base class of socket.socket), but was documented with the ".. data::" directive, so ":class:" cross-references to it cannot resolve against a py:class target. Switch the entry to ".. class::", correct the misleading description (SocketType is the base class of the socket type, not "type(socket(...))" which is socket.socket; addresses gh-88427), move it into the Socket Objects section, and document the socket object methods and attributes nested under the socket class, dropping the redundant "socket." prefix. (cherry picked from commit a621e8a) Co-authored-by: Bernát Gábor <gaborjbernat@gmail.com>
#151245) (#151254) [3.14] gh-89554: Document socket.SocketType as a class (#150683) (#151245) gh-89554: Document socket.SocketType as a class (#150683) socket.SocketType is a class (re-exported from _socket as an alias of _socket.socket, the base class of socket.socket), but was documented with the ".. data::" directive, so ":class:" cross-references to it cannot resolve against a py:class target. Switch the entry to ".. class::", correct the misleading description (SocketType is the base class of the socket type, not "type(socket(...))" which is socket.socket; addresses gh-88427), move it into the Socket Objects section, and document the socket object methods and attributes nested under the socket class, dropping the redundant "socket." prefix. Backport to 3.13: Replace ":platform: Windows" with ".. availability:: Windows" in ioctl() method. (cherry picked from commit a621e8a) (cherry picked from commit 4ef6a37) Co-authored-by: Bernát Gábor <gaborjbernat@gmail.com>
socket.SocketType is a class (re-exported from _socket as an alias of _socket.socket, the base class of socket.socket), but was documented with the ".. data::" directive, so ":class:" cross-references to it cannot resolve against a py:class target. Switch the entry to ".. class::", correct the misleading description (SocketType is the base class of the socket type, not "type(socket(...))" which is socket.socket; addresses pythongh-88427), move it into the Socket Objects section, and document the socket object methods and attributes nested under the socket class, dropping the redundant "socket." prefix.
| Back | FazBrowse Home | New Git URL |
socket.SocketType is a class, but the documentation marks it with the .. data:: directive, so :class: cross-references to it cannot resolve against a py:class target.
This switches the entry to .. class::. It also corrects the description: SocketType is re-exported from _socket as an alias of _socket.socket, the base class of socket.socket, so isinstance(socket(...), SocketType) is true while type(socket(...)) is socket.socket itself. The current wording, "the same as type(socket(...))", is the misleading text reported in gh-88427.
This overlaps with #93288, which corrects the same sentence but keeps .. data::. This PR combines that wording fix with the role fix.
Refs: gh-89554, gh-88427. Documentation-only change, so no Misc/NEWS entry (skip news).
This file is not covered by CODEOWNERS, so cc @vstinner, who reviews most socket changes.