-
Notifications
You must be signed in to change notification settings - Fork 19
/
test.py
34 lines (24 loc) · 888 Bytes
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
from __future__ import annotations
from typing import SupportsFloat, Sequence, Protocol, SupportsIndex, Iterator, Any, TypeVar, List, overload, Union
import numpy as np
from numpy.typing import ArrayLike
# T_co = TypeVar("T_co", covariant=True)
# class Seq(Protocol[T_co]):
# def __len__(self) -> int: ...
# @overload
# def __getitem__(self, index: SupportsIndex, /) -> T_co: ...
# @overload
# def __getitem__(self, index: slice, /) -> Seq[T_co]: ...
# def __iter__(self) -> Iterator[T_co]: ...
# def __contains__(self, x: Any) -> bool: ...
# def __reversed__(self, /) -> Iterator[T_co]: ...
# def count(self, value: Any, /) -> int: ...
# def index(self, value: Any, /) -> int: ...
# b: Seq[SupportsFloat]
# a: ArrayLike = b
f: float
n: np.floating
u: Union[float, np.floating]
reveal_type(abs(f))
reveal_type(abs(n))
reveal_type(abs(u))