]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-134789: Document del s[i] operation for mutable sequences (#134804)
authorRishabh Singh <67859818+rishabh11336@users.noreply.github.com>
Tue, 27 May 2025 18:48:04 +0000 (00:18 +0530)
committerGitHub <noreply@github.com>
Tue, 27 May 2025 18:48:04 +0000 (14:48 -0400)
[main] Update stdtypes.rst

- Added explicit mention of `del s[i]` (item deletion by index) to the Mutable Sequence Types section.
- Clarified that this operation removes the item at the specified index from the sequence.
- Addresses issue #134789.

Doc/library/stdtypes.rst

index 31d71031bca12c8157e3c2bf098ff3db36a5c807..f0b4b09ff10dcec54f5ca56de6a726716013f9a5 100644 (file)
@@ -1214,6 +1214,8 @@ accepts integers that meet the value restriction ``0 <= x <= 255``).
 | ``s[i] = x``                 | item *i* of *s* is replaced by |                     |
 |                              | *x*                            |                     |
 +------------------------------+--------------------------------+---------------------+
+| ``del s[i]``                 | removes item *i* of *s*        |                     |
++------------------------------+--------------------------------+---------------------+
 | ``s[i:j] = t``               | slice of *s* from *i* to *j*   |                     |
 |                              | is replaced by the contents of |                     |
 |                              | the iterable *t*               |                     |