Skip to content

Commit 7e88819

Browse files
topper-123jreback
authored andcommitted
CLN: remove StringMixin from code base, except core.computation (#26523)
1 parent d2beaf3 commit 7e88819

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

pandas/io/pytables.py

+9-10
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
to_datetime)
3333
from pandas.core.arrays.categorical import Categorical
3434
from pandas.core.arrays.sparse import BlockIndex, IntIndex
35-
from pandas.core.base import StringMixin
3635
import pandas.core.common as com
3736
from pandas.core.computation.pytables import Expr, maybe_expression
3837
from pandas.core.index import ensure_index
@@ -398,7 +397,7 @@ def _is_metadata_of(group, parent_group):
398397
return False
399398

400399

401-
class HDFStore(StringMixin):
400+
class HDFStore:
402401

403402
"""
404403
Dict-like IO interface for storing pandas objects in PyTables
@@ -520,7 +519,7 @@ def __contains__(self, key):
520519
def __len__(self):
521520
return len(self.groups())
522521

523-
def __str__(self):
522+
def __repr__(self):
524523
return '{type}\nFile path: {path}\n'.format(
525524
type=type(self), path=pprint_thing(self._path))
526525

@@ -1519,7 +1518,7 @@ def get_result(self, coordinates=False):
15191518
return results
15201519

15211520

1522-
class IndexCol(StringMixin):
1521+
class IndexCol:
15231522

15241523
""" an index column description class
15251524
@@ -1587,7 +1586,7 @@ def set_table(self, table):
15871586
self.table = table
15881587
return self
15891588

1590-
def __str__(self):
1589+
def __repr__(self):
15911590
temp = tuple(
15921591
map(pprint_thing,
15931592
(self.name,
@@ -1881,7 +1880,7 @@ def __init__(self, values=None, kind=None, typ=None,
18811880
self.set_data(data)
18821881
self.set_metadata(metadata)
18831882

1884-
def __str__(self):
1883+
def __repr__(self):
18851884
temp = tuple(
18861885
map(pprint_thing,
18871886
(self.name,
@@ -2286,7 +2285,7 @@ def get_attr(self):
22862285
pass
22872286

22882287

2289-
class Fixed(StringMixin):
2288+
class Fixed:
22902289

22912290
""" represent an object in my store
22922291
facilitate read/write of various types of objects
@@ -2336,7 +2335,7 @@ def pandas_type(self):
23362335
def format_type(self):
23372336
return 'fixed'
23382337

2339-
def __str__(self):
2338+
def __repr__(self):
23402339
""" return a pretty representation of myself """
23412340
self.infer_axes()
23422341
s = self.shape
@@ -3077,8 +3076,8 @@ def table_type_short(self):
30773076
def format_type(self):
30783077
return 'table'
30793078

3080-
def __str__(self):
3081-
""" return a pretty representatgion of myself """
3079+
def __repr__(self):
3080+
""" return a pretty representation of myself """
30823081
self.infer_axes()
30833082
dc = ",dc->[{columns}]".format(columns=(','.join(
30843083
self.data_columns) if len(self.data_columns) else ''))

pandas/io/stata.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
from pandas import (
3232
Categorical, DatetimeIndex, NaT, Timestamp, concat, isna, to_datetime,
3333
to_timedelta)
34-
from pandas.core.base import StringMixin
3534
from pandas.core.frame import DataFrame
3635
from pandas.core.series import Series
3736

@@ -712,7 +711,7 @@ def generate_value_label(self, byteorder, encoding):
712711
return bio.read()
713712

714713

715-
class StataMissingValue(StringMixin):
714+
class StataMissingValue:
716715
"""
717716
An observation's missing value.
718717

0 commit comments

Comments
 (0)