Add cautionary note on the use of PySequence_Fast_ITEMS.

This commit is contained in:
Raymond Hettinger 2008-07-11 12:00:21 +00:00
parent feef51d988
commit 8dbbb96929
1 changed files with 4 additions and 0 deletions

View File

@ -143,6 +143,10 @@ Sequence Protocol
Return the underlying array of PyObject pointers. Assumes that *o* was returned
by :cfunc:`PySequence_Fast` and *o* is not *NULL*.
Note, if a list gets resized, the reallocation may relocate the items array.
So, only use the underlying array pointer in contexts where the sequence
cannot change.
.. versionadded:: 2.4