Skip to content

Commit baee4ba

Browse files
author
Krasnopoliskij.IA
committed
gh-131077: adding a description of the get method for lists to the documentation
1 parent eaa1e11 commit baee4ba

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Doc/library/stdtypes.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1258,6 +1258,14 @@ accepts integers that meet the value restriction ``0 <= x <= 255``).
12581258
| ``s.reverse()`` | reverses the items of *s* in | \(4) |
12591259
| | place | |
12601260
+------------------------------+--------------------------------+---------------------+
1261+
| ``s.get(i)`` or |Returns the value for the index | |
1262+
| ``s.get(i, x)`` |if the index is in the list, | |
1263+
| |otherwise the default value. If | |
1264+
| |no default value is set, the | |
1265+
| |default value is None, so this | |
1266+
| |method will never raise an | |
1267+
| |`IndexError`. | |
1268+
+------------------------------+--------------------------------+---------------------+
12611269

12621270

12631271
Notes:

0 commit comments

Comments
 (0)