Skip to content

Commit 35f3e0f

Browse files
bmcfeejreback
authored andcommitted
relocated Index.__deepcopy__ to live near __copy__
1 parent 1aea940 commit 35f3e0f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pandas/indexes/base.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,11 @@ def copy(self, name=None, deep=False, dtype=None, **kwargs):
727727
def __copy__(self, **kwargs):
728728
return self.copy(**kwargs)
729729

730+
def __deepcopy__(self, memo=None):
731+
if memo is None:
732+
memo = {}
733+
return self.copy(deep=True)
734+
730735
def _validate_names(self, name=None, names=None, deep=False):
731736
"""
732737
Handles the quirks of having a singular 'name' parameter for general
@@ -1481,11 +1486,6 @@ def __setstate__(self, state):
14811486

14821487
_unpickle_compat = __setstate__
14831488

1484-
def __deepcopy__(self, memo=None):
1485-
if memo is None:
1486-
memo = {}
1487-
return self.copy(deep=True)
1488-
14891489
def __nonzero__(self):
14901490
raise ValueError("The truth value of a {0} is ambiguous. "
14911491
"Use a.empty, a.bool(), a.item(), a.any() or a.all()."

0 commit comments

Comments
 (0)