@@ -126,14 +126,11 @@ class PandasExtensionDtype(ExtensionDtype):
126
126
isnative = 0
127
127
_cache = {} # type: Dict[str_type, 'PandasExtensionDtype']
128
128
129
- def __unicode__ (self ):
130
- return self .name
131
-
132
129
def __str__ (self ):
133
130
"""
134
131
Return a string representation for a particular Object
135
132
"""
136
- return self .__unicode__ ()
133
+ return self .name
137
134
138
135
def __bytes__ (self ):
139
136
"""
@@ -142,7 +139,7 @@ def __bytes__(self):
142
139
from pandas ._config import get_option
143
140
144
141
encoding = get_option ("display.encoding" )
145
- return self . __unicode__ ( ).encode (encoding , 'replace' )
142
+ return str ( self ).encode (encoding , 'replace' )
146
143
147
144
def __repr__ (self ):
148
145
"""
@@ -707,7 +704,7 @@ def construct_from_string(cls, string):
707
704
708
705
raise TypeError ("Could not construct DatetimeTZDtype" )
709
706
710
- def __unicode__ (self ):
707
+ def __str__ (self ):
711
708
return "datetime64[{unit}, {tz}]" .format (unit = self .unit , tz = self .tz )
712
709
713
710
@property
@@ -837,12 +834,12 @@ def construct_from_string(cls, string):
837
834
pass
838
835
raise TypeError ("could not construct PeriodDtype" )
839
836
840
- def __unicode__ (self ):
841
- return str ( self .name )
837
+ def __str__ (self ):
838
+ return self .name
842
839
843
840
@property
844
841
def name (self ):
845
- return str ( "period[{freq}]" .format (freq = self .freq .freqstr ) )
842
+ return "period[{freq}]" .format (freq = self .freq .freqstr )
846
843
847
844
@property
848
845
def na_value (self ):
@@ -1007,7 +1004,7 @@ def construct_from_string(cls, string):
1007
1004
def type (self ):
1008
1005
return Interval
1009
1006
1010
- def __unicode__ (self ):
1007
+ def __str__ (self ):
1011
1008
if self .subtype is None :
1012
1009
return "interval"
1013
1010
return "interval[{subtype}]" .format (subtype = self .subtype )
0 commit comments