123456789101112131415161718def is_number(s): if s is None: return False try: float(s) return True except ValueError: pass try: import unicodedata unicodedata.numeric(s) return True except (TypeError, ValueError): pass return False