This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: PyInt_FromSize_t is undocumented.
Type: Stage:
Components: Documentation Versions: Python 2.7, Python 2.6
process
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 2022-04-11 14:56 by admin. 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 
implement.
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 
easier.
msg89450 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2009-06-17 09:43
Documented in r73463.
History
Date User Action Args
2022-04-11 14:56:49adminsetgithub: 50504
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