def load_reduce(self): stack = self.stack callable = stack[-2] arg_tup = stack[-1] del stack[-2:] if type(callable) is not ClassType: if not safe_constructors.has_key(callable): try: safe = callable.__safe_for_unpickling__ except AttributeError: safe = None if not safe: raise UnpicklingError, "%s is not safe for " \ "unpickling" % callable if arg_tup is None: value = callable.__basicnew__() else: value = apply(callable, arg_tup) self.append(value)
"""Create portable serialized representations of Python objects.