cpython
cpython copied to clipboard
Clarify clamping specifications for `sequence.insert`
https://docs.python.org/3.14/library/array.html#array.array.insert
The documentation for array.array.insert(i, x) does not specify what happens
when i is greater than the length of the array.
for example :
import array
my_array = array.array("i", [1, 2, 3])
my_array.insert(10**9, 4)
print(my_array)
clarifying this behavior in the documentation improves consistency and removes ambiguity
Linked PRs
- gh-143422