-
-
Notifications
You must be signed in to change notification settings - Fork 114
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
Collections.abc types do not work like typing types #128
Comments
Also note that introducing a unstructure hook via converter.register_unstructure_hook(
abc.MutableSequence,
partial(converter.unstructure, unstructure_as=typing.MutableSequence),
) does not lead to the desired result. However, somewhat similarly to the other issue I had raise, this might be a viable short term fix: def _is_sequence(cls):
return issubclass(get_origin(cls), abc.Sequence)
converter.register_unstructure_hook_func(_is_sequence, converter._unstructure_seq)
converter.register_structure_hook_func(_is_sequence, converter._structure_list) |
If the typing alternatives are deprecated with is worth fixing quickly. Will look into it over the next couple of days. |
Should be fixed in Tinche@da63135 |
Works like a charm. Thank you! Let me apologize in advance, I am currently formulating a new issue 😅 |
Description
Python 3.9 deprecated
typing.<containers>
in favor of usingcollections.abc.<containers>
. Usingcollections.abc.
containers does not work as expected, though.What I Did
The actual output is:
What I expected:
The text was updated successfully, but these errors were encountered: