File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -241,6 +241,16 @@ class Series(IndexOpsMixin[S1], NDFrame):
241
241
copy : bool = ...,
242
242
) -> Series [float ]: ...
243
243
@overload
244
+ def __new__ ( # type: ignore[overload-overlap]
245
+ cls ,
246
+ data : Sequence [Never ],
247
+ index : Axes | None = ...,
248
+ * ,
249
+ dtype : Dtype = ...,
250
+ name : Hashable = ...,
251
+ copy : bool = ...,
252
+ ) -> Series [Any ]: ...
253
+ @overload
244
254
def __new__ (
245
255
cls ,
246
256
data : (
Original file line number Diff line number Diff line change 7
7
Iterator ,
8
8
Mapping ,
9
9
MutableMapping ,
10
+ Sequence ,
10
11
)
11
12
import csv
12
13
import datetime
21
22
Any ,
22
23
Callable ,
23
24
Generic ,
25
+ Never ,
24
26
TypedDict ,
25
27
TypeVar ,
26
28
Union ,
@@ -3556,3 +3558,9 @@ class MyDict(TypedDict):
3556
3558
my_dict = MyDict (a = "" , b = "" )
3557
3559
sr = pd .Series (my_dict )
3558
3560
check (assert_type (sr , pd .Series ), pd .Series )
3561
+
3562
+
3563
+ def test_series_empty_dtype () -> None :
3564
+ """Test for the creation of a Series from an empty list GH571."""
3565
+ new_tab : Sequence [Never ] = []
3566
+ check (assert_type (pd .Series (new_tab ), "pd.Series[Any]" ), pd .Series )
You can’t perform that action at this time.
0 commit comments