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

Type alias definition for MISSING results in type violations #278

Closed
erictraut opened this issue Jun 11, 2023 · 1 comment
Closed

Type alias definition for MISSING results in type violations #278

erictraut opened this issue Jun 11, 2023 · 1 comment

Comments

@erictraut
Copy link

When using pyright to type check the bidict sources, a bunch of type violations are detected. The majority of them are because of the following type alias definition in the _typing.py file:

MISSING: t.Final[MissingT] = MissingT.MISSING

This type alias declares that the type of MISSING is MissingT. The code assumes that its type is Literal[MissingT.MISSING]. You can fix this by changing the above to one of the following:

MISSING: t.Final[t.Literal[MissingT.MISSING]] = MissingT.MISSING

or simply...

MISSING: t.Final = MissingT.MISSING
@jab jab closed this as completed in 9b791c4 Jun 17, 2023
@jab
Copy link
Owner

jab commented Jun 17, 2023

Thanks, @erictraut!

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