[ python-Feature Requests-1075902 ] ignore element format character for PyArg_ParseTuple

SourceForge.net noreply at sourceforge.net
Thu Dec 9 06:04:38 CET 2004


Feature Requests item #1075902, was opened at 2004-11-30 05:28
Message generated for change (Comment added) made by tim_one
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1075902&group_id=5470

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Sean Proctor (sproctor)
Assigned to: Nobody/Anonymous (nobody)
Summary: ignore element format character for PyArg_ParseTuple

Initial Comment:
Some kind of option to indicate there is an element,
but we don't care about its value would be nice. It
could be _. then an example would be:
PyArg_ParseTuple (tuple, "_i", &my_int);

This indicates that there is another value before the
int, but we don't care about it one way or the other.

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

>Comment By: Tim Peters (tim_one)
Date: 2004-12-09 00:04

Message:
Logged In: YES 
user_id=31435

If you want to make C code look like ML, declare

PyObject** _;

and use _ in the argument list.

I'm -1 on this:  the case has almost never arisen in my 
experience, and the limited pool of format characters should 
be preserved for high-value uses.

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

Comment By: Sean Proctor (sproctor)
Date: 2004-12-08 22:35

Message:
Logged In: YES 
user_id=43755

If I use O, then I need to have a variable to store it in. I
think it's less readable. Like with pattern matching in ML,
you can use a variable instead of _, but it's not obvious
that you aren't going to use that value. With some kind of
place holder, this is made clear, and I don't need to create
a variable to store a value that I don't care about.

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

Comment By: Martin v. Löwis (loewis)
Date: 2004-12-08 16:42

Message:
Logged In: YES 
user_id=21627

What's wrong with using O as the format character?

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

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


More information about the Python-bugs-list mailing list