Skip to content

Commit 62b1e2f

Browse files
committed
remove bytes
1 parent 2364546 commit 62b1e2f

File tree

3 files changed

+1
-16
lines changed

3 files changed

+1
-16
lines changed

pandas/core/arrays/base.py

-6
Original file line numberDiff line numberDiff line change
@@ -675,12 +675,6 @@ def __repr__(self):
675675
length=len(self),
676676
dtype=self.dtype)
677677

678-
def __bytes__(self):
679-
from pandas.core.config import get_option
680-
681-
encoding = get_option("display.encoding")
682-
return str(self).encode(encoding, 'replace')
683-
684678
def _formatter(self, formatter=None):
685679
# type: (Optional[ExtensionArrayFormatter]) -> Callable[[Any], str]
686680
"""Formatting function for scalar values.

pandas/core/arrays/categorical.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -1991,11 +1991,9 @@ def __unicode__(self):
19911991
return result
19921992

19931993
def __repr__(self):
1994+
# We want PandasObject.__repr__, which dispatches to __unicode__
19941995
return super(ExtensionArray, self).__repr__()
19951996

1996-
def __bytes__(self):
1997-
return super(ExtensionArray, self).__bytes__()
1998-
19991997
def _maybe_coerce_indexer(self, indexer):
20001998
""" return an indexer coerced to the codes dtype """
20011999
if isinstance(indexer, np.ndarray) and indexer.dtype.kind == 'i':

pandas/tests/extension/base/printing.py

-7
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,6 @@ def test_array_repr(self, data, size):
2525
if size == 'big':
2626
assert '...' in result
2727

28-
def test_array_repr_bytes(self, data):
29-
result = bytes(data)
30-
if compat.PY2:
31-
assert isinstance(result, str)
32-
else:
33-
assert isinstance(result, bytes)
34-
3528
def test_array_repr_unicode(self, data):
3629
result = compat.text_type(data)
3730
assert isinstance(result, compat.text_type)

0 commit comments

Comments
 (0)