get rid of u string literal
This commit is contained in:
parent
d03a6b120d
commit
99e221095b
7 changed files with 98 additions and 98 deletions
16
ox/format.py
16
ox/format.py
|
|
@ -224,16 +224,16 @@ def to36(q):
|
|||
def from36(q):
|
||||
return int(q, 36)
|
||||
|
||||
def int_value(strValue, default=u''):
|
||||
def int_value(strValue, default=''):
|
||||
"""
|
||||
>>> int_value('abc23')
|
||||
u'23'
|
||||
'23'
|
||||
|
||||
>>> int_value(' abc23')
|
||||
u'23'
|
||||
'23'
|
||||
|
||||
>>> int_value('ab')
|
||||
u''
|
||||
''
|
||||
"""
|
||||
try:
|
||||
val = re.compile('(\d+)').findall(str(strValue).strip())[0]
|
||||
|
|
@ -241,16 +241,16 @@ def int_value(strValue, default=u''):
|
|||
val = default
|
||||
return val
|
||||
|
||||
def float_value(strValue, default=u''):
|
||||
def float_value(strValue, default=''):
|
||||
"""
|
||||
>>> float_value('abc23.4')
|
||||
u'23.4'
|
||||
'23.4'
|
||||
|
||||
>>> float_value(' abc23.4')
|
||||
u'23.4'
|
||||
'23.4'
|
||||
|
||||
>>> float_value('ab')
|
||||
u''
|
||||
''
|
||||
"""
|
||||
try:
|
||||
val = re.compile('([\d.]+)').findall(str(strValue).strip())[0]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue