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 revisionPrevious revision
Last revisionBoth sides next revision
python:index [2014/07/19 22:02] tkbletscpython: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

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki