你的意思是说 Python 或使用 ctypes ?
在第一种情况下,您只是不能-因为Python没有有符号/无符号的16/32位整数。
在第二种情况下,您可以使用 type() :
type()
>>> import ctypes >>> a = ctypes.c_uint() # unsigned int >>> type(a) <class 'ctypes.c_ulong'>
有关ctypes(its类型)的更多参考,请参见 the official documentation .