Skip to content

register_mh_extension takes schema positionally; the other 14 register_* are keyword-only #516

Description

@JarryShaw

Public API inconsistency, one character. Verified by introspecting all fifteen register_* functions in pcapkit/foundation/registry/protocols.py:

register_hip_parameter        schema is KEYWORD_ONLY
register_hopopt_option        schema is KEYWORD_ONLY
register_http_frame           schema is KEYWORD_ONLY
register_ipv4_option          schema is KEYWORD_ONLY
register_ipv6_opts_option     schema is KEYWORD_ONLY
register_ipv6_route_routing   schema is KEYWORD_ONLY
register_mh_extension         schema is POSITIONAL_OR_KEYWORD   <--
register_mh_message           schema is KEYWORD_ONLY
register_mh_option            schema is KEYWORD_ONLY
register_pcapng_block         schema is KEYWORD_ONLY
register_pcapng_option        schema is KEYWORD_ONLY
register_pcapng_record        schema is KEYWORD_ONLY
register_pcapng_secrets       schema is KEYWORD_ONLY
register_tcp_mp_option        schema is KEYWORD_ONLY
register_tcp_option           schema is KEYWORD_ONLY

protocols.py:537-538 is missing the * that its fourteen siblings have.

Widening a parameter to keyword-only is technically breaking for anyone passing it positionally, but the asymmetry is clearly unintended and the prerelease window is the cheap moment to fix it.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions