vaab
vaab

Reputation: 10122

How can we access PY_SSIZE_T_MAX value from python?

I'm in python code and need to check some value against PY_SSIZE_T_MAX (defined in the C-API of python).

Can I access to PY_SSIZE_T_MAX value directly ? If not, is there a way to infer it thanks to python's behavior ? Or could I safely deduce it from sizeof(ctypes.c_ssize_t) (I'm thinking at the value: 2**(8 * sizeof(c_ssize_t) - 1))?

Upvotes: 6

Views: 1234

Answers (1)

Related Questions