Re: [Python-Dev] Py_ssize_t output parameters (Was: [Python-checkins] r41971 ...)

2006-01-13 Thread M.-A. Lemburg
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

Re: [Python-Dev] Py_ssize_t output parameters (Was: [Python-checkins] r41971 ...)

2006-01-13 Thread Martin v. Löwis
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

Re: [Python-Dev] Py_ssize_t output parameters (Was: [Python-checkins] r41971 ...)

2006-01-12 Thread M.-A. Lemburg
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

Re: [Python-Dev] Py_ssize_t output parameters (Was: [Python-checkins] r41971 ...)

2006-01-12 Thread Martin v. Löwis
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

Re: [Python-Dev] Py_ssize_t output parameters (Was: [Python-checkins] r41971 ...)

2006-01-10 Thread Martin v. Löwis
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

Re: [Python-Dev] Py_ssize_t output parameters (Was: [Python-checkins] r41971 ...)

2006-01-10 Thread Martin v. Löwis
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