Skip to content

Commit 8a927b0

Browse files
committed
create base class methods for _create_arithmetic_method, _create_comparison_method
1 parent 029a32a commit 8a927b0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pandas/core/arrays/base.py

+9
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,11 @@ class ExtensionOpsMixin(object):
634634
"""
635635
A base class for linking the operators to their dunder names
636636
"""
637+
638+
@classmethod
639+
def _create_arithmetic_method(cls, op):
640+
raise AbstractMethodError(cls)
641+
637642
@classmethod
638643
def _add_arithmetic_ops(cls):
639644
cls.__add__ = cls._create_arithmetic_method(operator.add)
@@ -657,6 +662,10 @@ def _add_arithmetic_ops(cls):
657662
cls.__divmod__ = cls._create_arithmetic_method(divmod)
658663
cls.__rdivmod__ = cls._create_arithmetic_method(ops.rdivmod)
659664

665+
@classmethod
666+
def _create_comparison_method(cls, op):
667+
raise AbstractMethodError(cls)
668+
660669
@classmethod
661670
def _add_comparison_ops(cls):
662671
cls.__eq__ = cls._create_comparison_method(operator.eq)

0 commit comments

Comments
 (0)