12
12
13
13
from pandas .core .dtypes .common import is_list_like , is_scalar
14
14
15
- from pandas .core .base import StringMixin
16
15
import pandas .core .common as com
17
16
from pandas .core .computation .common import _ensure_decoded , _result_type_many
18
17
from pandas .core .computation .scope import _DEFAULT_GLOBALS
@@ -63,7 +62,7 @@ def __init__(self, name, is_local):
63
62
super ().__init__ (msg .format (name ))
64
63
65
64
66
- class Term ( StringMixin ) :
65
+ class Term :
67
66
def __new__ (cls , name , env , side = None , encoding = None ):
68
67
klass = Constant if not isinstance (name , str ) else cls
69
68
supr_new = super (Term , klass ).__new__
@@ -82,7 +81,7 @@ def __init__(self, name, env, side=None, encoding=None):
82
81
def local_name (self ):
83
82
return self .name .replace (_LOCAL_TAG , "" )
84
83
85
- def __str__ (self ):
84
+ def __repr__ (self ):
86
85
return pprint_thing (self .name )
87
86
88
87
def __call__ (self , * args , ** kwargs ):
@@ -182,7 +181,7 @@ def _resolve_name(self):
182
181
def name (self ):
183
182
return self .value
184
183
185
- def __str__ (self ):
184
+ def __repr__ (self ):
186
185
# in python 2 str() of float
187
186
# can truncate shorter than repr()
188
187
return repr (self .name )
@@ -191,7 +190,7 @@ def __str__(self):
191
190
_bool_op_map = {"not" : "~" , "and" : "&" , "or" : "|" }
192
191
193
192
194
- class Op ( StringMixin ) :
193
+ class Op :
195
194
196
195
"""Hold an operator of arbitrary arity
197
196
"""
@@ -204,7 +203,7 @@ def __init__(self, op, operands, *args, **kwargs):
204
203
def __iter__ (self ):
205
204
return iter (self .operands )
206
205
207
- def __str__ (self ):
206
+ def __repr__ (self ):
208
207
"""Print a generic n-ary operator and its operands using infix
209
208
notation"""
210
209
# recurse over the operands
@@ -537,7 +536,7 @@ def __call__(self, env):
537
536
operand = self .operand (env )
538
537
return self .func (operand )
539
538
540
- def __str__ (self ):
539
+ def __repr__ (self ):
541
540
return pprint_thing ("{0}({1})" .format (self .op , self .operand ))
542
541
543
542
@property
@@ -562,7 +561,7 @@ def __call__(self, env):
562
561
with np .errstate (all = "ignore" ):
563
562
return self .func .func (* operands )
564
563
565
- def __str__ (self ):
564
+ def __repr__ (self ):
566
565
operands = map (str , self .operands )
567
566
return pprint_thing ("{0}({1})" .format (self .op , "," .join (operands )))
568
567
0 commit comments