Skip to content

Commit df9762e

Browse files
committed
CLN: Remove unnecesssary parts of classes (eq, hash)
1 parent 322a4cb commit df9762e

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

pandas-stubs/core/dtypes/dtypes.pyi

+5-15
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,20 @@ from pandas._typing import (
1313

1414
from .base import ExtensionDtype as ExtensionDtype
1515

16-
_str = str
17-
1816
def register_extension_dtype(cls: type[ExtensionDtype]) -> type[ExtensionDtype]: ...
1917

2018
class BaseMaskedDtype(ExtensionDtype): ...
2119

2220
class PandasExtensionDtype(ExtensionDtype):
2321
subdtype = ...
24-
str: _str | None = ...
22+
str: str | None = ...
2523
num: int = ...
2624
shape: tuple[int, ...] = ...
2725
itemsize: int = ...
2826
base = ...
2927
isbuiltin: int = ...
3028
isnative: int = ...
31-
def __hash__(self) -> int: ...
29+
3230
@classmethod
3331
def reset_cache(cls) -> None: ...
3432

@@ -38,42 +36,34 @@ class CategoricalDtype(PandasExtensionDtype, ExtensionDtype):
3836
categories: Series | Index | list[Any] | None = ...,
3937
ordered: Ordered = ...,
4038
) -> None: ...
41-
def __hash__(self) -> int: ...
42-
def __eq__(self, other) -> bool: ...
4339
@property
4440
def categories(self) -> Index: ...
4541
@property
4642
def ordered(self) -> Ordered: ...
4743

4844
class DatetimeTZDtype(PandasExtensionDtype):
4945
def __init__(
50-
self, unit: _str = ..., tz: str | int | dt.tzinfo | None = ...
46+
self, unit: str = ..., tz: str | int | dt.tzinfo | None = ...
5147
) -> None: ...
5248
@property
5349
def unit(self): ...
5450
@property
5551
def tz(self): ...
5652
@property
57-
def name(self) -> _str: ...
58-
def __hash__(self) -> int: ...
59-
def __eq__(self, other) -> bool: ...
53+
def name(self) -> str: ...
6054

6155
class PeriodDtype(PandasExtensionDtype):
6256
def __new__(cls, freq: str | BaseOffset = ...): ...
63-
def __hash__(self) -> int: ...
64-
def __eq__(self, other) -> bool: ...
6557
@property
6658
def freq(self): ...
6759
@property
68-
def name(self) -> _str: ...
60+
def name(self) -> str: ...
6961
@property
7062
def na_value(self): ...
7163
def __from_arrow__(self, array): ...
7264

7365
class IntervalDtype(PandasExtensionDtype):
7466
def __new__(cls, subtype: str | npt.DTypeLike | None = ...): ...
75-
def __hash__(self) -> int: ...
76-
def __eq__(self, other) -> bool: ...
7767
@property
7868
def subtype(self): ...
7969
@property

0 commit comments

Comments
 (0)