agronholm / typeguard

Run-time type checker for Python
Other
1.52k stars 114 forks source link

Fixed generic aliases not passing checks against `type` #433

Closed fefe982 closed 7 months ago

fefe982 commented 8 months ago

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 commented 8 months ago

Coverage Status

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

agronholm commented 7 months ago

Thanks!