ctypes in python size with the `sys.getsizeof(Var)` method vs `ctypes.sizeof(Var)`

前端 未结 3 1220
后悔当初
后悔当初 2020-12-20 23:01

I have a question about variable size in python, I\'m using the the Ctypes because i want a 1 byte number, but when I tried to check it\'s size in python (via sys.gets

3条回答
  •  隐瞒了意图╮
    2020-12-20 23:21

    sys.getsizeof returns the size of a python object, this has nothing to do with the size of a C data type. And it is nothing you have to concern about.

提交回复
热议问题