Skip to content

Commit 6b63ee9

Browse files
committed
docs: resolve the pad_length, _make_uint and copyreg references left by #2704 and #2722
- protocol.rst linked pad_length at pcapkit.corekit.fields.strings, its home before #2704; it links pcapkit.corekit.schema.padding now. - protocol.rst documented Protocol._make_uint twice, beside _make_index and among the value helpers; the value-helper entry stays, in the Protocol autoclass, the ProtocolBase method group and its link list alike. - ReduceAsProtocol2 names copyreg._reduce_ex and copyreg.__newobj__ as literals, since intersphinx holds neither private name. - HIP and IPv6_Route filed their #2676 note under versionremoved 1.6.0; it moves, unreworded, into each class's versionchanged 1.6.0 list. Docstrings and .rst only; the AST is equal once docstrings are stripped.
1 parent 468f9c2 commit 6b63ee9

4 files changed

Lines changed: 11 additions & 15 deletions

File tree

‎docs/source/pcapkit/protocols/protocol.rst‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ Internal Definitions below.
8080
.. automethod:: _get_payload
8181

8282
.. automethod:: _make_data
83-
.. automethod:: _make_uint
8483
.. automethod:: _make_index
8584
.. automethod:: _make_payload
8685
.. automethod:: _packing_target
@@ -177,7 +176,7 @@ one its field cannot carry rather than masking it (:issue:`2617`):
177176
cut left out, for the rebuild to cut back.
178177

179178
:meth:`~Protocol._uint_size` counts the octets a variable-width integer needs,
180-
and :func:`~pcapkit.corekit.fields.strings.pad_length` the padding that takes a
179+
and :func:`~pcapkit.corekit.schema.padding.pad_length` the padding that takes a
181180
length to an alignment boundary.
182181

183182
Data Models
@@ -241,7 +240,6 @@ Internal Definitions
241240
_read_packet
242241
_get_payload
243242
_make_data
244-
_make_uint
245243
_make_index
246244
_make_payload
247245
_packing_target
@@ -286,7 +284,7 @@ Internal Definitions
286284
:meth:`~Protocol.decode`, :meth:`~Protocol.unquote`,
287285
:meth:`~Protocol.resolve_index`, :meth:`~Protocol.expand_comp`,
288286
:meth:`~Protocol._read_packet`, :meth:`~Protocol._get_payload`,
289-
:meth:`~Protocol._make_data`, :meth:`~Protocol._make_uint`,
287+
:meth:`~Protocol._make_data`,
290288
:meth:`~Protocol._make_index`, :meth:`~Protocol._make_payload`,
291289
:meth:`~Protocol._packing_target`, :meth:`~Protocol._read_unpack`,
292290
:meth:`~Protocol._read_octets`, :meth:`~Protocol._read_uint`,

‎pcapkit/protocols/internet/hip.py‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,11 @@ class HIP(IPv6_Ext[Data_HIP, Schema_HIP], Internet[Data_HIP, Schema_HIP],
423423
:meth:`make` for parameters too long for the Header Length, and so do
424424
the ``PUZZLE`` and registration makers for a lifetime that is a
425425
:obj:`bool` or not a finite number of seconds (:issue:`2614`).
426+
* The same makers raise it for a fixed-size octet argument of the wrong
427+
width -- the checksum, the ``PUZZLE`` and ``SOLUTION`` opaque data, the
428+
``PAYLOAD_MIC`` payload data, or reserved octets -- rather than padding
429+
or cutting it to the field. The opaque and payload data default to
430+
zeros of that width (:issue:`2676`).
426431
* Each enumeration field of :meth:`make` and of the parameter makers,
427432
and the code of each parameter in ``parameters``, as a ``(code,
428433
value)`` pair or parsed data, takes a member or an :class:`int` code,
@@ -455,12 +460,6 @@ class HIP(IPv6_Ext[Data_HIP, Schema_HIP], Internet[Data_HIP, Schema_HIP],
455460
:meth:`~pcapkit.protocols.protocol.Protocol.resolve_index` first
456461
(:issue:`2594`).
457462
458-
The same makers raise it for a fixed-size octet argument of the wrong
459-
width -- the checksum, the ``PUZZLE`` and ``SOLUTION`` opaque data, the
460-
``PAYLOAD_MIC`` payload data, or reserved octets -- rather than padding
461-
or cutting it to the field. The opaque and payload data default to
462-
zeros of that width (:issue:`2676`).
463-
464463
"""
465464

466465
##########################################################################

‎pcapkit/protocols/internet/ipv6_route.py‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ class IPv6_Route(IPv6_Ext[Data_IPv6_Route, Schema_IPv6_Route],
123123
:exc:`~pcapkit.utilities.exceptions.ProtocolError`, rather than
124124
writing a different value or raising another exception
125125
(:issue:`2614`).
126+
* The Source Route and Type 2 makers raise it for ``reserved`` octets that
127+
are not four, rather than padding or cutting them (:issue:`2676`).
126128
* Each enumeration field of :meth:`make`, ``next`` and ``type``, takes
127129
a member or an :class:`int` code, resolved with the enumeration's
128130
``get``; a name, a :obj:`bool`, or a code that does not fit in one
@@ -138,9 +140,6 @@ class IPv6_Route(IPv6_Ext[Data_IPv6_Route, Schema_IPv6_Route],
138140
:meth:`~pcapkit.protocols.protocol.Protocol.resolve_index` first
139141
(:issue:`2594`).
140142
141-
The Source Route and Type 2 makers raise it for ``reserved`` octets that
142-
are not four, rather than padding or cutting them (:issue:`2676`).
143-
144143
"""
145144

146145
##########################################################################

‎pcapkit/utilities/pickle.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class ReduceAsProtocol2:
3535
"""Mixin reducing an instance under every :mod:`pickle` protocol as protocol 2 does.
3636
3737
Below protocol 2, :meth:`object.__reduce_ex__` hands the instance to
38-
:func:`copyreg._reduce_ex`, which walks ``type(self).__mro__`` for the first
38+
``copyreg._reduce_ex``, which walks ``type(self).__mro__`` for the first
3939
base that is not a heap type and, unless that base is :class:`object`, calls it
4040
on the instance. :class:`~typing.Generic` is a heap type on CPython, so the walk
4141
passes it. GraalPy builds ``Generic`` as a built-in, so the walk stops there and
@@ -45,7 +45,7 @@ class ReduceAsProtocol2:
4545
4646
Protocol 2's reduction reads the class and the instance state without that
4747
walk, slots included, and protocol 0 and 1 write it as an ordinary call of
48-
:func:`copyreg.__newobj__`, restoring the instance through ``__new__`` as
48+
``copyreg.__newobj__``, restoring the instance through ``__new__`` as
4949
protocol 2 does. The next ``__reduce_ex__`` in the MRO builds it, so a base
5050
with a reduction of its own keeps it, as
5151
:class:`~pcapkit.corekit.infoclass.OrderedMultiInfo` keeps

0 commit comments

Comments
 (0)