Skip to content

Fixed generic aliases not passing checks against type#433

Merged
agronholm merged 7 commits intoagronholm:masterfrom
fefe982:fix_type
Mar 23, 2024
Merged

Fixed generic aliases not passing checks against type#433
agronholm merged 7 commits intoagronholm:masterfrom
fefe982:fix_type

Conversation

@fefe982
Copy link
Copy Markdown
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
Copy Markdown

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.

Comment thread tests/test_checkers.py Outdated
@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
@agronholm
Copy link
Copy Markdown
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