Closed WEGFan closed 5 months ago
Ugh, why does typing_extensions
have their own Any
type now?
In the mean time, you can do this to enable support:
from typing_extensions import Any
from cattrs import Converter
c = Converter()
c.register_structure_hook_func(lambda t: t is Any, lambda v, _: v)
Seems that it isn't an issue on Python >= 3.11
I guess because it's possible to subclass Any
now. I can add support for it in the next version.
Description
Structure failed and raises
cattrs.errors.StructureHandlerNotFoundError: Unsupported type: typing_extensions.Any. Register a structure hook for it.
. It succeeds if I usetyping.Any
.typing_extension version is 4.9.0
What I Did