Skip to content

Commit 680b215

Browse files
authored
CLN: Move capitalize_first_letter to where it's used (#57096)
1 parent 47418a1 commit 680b215

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

pandas/core/dtypes/dtypes.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,6 @@
6262
is_list_like,
6363
)
6464

65-
from pandas.util import capitalize_first_letter
66-
6765
if not pa_version_under10p1:
6866
import pyarrow as pa
6967

@@ -1087,7 +1085,7 @@ def na_value(self) -> NaTType:
10871085

10881086
def __eq__(self, other: object) -> bool:
10891087
if isinstance(other, str):
1090-
return other in [self.name, capitalize_first_letter(self.name)]
1088+
return other[:1].lower() + other[1:] == self.name
10911089

10921090
return super().__eq__(other)
10931091

pandas/util/__init__.py

-4
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,3 @@ def __getattr__(key: str):
2727

2828
def __dir__():
2929
return list(globals().keys()) + ["hash_array", "hash_pandas_object"]
30-
31-
32-
def capitalize_first_letter(s: str) -> str:
33-
return s[:1].upper() + s[1:]

0 commit comments

Comments
 (0)