def str_offset(): "How many bytes after id(type) can we find the tp_str pointer?" # str is 6 places after repr in the type specification return repr_offset() + 6 * ctypes.sizeof(ctypes.c_ssize_t)