Skip to content

upgrade is_record_type to use TypeGuard #123

@DXsmiley

Description

@DXsmiley

Would it be possible to utilise TypeGuard on this function in order to leverage the return value at the callsite for static type checking?

def is_record_type(model: ModelBase, expected_type: t.Union[str, types.ModuleType]) -> bool:

I'd do it myself but I don't feel I understand enough about the details of the library at this point to get it right

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions