Martin v. Löwis wrote:
M.-A. Lemburg wrote:
What if x64 has a 64-bit value ? How do you catch
and process the truncation error ?
We were *both* discussing a scenario where no sizes
exceed 2**31, right?
Right, but I don't see the point of each and every
extension having to go through these
M.-A. Lemburg wrote:
Right, but I don't see the point of each and every
extension having to go through these hoops when you
could add support for these checks (including error
reporting) to the few APIs in question, in particular
the PyArg_ParseTuple() API.
I don't want to rename the
Martin v. Löwis wrote:
M.-A. Lemburg wrote:
... and then the type change of that variable propagates
throughout the extension.
That depends on the usage of the code. If the variable
is passed by value, no further changes are necessary.
If a pointer to the variable is passed, you could
M.-A. Lemburg wrote:
What if x64 has a 64-bit value ? How do you catch
and process the truncation error ?
We were *both* discussing a scenario where no sizes
exceed 2**31, right?
Under such a scenario, this just won't happen.
OTOH, if you were discussing a scenario where sizes
might exceed
M.-A. Lemburg wrote:
I don't believe the change is major. It only affects a few extensions,
and for these, it is only a minor change. A single line of changing
will be enough.
This is true for all the changes related to parameters passed by
value. It is not true for output parameters. For
M.-A. Lemburg wrote:
... and then the type change of that variable propagates
throughout the extension.
That depends on the usage of the code. If the variable
is passed by value, no further changes are necessary.
If a pointer to the variable is passed, you could replace
it with
Py_ssize_t