Skip to content

Fix recursive attrs hooks and private fields in msgspec - #798

Open
Gabrieljr42 wants to merge 1 commit into
python-attrs:mainfrom
Gabrieljr42:fix/msgspec-recursive-attrs-hooks
Open

Gabrieljr42 wants to merge 1 commit into
python-attrs:mainfrom
Gabrieljr42:fix/msgspec-recursive-attrs-hooks

Conversation

@Gabrieljr42

Copy link
Copy Markdown

Fixes #795.

Nested recursive attrs classes now keep their custom hooks and private fields when using the msgspec converter. Hook generation waits until the recursion probe finishes, so it doesn't capture the temporary fallback.

I ran the full suite on Python 3.12: 1,061 passed, 2 skipped and 15 xfailed. The msgspec tests also pass on Python 3.10 and 3.14, and Ruff checks pass.

I used AI assistance for the implementation and tests.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

msgspec converter skips hooks and drops private fields in nested recursion

1 participant