Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix register_struc_hook #19

Closed
wants to merge 1 commit into from
Closed

Conversation

jwsloan
Copy link
Contributor

@jwsloan jwsloan commented Jun 18, 2024

No description provided.

Comment on lines +120 to +122
def register_struc_hook(typ, func, **_):
"""Use this to register cattrs structuring hooks on the internal cattrs Converter"""
_TYPECATS_DEFAULT_CONVERTER.register_structure_hook(*args, **kwargs)
_TYPECATS_DEFAULT_CONVERTER.register_structure_hook_func(lambda t: t == typ, func)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to investigate this further- newer versions of cattrs support typeddicts (23.1.0 and up) - I don't know what implications changing register_struc_hook has but I'd be wary of it

@jwsloan jwsloan closed this Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants