blob: 93f7acbc186eadce5d2c49a58e76f0543619b802 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
from typeguard import typechecked
type Foo = list[int]
@typechecked
def func_using_type_alias(x: Foo) -> int:
return x[0]
@typechecked
def func_using_type_of_type_alias(x: type[Foo]) -> type:
return x
@typechecked
class ParametrizedClass[T]:
def method(self, x: T, y: str) -> T:
return x
@typechecked
def parametrized_func[T](x: T, y: str) -> T:
return x
|