agronholm / typeguard

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

Incorrect type check for lists with different value types #441

Closed timwoocker closed 7 months ago

timwoocker commented 7 months ago

Things to check first

Typeguard version

4.1.5

Python version

3.10

What happened?

Checking the type of a list will only check its first value when using generic typing.

How can we reproduce the bug?

typeguard.check_type([1, 2, "hi"], List[int]) does not throw an exception