Skip to content

Commit ed69ec5

Browse files
committed
1 parent 8a99cf4 commit ed69ec5

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

docs/philosophy.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ the following example that creates two series of datetimes with corresponding ar
3737

3838
```python
3939
import pandas as pd
40+
from typing import reveal_type
4041

4142
s1 = pd.Series(pd.to_datetime(["2022-05-01", "2022-06-01"]))
4243
reveal_type(s1)
@@ -51,14 +52,14 @@ reveal_type(ssum)
5152
The above code (without the `reveal_type()` statements) will get a `Never`
5253
on the computation of `ssum` because it is
5354
inappropriate to add two series containing `Timestamp` values. The types will be
54-
revealed as follows:
55+
revealed by `mypy` as follows:
5556

5657
```text
57-
ttest.py:4: note: Revealed type is "pandas.core.series.Series[pandas._libs.tslibs.timestamps.Timestamp]"
58-
ttest.py:6: note: Revealed type is "pandas.core.series.Series[pandas._libs.tslibs.timestamps.Timestamp]"
59-
ttest.py:8: note: Revealed type is "pandas.core.series.TimedeltaSeries"
60-
ttest.py:9: error: Need type annotation for "ssum" [var-annotated]
61-
ttest.py:10: note: Revealed type is "Never"
58+
ttest.py:5: note: Revealed type is "pandas.core.series.Series[pandas._libs.tslibs.timestamps.Timestamp]"
59+
ttest.py:7: note: Revealed type is "pandas.core.series.Series[pandas._libs.tslibs.timestamps.Timestamp]"
60+
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"
6263
```
6364

6465
The type `Series[Timestamp]` is the result of creating a series from `pd.to_datetime()`, while

0 commit comments

Comments
 (0)