Skip to content

Conversation

@rickwierenga
Copy link
Member

Summary

  • When deserializing a class, check if it defines a deserialize method in its own __dict__ (not inherited) and call it
  • This enables classes like TipSpot to handle custom serialization fields (e.g., prototype_tip) that aren't __init__ parameters

Test plan

  • Added test test_deserialize_calls_custom_deserialize_method
  • All 821 tests pass

🤖 Generated with Claude Code

When deserializing a class, check if it defines a `deserialize` method
in its own __dict__ (not inherited) and call it with the deserialized
params. This enables classes like TipSpot to handle custom serialization
fields (e.g., prototype_tip) that aren't __init__ parameters.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@rickwierenga rickwierenga merged commit eff22e2 into main Jan 30, 2026
10 checks passed
@rickwierenga rickwierenga deleted the serializer-custom-deserialize branch January 30, 2026 03:40
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.

2 participants