1
- import operator
2
1
from typing import Any , List
3
2
import warnings
4
3
9
8
from pandas ._libs import index as libindex
10
9
from pandas ._libs .hashtable import duplicated_int64
11
10
from pandas ._typing import AnyArrayLike
12
- import pandas .compat as compat
13
11
from pandas .util ._decorators import Appender , cache_readonly
14
12
15
13
from pandas .core .dtypes .common import (
29
27
import pandas .core .common as com
30
28
import pandas .core .indexes .base as ibase
31
29
from pandas .core .indexes .base import Index , _index_shared_docs , maybe_extract_name
32
- from pandas .core .indexes .extension import ExtensionIndex , make_wrapped_comparison_op
30
+ from pandas .core .indexes .extension import ExtensionIndex
33
31
import pandas .core .missing as missing
34
32
from pandas .core .ops import get_op_result_name
35
33
@@ -858,24 +856,6 @@ def _concat_same_dtype(self, to_concat, name):
858
856
result .name = name
859
857
return result
860
858
861
- @classmethod
862
- def _add_comparison_methods (cls ):
863
- """ add in comparison methods """
864
-
865
- def _make_compare (op ):
866
- opname = f"__{ op .__name__ } __"
867
-
868
- _evaluate_compare = make_wrapped_comparison_op (opname )
869
-
870
- return compat .set_function_name (_evaluate_compare , opname , cls )
871
-
872
- cls .__eq__ = _make_compare (operator .eq )
873
- cls .__ne__ = _make_compare (operator .ne )
874
- cls .__lt__ = _make_compare (operator .lt )
875
- cls .__gt__ = _make_compare (operator .gt )
876
- cls .__le__ = _make_compare (operator .le )
877
- cls .__ge__ = _make_compare (operator .ge )
878
-
879
859
def _delegate_property_get (self , name , * args , ** kwargs ):
880
860
""" method delegation to the ._values """
881
861
prop = getattr (self ._values , name )
@@ -895,4 +875,3 @@ def _delegate_method(self, name, *args, **kwargs):
895
875
CategoricalIndex ._add_numeric_methods_add_sub_disabled ()
896
876
CategoricalIndex ._add_numeric_methods_disabled ()
897
877
CategoricalIndex ._add_logical_methods_disabled ()
898
- CategoricalIndex ._add_comparison_methods ()
0 commit comments