Home | History | Annotate | Download | only in python2.7

Lines Matching refs:pack

53 # Why use struct.pack() for pickling but marshal.loads() for
54 # unpickling? struct.pack() is 40% faster than marshal.dumps(), but
250 def put(self, i, pack=struct.pack):
255 return LONG_BINPUT + pack("<i", i)
260 def get(self, i, pack=struct.pack):
265 return LONG_BINGET + pack("<i", i)
437 def save_int(self, obj, pack=struct.pack):
455 self.write(BININT + pack("<i", obj))
461 def save_long(self, obj, pack=struct.pack):
468 self.write(LONG4 + pack("<i", n) + bytes)
473 def save_float(self, obj, pack=struct.pack):
475 self.write(BINFLOAT + pack('>d', obj))
480 def save_string(self, obj, pack=struct.pack):
486 self.write(BINSTRING + pack("<i", n) + obj)
492 def save_unicode(self, obj, pack=struct.pack):
496 self.write(BINUNICODE + pack("<i", n) + encoding)
506 def save_string(self, obj, pack=struct.pack):
516 s = pack("<i", l)
730 def save_global(self, obj, name=None, pack=struct.pack):
764 write(EXT4 + pack("<i", code))