def to_python(self, value):
        """
        Validates that int() can be called on the input. Returns the result
        of int(). Returns None for empty values.
        """
        value = super(IntegerField, self).to_python(value)
        if value in self.empty_values:
            return None
        if self.localize:
            value = formats.sanitize_separators(value)
        # Strip trailing decimal and zeros.
        try:
            value = int(self.re_decimal.sub('', str(value)))
        except (__HOLE__, TypeError):
            raise ValidationError(self.error_messages['invalid'], code='invalid')
        return value
dataset/ETHPy150Open django/django/django/forms/fields.py/IntegerField.to_python