Skip to content

Ensure pyright types are still intact after using the mixin #6

@ddanier

Description

@ddanier

See pydantic/pydantic#857 (comment) and pydantic/pydantic#857 (comment)

@ddanier thank you for that! It works really well. The only issue is it removes the pyright types:

Without AsyncValidationModelMixin:

image

With AsyncValidationModelMixin:

image

AND

@ddanier I found a fix for the typing issue; in metaclasses.py line 17; you can change it to (make sure to add the missing imports):

@dataclass_transform(kw_only_default=True, field_specifiers=(Field,))
class AsyncValidationModelMetaclass(ModelMetaclass):

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