File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change 1111from typing import (
1212 TYPE_CHECKING ,
1313 Literal ,
14+ TypeVar ,
1415 cast ,
1516 overload ,
1617)
105106 ExtensionArray ,
106107 )
107108
109+ T = TypeVar ("T" , bound = Index | Categorical | ExtensionArray )
110+
108111
109112# --------------- #
110113# dtype access #
@@ -316,15 +319,9 @@ def _check_object_for_strings(values: np.ndarray) -> str:
316319
317320
318321@overload
319- def unique (values : np .ndarray ) -> np .ndarray : ...
320- @overload
321- def unique (values : Index ) -> Index : ...
322- @overload
323- def unique (values : Series ) -> np .ndarray : ...
324- @overload
325- def unique (values : Categorical ) -> Categorical : ...
322+ def unique (values : T ) -> T : ...
326323@overload
327- def unique (values : ExtensionArray ) -> ExtensionArray : ...
324+ def unique (values : np . ndarray | Series ) -> np . ndarray : ...
328325
329326
330327def unique (values ):
You can’t perform that action at this time.
0 commit comments