* Remove explicit bytes type in doc.from_bytes, to accept bytearray

This commit is contained in:
Matthew Honnibal 2015-07-24 04:54:13 +02:00
parent aa28e2e01d
commit 2060935cdb

View File

@ -298,7 +298,7 @@ cdef class Doc:
byte_string = self.vocab.serializer.pack(self) byte_string = self.vocab.serializer.pack(self)
return struct.pack('I', len(byte_string)) + byte_string return struct.pack('I', len(byte_string)) + byte_string
def from_bytes(self, bytes data): def from_bytes(self, data):
self.vocab.serializer.unpack_into(data[4:], self) self.vocab.serializer.unpack_into(data[4:], self)
return self return self