(self, token)
return self
Set value to signed or unsigned integer token.
Set value to signed or unsigned integer token.
Set value to signed or unsigned integer token .
def from_token(self, token):
        """Set value to signed or unsigned integer token."""
        d = bytearray(token)[0]
        if d in (ord(_c) for _c in (tk.T_OCT, tk.T_HEX, tk.T_INT, tk.T_UINT)):
            self._buffer[:] = token[-2:]
        elif d == ord(tk.T_BYTE):
            self._buffer[:] = token[-1:] + b'\0'
        elif ord(tk.C_0) <= d <= ord(tk.C_10):
            self._buffer[:] = int2byte(d - 0x11) + b'\0'
        else:
            raise ValueError('%s is not an Integer token.' % repr(token))
        return self
def from_token ( self , token ) : d = bytearray ( token ) [ 0 ] if d in ( ord ( _c ) for _c in ( tk . T_OCT , tk . T_HEX , tk . T_INT , tk . T_UINT ) ) : self . _buffer [ : ] = token [ - 2 : ] elif d == ord ( tk . T_BYTE ) : self . _buffer [ : ] = token [ - 1 : ] + b'\0' elif ord ( tk . C_0 ) <= d <= ord ( tk . C_10 ) : self . _buffer [ : ] = int2byte ( d - 0x11 ) + b'\0' else : raise ValueError ( '%s is not an Integer token.' % repr ( token ) ) return self