User Tools

Site Tools


python:index

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Last revision Both sides next revision
python:index [2014/07/19 22:02]
tkbletsc
python:index [2014/07/19 22:04]
tkbletsc
Line 122: Line 122:
 <​code=python>​ <​code=python>​
 def recognize_type(v):​ def recognize_type(v):​
-    ​if re.match(r'​\d+$',​v): +    ​try: return float(v) 
-        return int(v) +    except ValueErrorpass 
-    ​if re.match(r'​\d+\.\d*$',​v)+     
-        ​return float(v)+    try: return int(v) 
 +    ​except ValueErrorpass 
 +    
     return v     return v
     ​     ​
python/index.txt · Last modified: 2014/07/20 17:48 by tkbletsc