[Python-Dev] int/long FutureWarning
Guido van Rossum
guido@python.org
Thu, 28 Nov 2002 08:57:36 -0500
> Guido van Rossum <guido@python.org> writes:
>
> > But in Mark's case (and in many other cases) there will be no problem
> > in the future -- in Python 2.4, his C code will happily accept the
> > positive Python longs that 0x80000000 and others will be then.
>
> Can you please explain how this will happen? If you do
>
> int x;
> PyArg_ParseTuple(args,"i",&x);
>
> and args is (0x80000000,), what will be the value of x?
>
> > BTW, this reminds me that I've long promised a set of new format codes
> > for PyArg_ParseTuple() to specify taking the lower N bits (for N in
> > 8, 16, 32, 64) and throwing the rest away, without range checks.
>
> Wouldn't Mark have to use these format codes?
That's what I meant.
--Guido van Rossum (home page: http://www.python.org/~guido/)