|
|
|
@ -51,26 +51,21 @@ mixed_list: List[Union[str, int]] = [1, "two", 3]
|
|
|
|
|
"This is mixed"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def f2(not_yet_a: "A") -> int:
|
|
|
|
|
...
|
|
|
|
|
def f2(not_yet_a: "A") -> int: ...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def f3(imported: B) -> B:
|
|
|
|
|
...
|
|
|
|
|
def f3(imported: B) -> B: ...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class MyGeneric(Generic[T, U]):
|
|
|
|
|
...
|
|
|
|
|
class MyGeneric(Generic[T, U]): ...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@overload
|
|
|
|
|
def overloaded_func(a: float) -> float:
|
|
|
|
|
...
|
|
|
|
|
def overloaded_func(a: float) -> float: ...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@typing.overload
|
|
|
|
|
def overloaded_func(a: str) -> str:
|
|
|
|
|
...
|
|
|
|
|
def overloaded_func(a: str) -> str: ...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def overloaded_func(a: Union[float, str]) -> Union[float, str]:
|
|
|
|
@ -79,8 +74,7 @@ def overloaded_func(a: Union[float, str]) -> Union[float, str]:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@overload
|
|
|
|
|
def undoc_overloaded_func(a: str) -> str:
|
|
|
|
|
...
|
|
|
|
|
def undoc_overloaded_func(a: str) -> str: ...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def undoc_overloaded_func(a: str) -> str:
|
|
|
|
@ -112,33 +106,28 @@ class A:
|
|
|
|
|
return "method"
|
|
|
|
|
|
|
|
|
|
@overload
|
|
|
|
|
def overloaded_method(self, a: float) -> float:
|
|
|
|
|
...
|
|
|
|
|
def overloaded_method(self, a: float) -> float: ...
|
|
|
|
|
|
|
|
|
|
@typing.overload
|
|
|
|
|
def overloaded_method(self, a: str) -> str:
|
|
|
|
|
...
|
|
|
|
|
def overloaded_method(self, a: str) -> str: ...
|
|
|
|
|
|
|
|
|
|
def overloaded_method(self, a: Union[float, str]) -> Union[float, str]:
|
|
|
|
|
"""Overloaded method"""
|
|
|
|
|
return a * 2
|
|
|
|
|
|
|
|
|
|
@overload
|
|
|
|
|
def undoc_overloaded_method(self, a: float) -> float:
|
|
|
|
|
...
|
|
|
|
|
def undoc_overloaded_method(self, a: float) -> float: ...
|
|
|
|
|
|
|
|
|
|
def undoc_overloaded_method(self, a: float) -> float:
|
|
|
|
|
return a * 2
|
|
|
|
|
|
|
|
|
|
@typing.overload
|
|
|
|
|
@classmethod
|
|
|
|
|
def overloaded_class_method(cls, a: float) -> float:
|
|
|
|
|
...
|
|
|
|
|
def overloaded_class_method(cls, a: float) -> float: ...
|
|
|
|
|
|
|
|
|
|
@overload
|
|
|
|
|
@classmethod
|
|
|
|
|
def overloaded_class_method(cls, a: str) -> str:
|
|
|
|
|
...
|
|
|
|
|
def overloaded_class_method(cls, a: str) -> str: ...
|
|
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def overloaded_class_method(cls, a: Union[float, str]) -> Union[float, str]:
|
|
|
|
@ -148,23 +137,18 @@ class A:
|
|
|
|
|
|
|
|
|
|
class C:
|
|
|
|
|
@overload
|
|
|
|
|
def __init__(self, a: int) -> None:
|
|
|
|
|
...
|
|
|
|
|
def __init__(self, a: int) -> None: ...
|
|
|
|
|
|
|
|
|
|
@typing.overload
|
|
|
|
|
def __init__(self, a: float) -> None:
|
|
|
|
|
...
|
|
|
|
|
def __init__(self, a: float) -> None: ...
|
|
|
|
|
|
|
|
|
|
def __init__(self, a: str):
|
|
|
|
|
...
|
|
|
|
|
def __init__(self, a: str): ...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class D(C):
|
|
|
|
|
class Da:
|
|
|
|
|
...
|
|
|
|
|
class Da: ...
|
|
|
|
|
|
|
|
|
|
class DB(Da):
|
|
|
|
|
...
|
|
|
|
|
class DB(Da): ...
|
|
|
|
|
|
|
|
|
|
...
|
|
|
|
|
|
|
|
|
@ -184,5 +168,4 @@ async def async_function(wait: bool) -> int:
|
|
|
|
|
global_a: A = A()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class SomeMetaclass(type):
|
|
|
|
|
...
|
|
|
|
|
class SomeMetaclass(type): ...
|
|
|
|
|