March 2003
Intermediate to advanced
656 pages
39h 30m
English
PySequence_Fast
PyObject* PySequence_Fast(PyObject* x)
Returns a new reference to a tuple with the
same items as x, unless
x is a list, in which case returns a new
reference to x. When you need to get many
items of an arbitrary sequence x,
it’s fastest to call
t
=PySequence_Fast(
x
)
once, then call
PySequence_Fast_GET_ITEM(
t,i
)
as many times as needed, and finally call
Py_DECREF(
t
).
Read now
Unlock full access