[Python-Dev] Near Final PEP 237 - Unifying Long Integers and Integers

David Beazley beazley@cs.uchicago.edu
Thu, 23 Aug 2001 21:26:09 -0500 (CDT)


Guido van Rossum writes:
 > Please comment on a new version of PEP 237:
 > 
 > Please mail comments on the PEP to python-dev@python.org or to me.
 > 

The PEP looks good to me.   Can I make a very small C API feature 
request? (assuming this hasn't been implemented already).

Since "integers" can now have arbitrary precision and can represent
large unsigned values, can you add three new format characters to
PyArg_ParseTuple() and Py_BuildValue() for the C datatypes "unsigned int", 
"unsigned long", and "unsigned long long"?  

The "u" and "l" namespace is a little crowded (and I don't think you
would want to break that).  However, here's one idea:

'I'     -  unsigned int  (consistent with H and B)
'p'     -  unsigned long ('p' is for positive)
'P'     -  unsigned long long

Cheers,

Dave