936 output += pack('!d', float(timestamp)) |
936 output += pack('!d', float(timestamp)) |
937 elif isinstance(obj, Data): |
937 elif isinstance(obj, Data): |
938 output += proc_variable_length(0b0100, len(obj)) |
938 output += proc_variable_length(0b0100, len(obj)) |
939 output += obj |
939 output += obj |
940 elif isinstance(obj, str): |
940 elif isinstance(obj, str): |
941 # Python 3 uses unicode strings only |
|
942 length = obj.encode('utf_16_be') |
941 length = obj.encode('utf_16_be') |
943 output += proc_variable_length(0b0110, len(length) / 2) |
942 output += proc_variable_length(0b0110, len(length) / 2) |
944 output += length |
943 output += length |
945 elif isinstance(obj, HashableWrapper): |
944 elif isinstance(obj, HashableWrapper): |
946 obj = obj.value |
945 obj = obj.value |