Target: 1.3.1 (Tier 0 — hygiene)
The per-layer __init__.py files export a subset of what the layer
actually ships, while the top-level netprotocols/__init__.py exports
everything. Importing by layer therefore fails for classes that plainly
belong to it:
layer7/__init__.py exports only DNS — missing DHCP,
DNSOverTCP and DNSResourceRecord.layer3/__init__.py omits GRE, and the option value types
IPv4Option, IPv6Option, NDPOption and IGMPv3GroupRecord.
from netprotocols.layer7 import DHCP fails today; from netprotocols import DHCP works. That asymmetry is surprising and undocumented.
What to do
Bring each layer's __init__.py in line with what the layer's modules
define and the top-level package re-exports, keeping __all__ sorted
and consistent with the existing style.
Acceptance criteria
Target: 1.3.1 (Tier 0 — hygiene)
The per-layer
__init__.pyfiles export a subset of what the layeractually ships, while the top-level
netprotocols/__init__.pyexportseverything. Importing by layer therefore fails for classes that plainly
belong to it:
layer7/__init__.pyexports onlyDNS— missingDHCP,DNSOverTCPandDNSResourceRecord.layer3/__init__.pyomitsGRE, and the option value typesIPv4Option,IPv6Option,NDPOptionandIGMPv3GroupRecord.from netprotocols.layer7 import DHCPfails today;from netprotocols import DHCPworks. That asymmetry is surprising and undocumented.What to do
Bring each layer's
__init__.pyin line with what the layer's modulesdefine and the top-level package re-exports, keeping
__all__sortedand consistent with the existing style.
Acceptance criteria
netprotocolsis alsoimportable from its own layer sub-package.
again.