[Python-checkins] r64871 - python/trunk/Doc/c-api/sequence.rst

raymond.hettinger python-checkins at python.org
Fri Jul 11 14:00:22 CEST 2008


Author: raymond.hettinger
Date: Fri Jul 11 14:00:21 2008
New Revision: 64871

Log:
Add cautionary note on the use of PySequence_Fast_ITEMS.

Modified:
   python/trunk/Doc/c-api/sequence.rst

Modified: python/trunk/Doc/c-api/sequence.rst
==============================================================================
--- python/trunk/Doc/c-api/sequence.rst	(original)
+++ python/trunk/Doc/c-api/sequence.rst	Fri Jul 11 14:00:21 2008
@@ -143,6 +143,10 @@
 
    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
 


More information about the Python-checkins mailing list