File tree 2 files changed +2
-13
lines changed
2 files changed +2
-13
lines changed Original file line number Diff line number Diff line change 17
17
from .exc import IllegalArgument , IntervalException , RangeBoundsException
18
18
from .parser import IntervalParser , IntervalStringParser
19
19
20
- try :
21
- string_types = basestring , # Python 2
22
- except NameError :
23
- string_types = str , # Python 3
24
-
25
20
26
21
def is_number (number ):
27
22
return isinstance (number , (float , int , Decimal ))
@@ -171,7 +166,7 @@ def __init__(
171
166
30
172
167
173
168
"""
174
- if isinstance (bounds , string_types ):
169
+ if isinstance (bounds , str ):
175
170
raise TypeError (
176
171
'First argument should be a list or tuple. If you wish to '
177
172
'initialize an interval from string, use from_string factory '
@@ -301,7 +296,7 @@ def coerce_value(self, value):
301
296
return value
302
297
elif isinstance (value , self .type ):
303
298
return value
304
- elif isinstance (value , string_types ):
299
+ elif isinstance (value , str ):
305
300
return self .coerce_string (value )
306
301
else :
307
302
return self .coerce_obj (value )
Original file line number Diff line number Diff line change 1
1
from .exc import IntervalException
2
2
3
- try :
4
- string_types = basestring , # Python 2
5
- except NameError :
6
- string_types = str , # Python 3
7
-
8
-
9
3
strip = lambda a : a .strip ()
10
4
11
5
You can’t perform that action at this time.
0 commit comments