[Python-bugs-list] [ python-Bugs-595026 ] Support for masks in getargs.c

noreply@sourceforge.net noreply@sourceforge.net
Wed, 14 Aug 2002 05:26:55 -0700


Bugs item #595026, was opened at 2002-08-14 08:26
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=595026&group_id=5470

Category: Python Interpreter Core
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Guido van Rossum (gvanrossum)
Assigned to: Guido van Rossum (gvanrossum)
Summary: Support for masks in getargs.c

Initial Comment:
We need this implemented:

> How about the following counterproposal.  This also
changes some of
> the other format codes to be a little more regular.
>
> Code    C type          	Range check
>
> b	unsigned char		0..UCHAR_MAX
> B	unsigned char		none **
> h	unsigned short		0..USHRT_MAX
> H	unsigned short		none **
> i	int
		INT_MIN..INT_MAX
> I *	unsigned int		0..UINT_MAX
> l	long
		LONG_MIN..LONG_MAX
> k *	unsigned long		none
> L	long long		LLONG_MIN..LLONG_MAX
> K *	unsigned long long	none
>
> Notes:
>
> * New format codes.
>
> ** Changed from previous "range-and-a-half" to
"none"; the
>    range-and-a-half checking wasn't particularly useful.

Plus a C API or two, e.g. PyInt_AsLongMask() ->
unsigned long and PyInt_AsLongLongMask() -> unsigned
long long (if that exists).

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=595026&group_id=5470