(self, in_int)
return self
Set value to Python int.
Set value to Python int.
Set value to Python int .
def from_int(self, in_int):
        """Set value to Python int."""
        if in_int == 0:
            self._buffer[:] = b'\0' * self.size
        else:
            neg = in_int < 0
            man, exp = self._bring_to_range(abs(in_int), self._bias, self._posmask, self._mask)
            if not self._check_limits(exp, neg):
                return self
            struct.pack_into(
                self._intformat, self._buffer, 0, man & (self._mask if neg else self._posmask)
            )
            self._buffer[-1:] = int2byte(exp)
        return self
def from_int ( self , in_int ) : if in_int == 0 : self . _buffer [ : ] = b'\0' * self . size else : neg = in_int < 0 man , exp = self . _bring_to_range ( abs ( in_int ) , self . _bias , self . _posmask , self . _mask ) if not self . _check_limits ( exp , neg ) : return self struct . pack_into ( self . _intformat , self . _buffer , 0 , man & ( self . _mask if neg else self . _posmask ) ) self . _buffer [ - 1 : ] = int2byte ( exp ) return self