[C++-sig] tuple, list, dict, et. al

Ralf W. Grosse-Kunstleve rwgk at yahoo.com
Wed Jun 26 18:40:17 CEST 2002


--- David Abrahams <david.abrahams at rcn.com> wrote:
> Answer 1:
> 
>     The function only matches if the actual argument is a Python
>     tuple or a subclass of tuple
> 
> Answer 2:
> 
>     The function matches if the actual argument is any Python sequence;
>     tuple(arg) will be applied to retrieve the tuple object used inside
>     the wrapped function

And here is the third opinion: give the user a choice. If you want a tuple and
only a tuple, the user specifies boost::python::tuple as the argument. If any
sequence is acceptable, boost::python::sequence_fast, which is a wrapper around
the PySequence_Fast family of Python API functions (just like the one in the
bpl_utils that I posted before).

Ralf


__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com





More information about the Cplusplus-sig mailing list