Now that runtime generics are allowed (thanks to #2302), we should prevent people from making calls like: ``` py isinstance(["foo"], List[int]) ``` because it won't behave as expected. I.e. in this case, it will return True. (First instance of user confusion appeared in #2369.)
Activity
ilevkivskyi commentedon Nov 8, 2016
Latest version of
typing.pyraisesTypeErrorfor things like this. Only unsubscripted generics etc. are allowed with instance/class checks.ddfisher commentedon Nov 8, 2016
But mypy still doesn't give an error!
gvanrossum commentedon Nov 8, 2016
Oops, sorry. Classified as bug for milestone 0.5. (Since it's a runtime error I don't think it's a very big deal if mypy doesn't catch it.)
ilevkivskyi commentedon Aug 23, 2017
This is fixed now, mypy says