Skip to content

Commit 9f2dcd2

Browse files
committed
Issue python#19362: Tweek len() doc and docstring to expand the indicated range of
arguments. Original patch by Gareth Rees.
1 parent 357d312 commit 9f2dcd2

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

‎Doc/library/functions.rst‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,8 @@ available. They are listed here in alphabetical order.
726726
.. function:: len(s)
727727

728728
Return the length (the number of items) of an object. The argument may be a
729-
sequence (string, tuple or list) or a mapping (dictionary).
729+
sequence (such as a string, bytes, tuple, list, or range) or a collection
730+
(such as a dictionary, set, or frozen set).
730731

731732

732733
.. function:: list([iterable])

‎Python/bltinmodule.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1323,7 +1323,7 @@ builtin_len(PyObject *self, PyObject *v)
13231323
PyDoc_STRVAR(len_doc,
13241324
"len(object) -> integer\n\
13251325
\n\
1326-
Return the number of items of a sequence or mapping.");
1326+
Return the number of items of a sequence or collection.");
13271327

13281328

13291329
static PyObject *

0 commit comments

Comments
 (0)