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

Fixed generic aliases not passing checks against type #433

Merged
merged 7 commits into from
Mar 23, 2024

Conversation

fefe982
Copy link
Contributor

@fefe982 fefe982 commented Jan 24, 2024

fixes #432

is_class(dict[str,str], type) returns False after python 3.11. Use isinstance(dict[str, str], types.GenericAlias) to check in this situation.

@coveralls
Copy link

coveralls commented Jan 24, 2024

Coverage Status

coverage: 97.894% (+0.003%) from 97.891%
when pulling dbcc303 on fefe982:fix_type
into d481a51 on agronholm:master.

tests/test_checkers.py Outdated Show resolved Hide resolved
@agronholm agronholm changed the title fix: generic aliases should be type Fixed generic aliases not passing checks against type Mar 23, 2024
@agronholm agronholm merged commit 2df6f4a into agronholm:master Mar 23, 2024
10 checks passed
@agronholm
Copy link
Owner

Thanks!

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

Successfully merging this pull request may close these issues.

False positive when checking <class 'types.GenericAlias'>(e.g.dict[str, str]) against type
3 participants