#877's phase 2 is half done. #921 re-parented 17 of the 24 non-registry enumerations onto EnumLookup; seven are still outside it, and #877 is closed, so nothing tracks them.
Measured on 4f3d43df7 by walking every importable pcapkit.* module (vendor templates excluded) and filtering on issubclass(cls, EnumLookup):
pcapkit.const.ftp.command.CommandType
pcapkit.const.ftp.command.ConformanceRequirement
pcapkit.protocols.internet.esp.ESPStatus
pcapkit.protocols.internet.mh.FastBindingAcknowledgmentStatus
pcapkit.protocols.internet.mh.IPv6AddressPrefixCode
pcapkit.protocols.internet.mh.LMAAddressCode
pcapkit.protocols.internet.mh.LocalizedRoutingStatus
Why these seven and not the other 17. They were deliberately deferred, not overlooked. At the time #921 was written, const/ftp/command.py was held by #913 and esp.py / mh.py by #904 — so widening the in-flight worker's scope would have collided. All three blockers have since merged (1f433..., b3551cb63), so the contention is gone.
Scope
Re-parent each from (EnumBase,) to (EnumLookup, EnumBase), the same change #921 made for the other 17. #921's own PR is the pattern to follow, including its test file tests/corekit/test_enum_lookup_reparent_877_unit.py.
Two things #921 learned that apply here:
EnumLookup.get is a @classmethod. Any existing get override that is a @staticmethod cannot call super().get(...) — it raises RuntimeError: super(): no arguments. Check each of the seven for an override before assuming a bare re-parent suffices.
- Member-table sizes must not change. Verify
(len(__members__), len(list(cls))) before and after for each, since a re-parent that silently mints a member is the defect this programme exists to prevent.
Note the exception contract has moved since #921: EnumLookup.get now raises EnumKeyError / EnumValueError from pcapkit.utilities.exceptions (#923, merged as 4f3d43df7), so a name miss is KeyError-derived and raised quietly. mh.py's two except KeyError: raise EnumKeyError(...) conversions already reflect that and should be left alone.
Not blocked. No open PR touches these three files — #657 is docs-only and merges last.
#877's phase 2 is half done. #921 re-parented 17 of the 24 non-registry enumerations onto
EnumLookup; seven are still outside it, and #877 is closed, so nothing tracks them.Measured on
4f3d43df7by walking every importablepcapkit.*module (vendor templates excluded) and filtering onissubclass(cls, EnumLookup):Why these seven and not the other 17. They were deliberately deferred, not overlooked. At the time #921 was written,
const/ftp/command.pywas held by #913 andesp.py/mh.pyby #904 — so widening the in-flight worker's scope would have collided. All three blockers have since merged (1f433...,b3551cb63), so the contention is gone.Scope
Re-parent each from
(EnumBase,)to(EnumLookup, EnumBase), the same change #921 made for the other 17. #921's own PR is the pattern to follow, including its test filetests/corekit/test_enum_lookup_reparent_877_unit.py.Two things #921 learned that apply here:
EnumLookup.getis a@classmethod. Any existinggetoverride that is a@staticmethodcannot callsuper().get(...)— it raisesRuntimeError: super(): no arguments. Check each of the seven for an override before assuming a bare re-parent suffices.(len(__members__), len(list(cls)))before and after for each, since a re-parent that silently mints a member is the defect this programme exists to prevent.Note the exception contract has moved since #921:
EnumLookup.getnow raisesEnumKeyError/EnumValueErrorfrompcapkit.utilities.exceptions(#923, merged as4f3d43df7), so a name miss isKeyError-derived and raised quietly.mh.py's twoexcept KeyError: raise EnumKeyError(...)conversions already reflect that and should be left alone.Not blocked. No open PR touches these three files — #657 is docs-only and merges last.