Skip to content

docs: Info and Schema subclasses render the base __new__'s (*args, **kwargs) signature, not their fields #1860

Closed

Description

@JarryShaw

Info-based data models render as Stream(*args: VT, **kwargs: VT) (interface/misc.html), Index(*args: VT, **kwargs: VT) (foundation/traceflow/tcp.html), and likewise across the data models. Every Schema class renders (*args: _VT, **kwargs: _VT), e.g. schema.transport.tcp.TCP. Yet inspect.signature(Stream) is already (filename, packets, conversations).

Root cause: Sphinx 9.1 (ext/autodoc/_dynamic/_signatures.py) tries __signature__, the metaclass __call__, then a user-defined __new__, before __init__. Info.__new__ (corekit/infoclass.py:391) and Schema.__new__ (protocols/schema/schema.py:443) are user-defined, so the generated per-class __init__ is never read.

Fix: an autodoc-process-signature handler in conf.py that builds the signature for these classes from inspect.signature(cls), with types from typing.get_type_hints(cls). On a Schema class inspect.signature gives every field a NO_VALUE default, which the handler must render sensibly; #1841 is related. Verify after #1856.

Activity

  1. added
    docsPull requests that change documentation only (docs: subject prefix)
    pendingAccepted and unstarted - nobody is on it and nothing blocks it
    on Oct 16, 2026
  2. JarryShaw commented on Oct 16, 2026

    @JarryShaw
    OwnerAuthor

    Blocked until #1856 merges. That PR bumps sphinx-autodoc-typehints, which changes how signatures render, and it edits docs/source/conf.py, which this fix also edits.

  3. added
    blockedDeferred pending another issue or decision; see the last comment for what unblocks it
    and removed
    pendingAccepted and unstarted - nobody is on it and nothing blocks it
    on Oct 16, 2026
  4. moved this to Blocked in PyPCAPKiton Oct 16, 2026
  5. JarryShaw commented on Oct 17, 2026

    @JarryShaw
    OwnerAuthor

    Started on top of #1877, the PR for #1856, so the conf.py edits don't conflict. One worker is taking #1858–#1863 together, since every fix goes through conf.py. Scope widened: under sphinx-autodoc-typehints 3.15.0, the same __new__ collapse also turns the protocol, reassembly and traceflow class signatures into (*args, **kwargs), so this fix covers those classes too (see #1877).

  6. added
    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
    on Oct 17, 2026
  7. moved this from Blocked to WIP in PyPCAPKiton Oct 17, 2026
  8. removed
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Oct 17, 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

    docsPull requests that change documentation only (docs: subject prefix)

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions