You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 867616b
Browse filesBrowse the repository at this point in the historyBrowse files
docs: prefer Protocol over ProtocolBase in cross-references, per the owner's #1103 ruling (#2420)
ProtocolBase is the internal hidden API and Protocol is the one exposing the
attributes, so a plain "here is where this member is documented" link targets
Protocol. The owner then refined this: "Use the last documented override." A
docstring describing what a *specific* class overrides has to name the real
ancestor in that class's own chain, which is never Protocol -- Protocol has no
subclasses at all, so ProtocolBase is the last documented override for every
class in the tree.
* Plain documentation links go to Protocol.<member>: the module-level prose and
`#:` comments in protocol.py, register_protocol/_register_name in
registry/protocols.py, the `register` Arguments and versionchanged clauses in
internet.py, link.py, transport.py and sctp.py, and the unrelated-class
references in sentinels.py, data/data.py, misc/pcap/{frame,header}.py,
ipv6.py, utilities/config.py, conf.py and the mptcp test.
* Override-describing links go to ProtocolBase.<member>: Internet.{register,
from_data,_make_payload}, Link.register, Transport.register, IPv6_Ext.protocol,
the ipv6_ext module docstring and ipv6_ext.rst, the {AH,ESP,HOPOPT,MH}.alias
MRO sentences, NoPayload.protochain, PCAPNG.{length,packet}, HTTP.from_data and
HTTPv2's HTTP.unpack. Each of these says "As X", "the base", "the inherited",
"narrows", "sits between ... in the MRO" or "the guard this shares with", and
the surrounding sentences already name ProtocolBase.
* The `Raises:` clause of each `register` keeps naming ProtocolBase, unchanged:
#2316/#1016 ruled that it names the class the guard's `issubclass` actually
tests while the raised message names Protocol, and
tests/protocols/test_register_class_guard_unit.py asserts exactly that.
* Class-attribute declaration pointers stay on Protocol -- Protocol.__data__
(declared on Protocol itself), Protocol.__keywords__ and
Protocol.__own_make_keywords__ -- since they name where the knob is documented
rather than a method a class overrides.
* ProtocolBase.__init_subclass__ references are still left alone (l2tpv2.py,
c_tag.py, protocol-layer-placement.rst): Protocol does override
__init_subclass__, so those name the base implementation deliberately.
Verified Protocol in no class's __mro__ but its own, and that ProtocolBase
defines and documents every member involved while Protocol declares only
__init_subclass__ and __data__.
AST-structure guard (ast.dump with docstrings stripped) confirms all 12 touched
.py files are prose-only against 27c797d; ipv6_ext.rst carries no code. The
mptcp test, test_docstring_contract.py, test_conventions_doc_claims.py,
test_register_class_guard_unit.py and the docs xref suites pass (91 passed, 22
skipped, 444 subtests), as do tests/protocols, tests/foundation, tests/corekit
and tests/utilities in full (3414 passed, 18 skipped, 60258 subtests).
0 commit comments