Skip to content

Align the layer sub-package exports with the top-level package #80

Description

@EONRaider

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

  • Every public class importable from netprotocols is also
    importable from its own layer sub-package.
  • A test asserts the two export sets agree, so this cannot drift
    again.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions