homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Documentation for itertools.chain.from_iterable is incorrect
Type: Stage:
Components: Documentation Versions: Python 3.2, Python 2.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: docs@python Nosy List: RodolphoEckhardt
Priority: normal Keywords:

Created on 2011年07月04日 20:42 by RodolphoEckhardt, last changed 2022年04月11日 14:57 by admin. This issue is now closed.

Messages (2)
msg139802 - (view) Author: Rodolpho Eckhardt (RodolphoEckhardt) Date: 2011年07月04日 20:42
The documentation at http://docs.python.org/py3k/library/itertools.html#itertools.chain and http://docs.python.org/library/itertools.html#itertools.chain is inconsistent.
At the definition of the class it states that itertools.chain.from_iterable can receive one iterable "Gets chained inputs from a single iterable argument that is evaluated lazily.", but then it contradicts itself by using the following example:
@classmethod
def from_iterable(iterables):
 # chain.from_iterable(['ABC', 'DEF']) --> A B C D E F
 for it in iterables:
 for element in it:
 yield element
This example could lead the reader to believe this alternative constructor can receive multiple iterable objects, when in fact it can receive only one.
msg139804 - (view) Author: Rodolpho Eckhardt (RodolphoEckhardt) Date: 2011年07月04日 20:48
My mistake reading the documentation.
Sorry, closing this issue.
History
Date User Action Args
2022年04月11日 14:57:19adminsetgithub: 56699
2011年07月04日 20:48:37RodolphoEckhardtsetnosy: - docs@python
resolution: not a bug
2011年07月04日 20:48:11RodolphoEckhardtsetstatus: open -> closed

messages: + msg139804
2011年07月04日 20:42:12RodolphoEckhardtcreate

AltStyle によって変換されたページ (->オリジナル) /