Simplify some redundant code
This commit is contained in:
parent
b5dfeaa629
commit
643adf4d0a
@ -60,10 +60,7 @@ class Rstring (str):
|
|||||||
the following regexp:
|
the following regexp:
|
||||||
r'^[\+\-]{0,1}[0-9]+$'
|
r'^[\+\-]{0,1}[0-9]+$'
|
||||||
'''
|
'''
|
||||||
if Rstring.int_regexp.match(self) is None:
|
return Rstring.int_regexp.match(self) is not None
|
||||||
return False
|
|
||||||
else:
|
|
||||||
return True
|
|
||||||
|
|
||||||
def isFloat(self):
|
def isFloat(self):
|
||||||
'''Returns true if the string represents a float number
|
'''Returns true if the string represents a float number
|
||||||
@ -71,10 +68,7 @@ class Rstring (str):
|
|||||||
the following regexp:
|
the following regexp:
|
||||||
r'^[\+\-]{0,1}[0-9]+(\.([0-9])+)?$'
|
r'^[\+\-]{0,1}[0-9]+(\.([0-9])+)?$'
|
||||||
'''
|
'''
|
||||||
if Rstring.float_regexp.match(self) is None:
|
return Rstring.float_regexp.match(self) is not None
|
||||||
return False
|
|
||||||
else:
|
|
||||||
return True
|
|
||||||
|
|
||||||
def isDate(self):
|
def isDate(self):
|
||||||
'''Returns true if the string represents a date,
|
'''Returns true if the string represents a date,
|
||||||
|
Loading…
Reference in New Issue
Block a user