Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(45)

Side by Side Diff: Doc/library/functions.rst

Issue 19362: Documentation for len() fails to mention that it works on sets
Patch Set: Created 6 years, 2 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | Python/bltinmodule.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 .. XXX document all delegations to __special__ methods 1 .. XXX document all delegations to __special__ methods
2 .. _built-in-funcs: 2 .. _built-in-funcs:
3 3
4 Built-in Functions 4 Built-in Functions
5 ================== 5 ==================
6 6
7 The Python interpreter has a number of functions and types built into it that 7 The Python interpreter has a number of functions and types built into it that
8 are always available. They are listed here in alphabetical order. 8 are always available. They are listed here in alphabetical order.
9 9
10 =================== ================= ================== ================ == ================== 10 =================== ================= ================== ================ == ==================
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after
720 until the :meth:`~io.TextIOBase.readline` method returns an empty string:: 720 until the :meth:`~io.TextIOBase.readline` method returns an empty string::
721 721
722 with open('mydata.txt') as fp: 722 with open('mydata.txt') as fp:
723 for line in iter(fp.readline, ''): 723 for line in iter(fp.readline, ''):
724 process_line(line) 724 process_line(line)
725 725
726 726
727 .. function:: len(s) 727 .. function:: len(s)
728 728
729 Return the length (the number of items) of an object. The argument may be a 729 Return the length (the number of items) of an object. The argument may be a
730 sequence (string, tuple or list) or a mapping (dictionary). 730 sequence (string, tuple or list), a mapping (dictionary), or a set.
731 731
732 732
733 .. _func-list: 733 .. _func-list:
734 .. function:: list([iterable]) 734 .. function:: list([iterable])
735 :noindex: 735 :noindex:
736 736
737 Rather than being a function, :class:`list` is actually a mutable 737 Rather than being a function, :class:`list` is actually a mutable
738 sequence type, as documented in :ref:`typesseq-list` and :ref:`typesseq`. 738 sequence type, as documented in :ref:`typesseq-list` and :ref:`typesseq`.
739 739
740 740
(...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after
1527 .. versionchanged:: 3.3 1527 .. versionchanged:: 3.3
1528 Negative values for *level* are no longer supported (which also changes 1528 Negative values for *level* are no longer supported (which also changes
1529 the default value to 0). 1529 the default value to 0).
1530 1530
1531 1531
1532 .. rubric:: Footnotes 1532 .. rubric:: Footnotes
1533 1533
1534 .. [#] Note that the parser only accepts the Unix-style end of line convention. 1534 .. [#] Note that the parser only accepts the Unix-style end of line convention.
1535 If you are reading the code from a file, make sure to use newline conversion 1535 If you are reading the code from a file, make sure to use newline conversion
1536 mode to convert Windows or Mac-style newlines. 1536 mode to convert Windows or Mac-style newlines.
OLDNEW
« no previous file with comments | « no previous file | Python/bltinmodule.c » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+