summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2008-07-11 12:00:21 (GMT)
committerRaymond Hettinger <python@rcn.com>2008-07-11 12:00:21 (GMT)
commit8dbbb96929b6e8775d8b5d873dde48376410d274 (patch)
tree125bad576de4413e9e51fe22e353f0da66680f8b
parentfeef51d988819bde89e728f43528b0d84bd289bd (diff)
downloadcpython-8dbbb96929b6e8775d8b5d873dde48376410d274.zip
cpython-8dbbb96929b6e8775d8b5d873dde48376410d274.tar.gz
cpython-8dbbb96929b6e8775d8b5d873dde48376410d274.tar.bz2
Add cautionary note on the use of PySequence_Fast_ITEMS.
-rw-r--r--Doc/c-api/sequence.rst4
1 files changed, 4 insertions, 0 deletions
diff --git a/Doc/c-api/sequence.rst b/Doc/c-api/sequence.rst
index 359bf6d..e16c2e3 100644
--- a/Doc/c-api/sequence.rst
+++ b/Doc/c-api/sequence.rst
@@ -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