Skip to content

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

Open
@declaresub

Description

@declaresub

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] = {}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions