-
-
Notifications
You must be signed in to change notification settings - Fork 126
Closed
Labels
Description
- cattrs version - 24.0.1
- Python version - 3.12.4
- Operating System - OSX 14.6.1
Description
When attempting to use register_structure_hook_factory for my custom structure hook, I get a type error that the decorator expects 1 more positional argument:
@my_converter.register_structure_hook_factory(lambda r: r is MyClass)
def register_review_category_struct(cls: Type[MyClass], conv: cattrs.Converter) -> StructureHook:
return cattrs.gen.make_dict_structure_fn(
cls,
conv,
)
Using pyright 1.1.379.
The structure factory works in that it creates the correct methods and that my_converter.structure(a_dict, MyClass) - does what it's supposed to but I'm wondering if I'm missing something or if the type error is spurious.