]> granicus.if.org Git - python/commitdiff
Add cautionary note on the use of PySequence_Fast_ITEMS.
authorRaymond Hettinger <python@rcn.com>
Fri, 11 Jul 2008 12:00:21 +0000 (12:00 +0000)
committerRaymond Hettinger <python@rcn.com>
Fri, 11 Jul 2008 12:00:21 +0000 (12:00 +0000)
Doc/c-api/sequence.rst

index 359bf6dbc70f8f84e6d0b65833a8d5daa6c2c821..e16c2e3a59f12e256396d2fc61b12220791200fb 100644 (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