Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def save_str(self, s):
self._write(opcode.PY3STRING)
self._write_unicode_string(s)
def save_long(self, l):
self._save_integral(l, opcode.LONG, opcode.LONGLONG)
def save_complex(self, cpx):
self._write(opcode.COMPLEX)
self._write(struct.pack(COMPLEX_FORMAT, cpx.real, cpx.imag))
def save_Channel(self, channel):
self._write(opcode.CHANNEL)
self._write_int4(channel.id)
def save_bool(self, boolean):
if boolean:
self._write(opcode.TRUE)
else:
self._write(opcode.FALSE)
def save_frozenset(self, s):
self._write_set(s, opcode.FROZENSET)
def save_int(self, i):
self._save_integral(i, opcode.INT, opcode.LONGINT)
def save_set(self, s):
self._write_set(s, opcode.SET)
def save_float(self, flt):
self._write(opcode.FLOAT)
self._write(struct.pack(FLOAT_FORMAT, flt))
def _write_setitem(self, key, value):
self._save(key)
self._save(value)
self._write(opcode.SETITEM)