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

pyright says that type of cattrs.preconf.json.make_converter is partially unknown #593

Open
declaresub opened this issue Oct 22, 2024 · 3 comments

Comments

@declaresub
Copy link
Contributor

Pyright flags the code below with "Type of "make_converter" is partially unknown".

converter = cattrs.preconf.json.make_converter()

The problem is the type of the parameter unstruct_collection_overrides: Mapping[type, (...) -> Unknown].

Poking around in the cattrs code, this error can be resolved by changing the type of unstruct_collection_overrides in Converter.Init from

unstruct_collection_overrides: Mapping[type, Callable] = {}

to
unstruct_collection_overrides: Mapping[type, UnstructureHookT] = {}

@Tinche
Copy link
Member

Tinche commented Oct 22, 2024

Interesting. Care to submit a pr?

@declaresub
Copy link
Contributor Author

I can do that.

@declaresub
Copy link
Contributor Author

Pull request #594 submitted.

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

No branches or pull requests

2 participants