Issue 12490: Documentation for itertools.chain.from_iterable is incorrect (original) (raw)

Issue12490

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:19 admin set github: 56699
2011-07-04 20:48:37 RodolphoEckhardt set nosy: - docs@pythonresolution: not a bug
2011-07-04 20:48:11 RodolphoEckhardt set status: open -> closedmessages: +
2011-07-04 20:42:12 RodolphoEckhardt create