Skip to content

__struct_defaults__ is missing from Python type specification #779

Closed

Description

@ncoghlan

Description

I am attempting to work around #778 by writing a recursive Struct traversal in Python as an alternative to asdict (this is going to be slow, but slow-and-working is better than not working).

From looking at the C code, __struct_defaults__ is available alongside __struct_fields__ (aligning from the end of the two sequences).

However, the Python typing stub for the C code is missing this attribute, so mypy et al complain about accessing the field.

Activity

  1. added a commit that references this issue on Sep 11, 2026
    924f477
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions