def _val_to_store_info(self, val, min_compress_len):
flags = <NUM_LIT:0><EOL>if isinstance(val, str):<EOL><INDENT>pass<EOL><DEDENT>elif isinstance(val, int):<EOL><INDENT>flags |= Client._FLAG_INTEGER<EOL>val = "<STR_LIT>" % val<EOL>min_compress_len = <NUM_LIT:0><EOL><DEDENT>elif isinstance(val, int):<EOL><INDENT>flags |= Client._FLAG_LONG<EOL>val = "<STR_LIT>" % val<EOL>min_compress_len = <NUM_LIT:0><EOL><DEDENT>else:<EOL><INDENT>flags |= Client._FLAG_PICKLE<EOL>file = StringIO()<EOL>if self.picklerIsKeyword:<EOL><INDENT>pickler = self.pickler(file, protocol = self.pickleProtocol)<EOL><DEDENT>else:<EOL><INDENT>pickler = self.pickler(file, self.pickleProtocol)<EOL><DEDENT>if self.persistent_id:<EOL><INDENT>pickler.persistent_id = self.persistent_id<EOL><DEDENT>pickler.dump(val)<EOL>val = file.getvalue()<EOL><DEDENT>lv = len(val)<EOL>if min_compress_len and _supports_compress and lv > min_compress_len:<EOL><INDENT>comp_val = compress(val)<EOL>if len(comp_val) < lv:<EOL><INDENT>flags |= Client._FLAG_COMPRESSED<EOL>val = comp_val<EOL><DEDENT><DEDENT>if self.server_max_value_length != <NUM_LIT:0> andlen(val) > self.server_max_value_length: return(<NUM_LIT:0>)<EOL>return (flags, len(val), val)<EOL>
Transform val to a storable representation, returning a tuple of the flags, the length of the new value, and the new value itself.