[Python-Dev] Deprecation warning on integer shifts and such

Martin v. Loewis martin@v.loewis.de
12 Aug 2002 17:29:14 +0200

Guido van Rossum <guido@python.org> writes:

> There's no excuse for that any more.  The 'i' and 'l' format chars of
> PyArg_Parse* and PyInt_AsLong() both work for longs as well as for
> ints.

There is a change, of course: Passing 0xff<<24 to a function that uses
the "i" converter will produce an OverflowError, whereas it previously
would pass in the negative numbers.

For cases of "I want 32 bits in an int", you'll have to accept both
signed and unsigned 32 bits - something that is currently not
supported in ParseTuple.