diff --git a/pandas/core/dtypes/dtypes.py b/pandas/core/dtypes/dtypes.py index 5b51bc9debb33..f137028976e53 100644 --- a/pandas/core/dtypes/dtypes.py +++ b/pandas/core/dtypes/dtypes.py @@ -62,8 +62,6 @@ is_list_like, ) -from pandas.util import capitalize_first_letter - if not pa_version_under10p1: import pyarrow as pa @@ -1087,7 +1085,7 @@ def na_value(self) -> NaTType: def __eq__(self, other: object) -> bool: if isinstance(other, str): - return other in [self.name, capitalize_first_letter(self.name)] + return other in {self.name, self.name.capitalize()} return super().__eq__(other) diff --git a/pandas/util/__init__.py b/pandas/util/__init__.py index 91282fde8b11d..8fe928ed6c5cf 100644 --- a/pandas/util/__init__.py +++ b/pandas/util/__init__.py @@ -23,7 +23,3 @@ def __getattr__(key: str): return cache_readonly raise AttributeError(f"module 'pandas.util' has no attribute '{key}'") - - -def capitalize_first_letter(s: str) -> str: - return s[:1].upper() + s[1:]