diff options
author | Raymond Hettinger <python@rcn.com> | 2008-07-11 12:00:21 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2008-07-11 12:00:21 (GMT) |
commit | 8dbbb96929b6e8775d8b5d873dde48376410d274 (patch) | |
tree | 125bad576de4413e9e51fe22e353f0da66680f8b /Doc/c-api | |
parent | feef51d988819bde89e728f43528b0d84bd289bd (diff) | |
download | cpython-8dbbb96929b6e8775d8b5d873dde48376410d274.zip cpython-8dbbb96929b6e8775d8b5d873dde48376410d274.tar.gz cpython-8dbbb96929b6e8775d8b5d873dde48376410d274.tar.bz2 |
Add cautionary note on the use of PySequence_Fast_ITEMS.
Diffstat (limited to 'Doc/c-api')
-rw-r--r-- | Doc/c-api/sequence.rst | 4 |
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 |