@@ -9,13 +9,16 @@ from pandas.core.arrays.boolean import BooleanArray
99from pandas .core .arrays .floating import FloatingArray
1010from pandas .core .arrays .integer import IntegerArray
1111from pandas .core .arrays .numpy_ import NumpyExtensionArray
12- from pandas .core .arrays .string_ import StringArray
12+ from pandas .core .arrays .string_ import (
13+ BaseStringArray ,
14+ StringArray ,
15+ )
1316from pandas .core .indexes .range import RangeIndex
1417
1518from pandas ._libs .missing import NAType
1619from pandas ._libs .tslibs .nattype import NaTType
1720from pandas ._typing import (
18- BuiltinNotStrDtypeArg ,
21+ BuiltinDtypeArg ,
1922 Just ,
2023 NumpyNotTimeDtypeArg ,
2124 PandasBooleanDtypeArg ,
@@ -40,13 +43,13 @@ def array( # empty data, [float("nan")]
4043@overload
4144def array (
4245 data : SequenceNotStr [Any ],
43- dtype : BuiltinNotStrDtypeArg | NumpyNotTimeDtypeArg ,
46+ dtype : BuiltinDtypeArg | NumpyNotTimeDtypeArg ,
4447 copy : bool = True ,
4548) -> NumpyExtensionArray : ...
4649@overload
4750def array ( # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
4851 data : Sequence [NAType | NaTType | None ],
49- dtype : BuiltinNotStrDtypeArg | NumpyNotTimeDtypeArg | None = None ,
52+ dtype : BuiltinDtypeArg | NumpyNotTimeDtypeArg | None = None ,
5053 copy : bool = True ,
5154) -> NumpyExtensionArray : ...
5255@overload
@@ -95,22 +98,22 @@ def array(
9598) -> FloatingArray : ...
9699@overload
97100def array (
98- data : SequenceNotStr [str | np .str_ | float | NAType | None ],
101+ data : (
102+ SequenceNotStr [str | np .str_ | float | NAType | None ]
103+ | np_ndarray
104+ | BaseStringArray
105+ ),
99106 dtype : PandasStrDtypeArg ,
100107 copy : bool = True ,
101108) -> StringArray : ...
102109@overload
103110def array (
104- data : SequenceNotStr [str | np .str_ | NAType | None ],
111+ data : (
112+ SequenceNotStr [str | np .str_ | NAType | None ] | np_ndarray_str | BaseStringArray
113+ ),
105114 dtype : None = None ,
106115 copy : bool = True ,
107- ) -> StringArray : ...
108- @overload
109- def array (
110- data : np_ndarray_str | StringArray ,
111- dtype : PandasStrDtypeArg | None = None ,
112- copy : bool = True ,
113- ) -> StringArray : ...
116+ ) -> BaseStringArray : ...
114117@overload
115118def array (
116119 data : SequenceNotStr [Any ],
@@ -120,6 +123,6 @@ def array(
120123@overload
121124def array (
122125 data : np_ndarray | NumpyExtensionArray | RangeIndex ,
123- dtype : BuiltinNotStrDtypeArg | NumpyNotTimeDtypeArg | None = None ,
126+ dtype : BuiltinDtypeArg | NumpyNotTimeDtypeArg | None = None ,
124127 copy : bool = True ,
125128) -> NumpyExtensionArray : ...
0 commit comments