No subject
Tue Oct 14 00:29:20 CEST 2008
PyObject* PySequence_Fast (PyObject *o, const char *m)
Return value: New reference.
Returns the sequence o as a tuple, unless it is already a tuple or list, in
which case o is returned. Use PySequence_Fast_GET_ITEM() to access the members
of the result. Returns NULL on failure. If the object is not a sequence, raises
TypeError with m as the message text.
This implies to me that it will work for any sequence, and a quick test just
convinced me that PySequence_Fast() works with o = xrange(n), even if traversed
twice. See:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/cctbx/cctbx/misc/Attic/container_from_list_or_tuple.py?rev=1.1.2.2&only_with_tag=boost_python_v2_transition&content-type=text/vnd.viewcvs-markup
Ralf
__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com
More information about the Cplusplus-sig
mailing list