Every line of 'convert object to int 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.
197 def _convert(self, value): 198 199 return int(value)
439 def is_int(obj): 440 return isinstance(obj, type(1))
11 def _inttuple(obj): 12 if isinstance(obj, tuple) and len(obj)==1: 13 obj = obj[0] 14 if isinstance(obj, (slice,)+integer_types): 15 return (obj,) 16 return tuple(obj)
75 def to_int(value): 76 return int(value)
129 def int_w(self, w_obj): 130 return w_obj.int_w(self)
115 def to_python(self, node): 116 if node is None: 117 return None 118 try: 119 # xpath functions such as count return a float and must be converted to int 120 if isinstance(node, six.string_types) or isinstance(node, float): 121 return int(node) 122 123 return int(self.XPATH(node)) 124 except ValueError: 125 # anything that can't be converted to an Integer 126 return None
20 def _to_int(value): 21 if value is None: 22 return 0 23 return int(value)