1- from collections.abc import Callable, Iterable, Sequence
2- from typing import Any, ClassVar, Final, Literal, TypedDict, overload, type_check_only
1+ from collections.abc import Callable, Iterable
2+ from typing import Any, ClassVar, Final, Literal as L , TypedDict, overload, type_check_only
33from typing_extensions import TypeVar, Unpack
44
55import numpy as np
@@ -11,7 +11,7 @@ _T = TypeVar("_T")
1111class _ValidationKwargs(TypedDict, total=False):
1212 excludelist: Iterable[str] | None
1313 deletechars: Iterable[str] | None
14- case_sensitive: Literal ["upper", "lower"] | bool | None
14+ case_sensitive: L ["upper", "lower"] | bool | None
1515 replace_space: str
1616
1717###
@@ -39,8 +39,8 @@ class LineSplitter:
3939 def autostrip(self, /, method: Callable[[_T], Iterable[str]]) -> Callable[[_T], list[str]]: ...
4040
4141class NameValidator:
42- defaultexcludelist: ClassVar[Sequence[str ]]
43- defaultdeletechars: ClassVar[Sequence [str]]
42+ defaultexcludelist: ClassVar[list[L["return", "file", "print"] ]]
43+ defaultdeletechars: ClassVar[set [str]]
4444 excludelist: list[str]
4545 deletechars: set[str]
4646 case_converter: Callable[[str], str]
@@ -51,7 +51,7 @@ class NameValidator:
5151 /,
5252 excludelist: Iterable[str] | None = None,
5353 deletechars: Iterable[str] | None = None,
54- case_sensitive: Literal ["upper", "lower"] | bool | None = None,
54+ case_sensitive: L ["upper", "lower"] | bool | None = None,
5555 replace_space: str = "_",
5656 ) -> None: ...
5757 def __call__(self, /, names: Iterable[str], defaultfmt: str = "f%i", nbfields: int | None = None) -> tuple[str, ...]: ...
@@ -90,16 +90,20 @@ class StringConverter:
9090 def upgrade_mapper(cls, func: Callable[[str], Any], default: object | None = None) -> None: ...
9191
9292@overload
93- def str2bool(value: Literal ["false", "False", "FALSE"]) -> Literal [False]: ...
93+ def str2bool(value: L ["false", "False", "FALSE"]) -> L [False]: ...
9494@overload
95- def str2bool(value: Literal ["true", "True", "TRUE"]) -> Literal [True]: ...
95+ def str2bool(value: L ["true", "True", "TRUE"]) -> L [True]: ...
9696
9797#
9898def has_nested_fields(ndtype: np.dtype[np.void]) -> bool: ...
99+
100+ #
99101def flatten_dtype(
100102 ndtype: np.dtype[np.void],
101103 flatten_base: bool = False,
102104) -> type[np.dtype[np.bool | np.number | np.character | np.object_ | np.datetime64 | np.timedelta64]]: ...
105+
106+ #
103107def easy_dtype(
104108 ndtype: npt.DTypeLike,
105109 names: Iterable[str] | None = None,
0 commit comments