Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Lib/test/test_doctest.py
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ def non_Python_modules(): r"""
True
>>> real_tests = [t for t in tests if len(t.examples) > 0]
>>> len(real_tests) # objects that actually have doctests
12
13
>>> for t in real_tests:
... print('{} {}'.format(len(t.examples), t.name))
...
Expand All @@ -685,6 +685,7 @@ def non_Python_modules(): r"""
2 builtins.int.bit_length
5 builtins.memoryview.hex
1 builtins.oct
1 builtins.zip

Note here that 'bin', 'oct', and 'hex' are functions; 'float.as_integer_ratio',
'float.hex', and 'int.bit_length' are methods; 'float.fromhex' is a classmethod,
Expand Down
13 changes: 8 additions & 5 deletions Python/bltinmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -2649,12 +2649,15 @@ static PyMethodDef zip_methods[] = {
};

PyDoc_STRVAR(zip_doc,
"zip(*iterables) --> zip object\n\
"zip(*iterables) --> A zip object yielding tuples until an input is exhausted.\n\
\n\
Return a zip object whose .__next__() method returns a tuple where\n\
the i-th element comes from the i-th iterable argument. The .__next__()\n\
method continues until the shortest iterable in the argument sequence\n\
is exhausted and then it raises StopIteration.");
>>> list(zip('abcdefg', range(3), range(4)))\n\
[('a', 0, 0), ('b', 1, 1), ('c', 2, 2)]\n\
\n\
The zip object yields n-length tuples, where n is the number of iterables\n\
passed as positional arguments to zip(). The i-th element in every tuple\n\
comes from the i-th iterable argument to zip(). This continues until the\n\
shortest argument is exhausted.");

PyTypeObject PyZip_Type = {
PyVarObject_HEAD_INIT(&PyType_Type, 0)
Expand Down