Skip to content

Decode recursive abstract Sequence dataclasses on advertised Python 3.10 #13

Closed

Description

@trissim

On the advertised Python>=3.10 runtime, dataclass_from_mapping does not recursively decode collections.abc.Sequence["RecursiveSequenceNode"] members. A nested child remains a dict, and undeclared child fields are therefore not rejected.

Existing tests demonstrate the bug: test_dataclass_mapping_recurses_from_abstract_sequence_annotations[list/tuple] and test_dataclass_mapping_recursive_sequence_rejects_unknown_fields_and_wrong_elements. PI12 CI has140passes/3failures on all Python3.10 platforms; Python3.11/3.12 passes. Failure log.

The decoder production file is unchanged between main430fbbe and qualified PI12/merged43cdbf3: SHA256d2be277051b070d73503025a3addcde8016787e18a369c45b60be0c0edb65fea. This defect predates the parameter-declaration migration in #12/#11 and is tracked independently; no decoder changes were included in that qualified release.

CPython3.10 typing.get_type_hints recursively evaluates ForwardRef instances but leaves string arguments inside PEP585 GenericAlias unresolved; its3.11 behavior differs. Resolve the existing declaration's recursive types through the shared annotation owner, preserving error and validation laws, and qualify the three existing controls on actual Python3.10. Do not weaken the tests or silently drop the advertised runtime.

Follow-up source patch/closing PR is pending; no new worktree or environment was created and no compatibility patch is being mixed into the released migration.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions