Consider the following: le = ctypes.c_uint32.__ctype_le__ be = ctypes.c_uint16.__ctype_be__ How can I write a function is_bigendian(cls) that behaves as you would expect: >>> is_bigendian(le) False >>> is_bigendian(be) True Does ctypes expose this information somewhere? Continue reading...