Skip to content

Commit 5be9522

Browse files
authored
Merge pull request #148 from static-frame/146/pyi
`pyi` improvements
2 parents ce5e117 + faf7d98 commit 5be9522

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

src/__init__.pyi

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,31 @@
11
import typing as tp
2+
import datetime
23

34
import numpy as np # type: ignore
45

56
_T = tp.TypeVar('_T')
67

78
__version__: str
89

10+
_TLabel = tp.Union[
11+
tp.Hashable,
12+
int,
13+
bool,
14+
np.bool_,
15+
np.integer,
16+
float,
17+
complex,
18+
np.inexact,
19+
str,
20+
bytes,
21+
None,
22+
np.datetime64,
23+
np.timedelta64,
24+
datetime.date,
25+
datetime.datetime,
26+
tp.Tuple['_TLabel'],
27+
]
28+
929
class ErrorInitTypeBlocks(RuntimeError):
1030
def __init__(self, *args: tp.Any, **kwargs: tp.Any) -> None: ...
1131
def with_traceback(self, tb: Exception) -> Exception: ...
@@ -103,16 +123,16 @@ def count_iteration(__iterable: tp.Iterable) -> int: ...
103123

104124
def immutable_filter(__array: np.ndarray) -> np.ndarray: ...
105125
def mloc(__array: np.ndarray) -> int: ...
106-
def name_filter(__name: tp.Hashable) -> tp.Hashable: ...
126+
def name_filter(__name: _TLabel) -> _TLabel: ...
107127
def shape_filter(__array: np.ndarray) -> np.ndarray: ...
108128
def column_2d_filter(__array: np.ndarray) -> np.ndarray: ...
109129
def column_1d_filter(__array: np.ndarray) -> np.ndarray: ...
110130
def row_1d_filter(__array: np.ndarray) -> np.ndarray: ...
111-
def array_deepcopy(__array: np.ndarray, memo: tp.Dict[int, tp.Any]) -> np.ndarray: ...
131+
def array_deepcopy(__array: np.ndarray, memo: tp.Optional[tp.Dict[int, tp.Any]]) -> np.ndarray: ...
112132
def resolve_dtype(__d1: np.dtype, __d2: np.dtype) -> np.dtype: ...
113133
def resolve_dtype_iter(__dtypes: tp.Iterable[np.dtype]) -> np.dtype: ...
114134
def isna_element(__value: tp.Any, include_none: bool = True) -> bool: ...
115-
def dtype_from_element(__value: tp.Optional[tp.Hashable]) -> np.dtype: ...
135+
def dtype_from_element(__value: tp.Optional[_TLabel]) -> np.dtype: ...
116136
def get_new_indexers_and_screen(indexers: np.ndarray, positions: np.ndarray) -> tp.Tuple[np.ndarray, np.ndarray]: ...
117137

118138
def first_true_1d(__array: np.ndarray, *, forward: bool) -> int: ...

0 commit comments

Comments
 (0)