@@ -1287,7 +1287,7 @@ def test_timestamp_cmp_series() -> None:
12871287def test_timestamp_cmp_index () -> None :
12881288 ts = pd .Timestamp (year = 2000 , month = 3 , day = 24 , hour = 12 , minute = 27 )
12891289 dt_idx = pd .DatetimeIndex (["2000-1-1" ])
1290- # DatetimeIndex, but the type checker thinks it is UnknownIndex .
1290+ # DatetimeIndex, but the type checker thinks it is Index[Any] .
12911291 un_idx = pd .DataFrame ({"a" : [1 ]}, index = dt_idx ).index
12921292
12931293 # >, <=
@@ -1322,8 +1322,9 @@ def test_timestamp_cmp_index() -> None:
13221322 eq_dt1 = check (assert_type (ts == dt_idx , np_1darray [np .bool ]), np_1darray [np .bool ])
13231323 ne_dt1 = check (assert_type (ts != dt_idx , np_1darray [np .bool ]), np_1darray [np .bool ])
13241324 assert (eq_dt1 != ne_dt1 ).all ()
1325- eq_un1 = check (assert_type (ts == un_idx , np_1darray [np .bool ]), np_1darray [np .bool ])
1326- ne_un1 = check (assert_type (ts != un_idx , np_1darray [np .bool ]), np_1darray [np .bool ])
1325+ # there is a mypy bug where ts.__eq__(Index) gets revealed as Any and not np_1darray
1326+ eq_un1 = check (assert_type (ts == un_idx , np_1darray [np .bool ]), np_1darray [np .bool ]) # type: ignore[assert-type]
1327+ ne_un1 = check (assert_type (ts != un_idx , np_1darray [np .bool ]), np_1darray [np .bool ]) # type: ignore[assert-type]
13271328 assert (eq_un1 != ne_un1 ).all ()
13281329
13291330 # ==, != (ts on the rhs, use == and != of lhs)
0 commit comments