Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def load(self):
obj = self._object_
self.value = []
# which kind of load are we
if ptype.isptype(obj) and not ptype.ispcontainer(obj):
self.load_block()
elif ptype.ispcontainer(obj) or ptype.isresolveable(obj):
self.load_container()
if self.initialized:
return self
# assert len(self) == len(self.value), '%d != %d'% (len(self), len(self.value))
# now that we know the length, read the array
self.source.seek(self.getoffset())
block = self.source.consume(self.size())
return self.deserialize(block)