[Python-Dev] int/long FutureWarning

Jack Jansen Jack.Jansen@oratrix.com
Sat, 30 Nov 2002 00:55:43 +0100


On vrijdag, nov 29, 2002, at 23:28 Europe/Amsterdam, Mark Hammond wrote:
> [Jack]
>> This would be ideal, of course. But note that for me changing the
>> format char is a minor issue,
[...]
>  And as Jack's
> latest mail points out, supporting multiple versions of Python becomes
> almost impossible.

Please note that I now also think that changing the format char is 
*not* a minor issue (since I'm aware of the impossibility of backward 
compatibility). Survivable, okay, but definitely very bothersome.

How about taking a completely different angle on this matter, and 
looking at PyArg_Parse itself? If we can keep PyArg_Parse 100% backward 
compatible (which would mean that its "i" format would take any 
IntObject or LongObject between -1e31 and 1e32-1) and introduce a new 
(preferred) way to parse arguments that not only does the right thing 
by being expressive enough to make a difference between "currency 
integers" and "bitmap integers", but also cleans up the incredible 
amount of cruft that PyArg_Parse has accumulated over the years?

We could get rid of the prefix and suffix characters in the format, of 
the fact that essential parts of the process are not in the format but 
hidden in the argument list (O& and friends), of the fact that you 
cannot represent the format in Python (hmm, that's more-or-less the 
same problem as the previous one), of the unicode conversion problems 
(by having a structure like
x = PyArg_GetArgs(...)
...
PyArg_ReleaseArgs(x)) and probably of many more problems...
--
- Jack Jansen        <Jack.Jansen@oratrix.com>        
http://www.cwi.nl/~jack -
- If I can't dance I don't want to be part of your revolution -- Emma 
Goldman -