[issue22732] ctypes tests don't set correct restype for intptr_t functions

eryksun report at bugs.python.org
Mon Oct 27 02:35:42 CET 2014


eryksun added the comment:

> Why not use c_size_t? Or is that incorrect in some cases?

Strictly speaking, size_t doesn't have to encompass the entire addressable range, such as for architectures that use segmented addressing (e.g. near and far pointers). Practically speaking, no platform supported by ctypes makes this distinction, so c_size_t and c_ssize_t use the platform pointer size.

https://hg.python.org/cpython/file/ab2c023a9432/Lib/ctypes/__init__.py#l459

OTOH, it's best to avoid accumulating layers of assumptions.

----------
nosy: +eryksun

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22732>
_______________________________________


More information about the Python-bugs-list mailing list