2020-07-10 08:50:05 -05:00
|
|
|
from inspect import Signature
|
2023-03-05 06:54:01 -06:00
|
|
|
from numbers import Integral
|
2024-04-25 10:07:10 -05:00
|
|
|
from typing import Any, Callable, Dict, List, Literal, Optional, Tuple, TypeVar, Union
|
2015-07-29 15:10:02 -05:00
|
|
|
|
|
|
|
|
|
|
|
def f0(x: int, y: Integral) -> None:
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2023-07-24 20:07:23 -05:00
|
|
|
def f1(x: list[int]) -> List[int]:
|
2015-07-29 15:10:02 -05:00
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
T = TypeVar('T')
|
|
|
|
T_co = TypeVar('T_co', covariant=True)
|
|
|
|
T_contra = TypeVar('T_contra', contravariant=True)
|
|
|
|
|
|
|
|
|
|
|
|
def f2(x: List[T], y: List[T_co], z: T) -> List[T_contra]:
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
def f3(x: Union[str, Integral]) -> None:
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
MyStr = str
|
|
|
|
|
|
|
|
|
|
|
|
def f4(x: 'MyStr', y: MyStr) -> None:
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
def f5(x: int, *, y: str, z: str) -> None:
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2016-04-09 09:35:32 -05:00
|
|
|
def f6(x: int, *args, y: str, z: str) -> None:
|
2015-07-29 15:10:02 -05:00
|
|
|
pass
|
|
|
|
|
|
|
|
|
2024-01-03 22:06:41 -06:00
|
|
|
def f7(x: int = None, y: dict = {}) -> None: # NoQA: B006,RUF013
|
2016-04-09 09:35:32 -05:00
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
def f8(x: Callable[[int, str], int]) -> None:
|
2015-07-29 15:10:02 -05:00
|
|
|
# See https://github.com/ambv/typehinting/issues/149 for Callable[..., int]
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2016-04-09 09:24:34 -05:00
|
|
|
def f9(x: Callable) -> None:
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
def f10(x: Tuple[int, str], y: Tuple[int, ...]) -> None:
|
2015-07-29 15:10:02 -05:00
|
|
|
pass
|
2016-07-29 05:27:00 -05:00
|
|
|
|
|
|
|
|
|
|
|
class CustomAnnotation:
|
|
|
|
def __repr__(self):
|
|
|
|
return 'CustomAnnotation'
|
|
|
|
|
2016-04-09 09:24:34 -05:00
|
|
|
|
|
|
|
def f11(x: CustomAnnotation(), y: 123) -> None:
|
2016-07-29 05:27:00 -05:00
|
|
|
pass
|
2018-07-13 13:08:58 -05:00
|
|
|
|
|
|
|
|
|
|
|
def f12() -> Tuple[int, str, int]:
|
|
|
|
pass
|
2018-08-09 16:47:35 -05:00
|
|
|
|
|
|
|
|
2018-08-14 10:32:14 -05:00
|
|
|
def f13() -> Optional[str]:
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2018-08-21 06:05:17 -05:00
|
|
|
def f14() -> Any:
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2024-01-21 14:20:58 -06:00
|
|
|
def f15(x: "Unknown", y: "int") -> Any: # NoQA: F821 # type: ignore[attr-defined]
|
2018-09-22 02:36:10 -05:00
|
|
|
pass
|
|
|
|
|
2018-10-15 08:03:56 -05:00
|
|
|
|
2018-10-31 11:24:12 -05:00
|
|
|
def f16(arg1, arg2, *, arg3=None, arg4=None):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
def f17(*, arg3, arg4):
|
2018-09-22 02:36:10 -05:00
|
|
|
pass
|
|
|
|
|
|
|
|
|
2019-05-28 08:43:34 -05:00
|
|
|
def f18(self, arg1: Union[int, Tuple] = 10) -> List[Dict]:
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2019-07-13 05:25:38 -05:00
|
|
|
def f19(*args: int, **kwargs: str):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2020-05-11 11:20:45 -05:00
|
|
|
def f20() -> Optional[Union[int, str]]:
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2020-07-10 08:50:05 -05:00
|
|
|
def f21(arg1='whatever', arg2=Signature.empty):
|
|
|
|
pass
|
|
|
|
|
2019-07-13 05:25:38 -05:00
|
|
|
|
2022-04-18 11:33:56 -05:00
|
|
|
def f22(*, a, b):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
def f23(a, b, /, c, d):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
def f24(a, /, *, b):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
def f25(a, b, /):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2024-04-25 10:07:10 -05:00
|
|
|
def f26(x: Literal[1, 2, 3] = 1, y: Union[Literal["a"], Literal["b"]] = "a") -> None:
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2018-08-09 16:47:35 -05:00
|
|
|
class Node:
|
2018-08-14 11:42:07 -05:00
|
|
|
def __init__(self, parent: Optional['Node']) -> None:
|
|
|
|
pass
|
|
|
|
|
2018-08-09 16:47:35 -05:00
|
|
|
def children(self) -> List['Node']:
|
|
|
|
pass
|