Skip to content

Commit f00f9fd

Browse files
committed
annotations
1 parent 7435e33 commit f00f9fd

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

pandas/core/indexes/base.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ def join(
215215
return cast(F, join)
216216

217217

218-
def disallow_kwargs(kwargs: dict[str, Any]):
218+
def disallow_kwargs(kwargs: dict[str, Any]) -> None:
219219
if kwargs:
220220
raise TypeError(f"Unexpected keyword arguments {repr(set(kwargs))}")
221221

@@ -626,7 +626,7 @@ def _maybe_check_unique(self) -> None:
626626
raise DuplicateLabelError(msg)
627627

628628
@final
629-
def _format_duplicate_message(self):
629+
def _format_duplicate_message(self) -> DataFrame:
630630
"""
631631
Construct the DataFrame for a DuplicateLabelError.
632632
@@ -789,7 +789,7 @@ def __array_wrap__(self, result, context=None):
789789
return Index(result, **attrs)
790790

791791
@cache_readonly
792-
def dtype(self):
792+
def dtype(self) -> DtypeObj:
793793
"""
794794
Return the dtype object of the underlying data.
795795
"""
@@ -1064,11 +1064,11 @@ def copy(
10641064
return new_index
10651065

10661066
@final
1067-
def __copy__(self, **kwargs):
1067+
def __copy__(self: _IndexT, **kwargs) -> _IndexT:
10681068
return self.copy(**kwargs)
10691069

10701070
@final
1071-
def __deepcopy__(self, memo=None):
1071+
def __deepcopy__(self: _IndexT, memo=None) -> _IndexT:
10721072
"""
10731073
Parameters
10741074
----------
@@ -1354,7 +1354,7 @@ def to_series(self, index=None, name: Hashable = None) -> Series:
13541354

13551355
return Series(self._values.copy(), index=index, name=name)
13561356

1357-
def to_frame(self, index: bool = True, name=None) -> DataFrame:
1357+
def to_frame(self, index: bool = True, name: Hashable = None) -> DataFrame:
13581358
"""
13591359
Create a DataFrame with a column containing the Index.
13601360
@@ -1426,7 +1426,7 @@ def name(self):
14261426
return self._name
14271427

14281428
@name.setter
1429-
def name(self, value):
1429+
def name(self, value: Hashable):
14301430
if self._no_setting_name:
14311431
# Used in MultiIndex.levels to avoid silently ignoring name updates.
14321432
raise RuntimeError(
@@ -2367,7 +2367,7 @@ def _is_all_dates(self) -> bool:
23672367

23682368
@cache_readonly
23692369
@final
2370-
def is_all_dates(self):
2370+
def is_all_dates(self) -> bool:
23712371
"""
23722372
Whether or not the index values only consist of dates.
23732373
"""

0 commit comments

Comments
 (0)