PY-24161 Properly treat variables annotated with Type[...] as callable

This commit is contained in:
Mikhail Golubev
2018-08-15 12:44:23 +03:00
parent 58a25d2c34
commit 7c2b079481
4 changed files with 36 additions and 0 deletions
@@ -0,0 +1,10 @@
from typing import Type
class MyClass(object):
pass
def func(param):
# type: (Type[MyClass]) -> MyClass
param()
@@ -0,0 +1,13 @@
from typing import TypeVar, Type
class User:
pass
U = TypeVar('U', bound=User)
def new_user(user_class):
# type: (Type[U]) -> U
return user_class()