You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Prohibit parameterized generics in isinstance #3037
I can easily see this situation inside checker.py:get_isinstance_type() by verifying that len(type.items()[0].ret_type.args) == 0; but is it the right place to message about type validation problems?
Maybe the right place is in visit_call_expr in checkexpr.py? If the name of function called is builtins.isinstance or builtins.issubclass and there is, for example, any CallableType argument with .is_class_obj() returning True and having type arguments, then you issue a warning.
Activity
ilevkivskyi commentedon Mar 20, 2017
Maybe the right place is in
visit_call_exprincheckexpr.py? If the name of function called isbuiltins.isinstanceorbuiltins.issubclassand there is, for example, anyCallableTypeargument with.is_class_obj()returningTrueand having type arguments, then you issue a warning.