Skip to content

fix(protocols): resolve a str enum name against its own make() argument rather than raising on a shared name #1308

Closed

Description

@JarryShaw

Describe the bug
After #1227, _make_index infers a str member name's enum from the caller's argument that holds that name. When two enum arguments hold the same name, it applies a strict rule: every candidate enum must have the name, with one agreed value. That rule raises where each argument could simply resolve against its own enum.

To Reproduce
IPv4(tos_thr='LOW', tos_thr_default=1) falls back to the default, as it does on main. Adding tos_del='LOW' makes the same call raise ambiguous member name 'LOW'. The hint in that message suggests tos_thr_namespace=, which cannot help, because ToSThroughput has no LOW.

Expected behavior
Each _make_index call resolves against its own argument. All 111 call sites pass a plain name as the first argument, so the helper can identify that argument, for example from the enclosing call's line range via ast, or by being passed the argument name. The value-conflict branch, which never fires today, then becomes unnecessary.

Found by the #1227 round-2 cross-review.

Activity

  1. JarryShaw commented on Oct 7, 2026

    @JarryShaw
    OwnerAuthor

    Blocked until #1227 merges, because both edit _make_index in protocols/protocol.py.

  2. added
    fixPull requests that fix a defect (fix: subject prefix)
    blockedDeferred pending another issue or decision; see the last comment for what unblocks it
    on Oct 7, 2026
  3. JarryShaw commented on Oct 7, 2026

    @JarryShaw
    OwnerAuthor

    Unblocked: #1227 merged at 19:06Z, so the file conflict is gone. Back to pending until a worker picks it up.

  4. added
    pendingAccepted and unstarted - nobody is on it and nothing blocks it
    wipWork in flight - a covering PR is open or an agent is actively on it
    and removed
    blockedDeferred pending another issue or decision; see the last comment for what unblocks it
    pendingAccepted and unstarted - nobody is on it and nothing blocks it
    on Oct 7, 2026
  5. moved this from Blocked to WIP in PyPCAPKiton Oct 7, 2026
  6. removed
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Oct 7, 2026
  7. added this to the PyPCAPKit v1.5 milestone on Oct 25, 2026
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

    fixPull requests that fix a defect (fix: subject prefix)

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions