Skip to content

Commit 2fd3d5d

Browse files
committed
unicode
1 parent ff0c998 commit 2fd3d5d

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

pandas/core/arrays/base.py

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99

1010
import operator
1111

12-
from pandas import compat
13-
from pandas.core.config import get_option
12+
from pandas.core.base import StringMixin
1413
from pandas.core.dtypes.generic import ABCSeries, ABCIndexClass
1514
from pandas.errors import AbstractMethodError
1615
from pandas.compat.numpy import function as nv
@@ -21,7 +20,7 @@
2120
_not_implemented_message = "{} does not implement {}."
2221

2322

24-
class ExtensionArray(object):
23+
class ExtensionArray(StringMixin):
2524
"""Abstract base class for custom 1-D array types.
2625
2726
pandas will recognize instances of this class as proper arrays
@@ -682,18 +681,6 @@ def __unicode__(self):
682681
length=len(self),
683682
dtype=self.dtype)
684683

685-
def __str__(self):
686-
if compat.PY3:
687-
return self.__unicode__()
688-
return self.__bytes__()
689-
690-
def __bytes__(self):
691-
encoding = get_option("display.encoding")
692-
return self.__unicode__().encode(encoding, 'replace')
693-
694-
def __repr__(self):
695-
return str(self)
696-
697684
def _formatter(self, formatter=None):
698685
# type: (Optional[ExtensionArrayFormatter]) -> Callable[[Any], str]
699686
"""Formatting function for scalar values.

0 commit comments

Comments
 (0)