File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -49,17 +49,16 @@ ssum = s1 + s2
49
49
reveal_type(ssum)
50
50
```
51
51
52
- The above code (without the ` reveal_type() ` statements) will get a ` Never `
53
- on the computation of ` ssum ` because it is
52
+ The above code (without the ` reveal_type() ` statements) will get an error on the computation of ` ssum ` because it is
54
53
inappropriate to add two series containing ` Timestamp ` values. The types will be
55
54
revealed by ` mypy ` as follows:
56
55
57
56
``` text
58
57
ttest.py:5: note: Revealed type is "pandas.core.series.Series[pandas._libs.tslibs.timestamps.Timestamp]"
59
58
ttest.py:7: note: Revealed type is "pandas.core.series.Series[pandas._libs.tslibs.timestamps.Timestamp]"
60
59
ttest.py:9: note: Revealed type is "pandas.core.series.TimedeltaSeries"
61
- ttest.py:10: error: Need type annotation for "ssum" [var-annotated ]
62
- ttest.py:11: note: Revealed type is "Never "
60
+ ttest.py:10: error: Unsupported operand types for + ("Series[Timestamp]" and "Series[Timestamp]") [operator ]
61
+ ttest.py:11: note: Revealed type is "pandas.core.series.Series[pandas._libs.tslibs.timestamps.Timestamp] "
63
62
```
64
63
65
64
The type ` Series[Timestamp] ` is the result of creating a series from ` pd.to_datetime() ` , while
You can’t perform that action at this time.
0 commit comments