Title: PyInt_FromSize_t is undocumented.
Type: Stage:
Components: Documentation Versions: Python 2.7, Python 2.6
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: georg.brandl Nosy List: georg.brandl, mark.dickinson, methane
Priority: normal Keywords:

Created on 2009-06-10 16:06 by methane, last changed 2009-06-17 09:43 by georg.brandl. This issue is now closed.

Messages (4)
msg89208 - (view) Author: Inada Naoki (methane) * (Python committer) Date: 2009-06-10 16:06
PyInt_FromSize_t() is not in Python/C API document.
People seeing document may be not able to find how to make int from 
unsigned long.
msg89228 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2009-06-10 20:16
It seems to me that PyInt_FromSize_t() wouldn't be the right way to create a Python 
int from a C unsigned long anyway, since there's no guarantee that C's unsigned 
long and size_t have the same precision.

(I'm not disputing that PyInt_FromSize_t should be documented, by the way.)

Maybe a PyInt_FromUnsignedLong method would be useful?  It would be trivial to 
msg89235 - (view) Author: Inada Naoki (methane) * (Python committer) Date: 2009-06-11 00:57
You're right. PyInt_FromSize_t() isn't safe for unsigned long.

> Maybe a PyInt_FromUnsignedLong method would be useful?  It would be 
trivial to 
> implement.

I hope that all of py3k's PyInt_From** are in Python 2.x.
It makes maintaining extension module for both of Py2.x and Py3k a bit 
msg89450 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2009-06-17 09:43
Documented in r73463.
Date User Action Args
2009-06-17 09:43:41georg.brandlsetstatus: open -> closed
resolution: fixed
messages: + msg89450
2009-06-11 00:57:38methanesetmessages: + msg89235
2009-06-10 20:16:38mark.dickinsonsetnosy: + mark.dickinson
messages: + msg89228
2009-06-10 16:06:59methanecreate