Every line of 'isnum python' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.
13 def is_num(s): 14 try: 15 int(s) 16 except ValueError: 17 return False 18 else: 19 return True
359 def isnum(o): 360 return isinstance(o, (int, float))
6 def isnum(val): 7 """Check if a value is a number""" 8 # Todo: is there a better way to check this? 9 return isinstance(val, int) or isinstance(val, float) or isinstance(val, long)