mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY-24161 Properly treat variables annotated with Type[...] as callable
This commit is contained in:
+10
@@ -0,0 +1,10 @@
|
||||
from typing import Type
|
||||
|
||||
|
||||
class MyClass(object):
|
||||
pass
|
||||
|
||||
|
||||
def func(param):
|
||||
# type: (Type[MyClass]) -> MyClass
|
||||
param()
|
||||
+13
@@ -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()
|
||||
Reference in New Issue
Block a user