53
53
import re
54
54
import warnings
55
55
56
- import pandas .compat as compat
57
- from pandas .compat import lmap , map , u
58
-
59
56
DeprecatedOption = namedtuple ('DeprecatedOption' , 'key msg rkey removal_ver' )
60
57
RegisteredOption = namedtuple ('RegisteredOption' ,
61
58
'key defval doc validator cb' )
@@ -140,7 +137,7 @@ def _describe_option(pat='', _print_desc=True):
140
137
if len (keys ) == 0 :
141
138
raise OptionError ('No such keys(s)' )
142
139
143
- s = u ( '' )
140
+ s = ''
144
141
for k in keys : # filter by pat
145
142
s += _build_option_description (k )
146
143
@@ -634,22 +631,22 @@ def _build_option_description(k):
634
631
o = _get_registered_option (k )
635
632
d = _get_deprecated_option (k )
636
633
637
- s = u ( '{k} ' ) .format (k = k )
634
+ s = '{k} ' .format (k = k )
638
635
639
636
if o .doc :
640
637
s += '\n ' .join (o .doc .strip ().split ('\n ' ))
641
638
else :
642
639
s += 'No description available.'
643
640
644
641
if o :
645
- s += (u ( '\n [default: {default}] [currently: {current}]' )
642
+ s += ('\n [default: {default}] [currently: {current}]'
646
643
.format (default = o .defval , current = _get_option (k , True )))
647
644
648
645
if d :
649
- s += u ( '\n (Deprecated' )
650
- s += (u ( ', use `{rkey}` instead.' )
646
+ s += '\n (Deprecated'
647
+ s += (', use `{rkey}` instead.'
651
648
.format (rkey = d .rkey if d .rkey else '' ))
652
- s += u ( ')' )
649
+ s += ')'
653
650
654
651
return s
655
652
@@ -776,8 +773,7 @@ def is_instance_factory(_type):
776
773
"""
777
774
if isinstance (_type , (tuple , list )):
778
775
_type = tuple (_type )
779
- from pandas .io .formats .printing import pprint_thing
780
- type_repr = "|" .join (map (pprint_thing , _type ))
776
+ type_repr = "|" .join (map (str , _type ))
781
777
else :
782
778
type_repr = "'{typ}'" .format (typ = _type )
783
779
@@ -795,11 +791,11 @@ def is_one_of_factory(legal_values):
795
791
legal_values = [c for c in legal_values if not callable (c )]
796
792
797
793
def inner (x ):
798
- from pandas .io .formats .printing import pprint_thing as pp
799
794
if x not in legal_values :
800
795
801
796
if not any (c (x ) for c in callables ):
802
- pp_values = pp ("|" .join (lmap (pp , legal_values )))
797
+ uvals = [str (lval ) for lval in legal_values ]
798
+ pp_values = "|" .join (uvals )
803
799
msg = "Value must be one of {pp_values}"
804
800
if len (callables ):
805
801
msg += " or a callable"
@@ -814,7 +810,6 @@ def inner(x):
814
810
is_bool = is_type_factory (bool )
815
811
is_float = is_type_factory (float )
816
812
is_str = is_type_factory (str )
817
- is_unicode = is_type_factory (compat .text_type )
818
813
is_text = is_instance_factory ((str , bytes ))
819
814
820
815
0 commit comments