On 19.06.2021 17:17, Serhiy Storchaka wrote: > 19.06.21 18:12, Marc-Andre Lemburg пише: >>> But there could be endless debate about whether flatten( ("x", "y") ) should >>> return a list or a tuple... >> >> Have it return an iterator :-) > > flatten = itertools.chain.from_iterable
Well, like I said: modulo the discussion around what "flatten" should mean, e.g. you will probably want to have flatten() go a certain number of levels deep and not necessarily flatten strings. But yes, such a definition is certainly a good start. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Experts (#1, Jun 19 2021) >>> Python Projects, Coaching and Support ... https://www.egenix.com/ >>> Python Product Development ... https://consulting.egenix.com/ ________________________________________________________________________ ::: We implement business ideas - efficiently in both time and costs ::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 https://www.egenix.com/company/contact/ https://www.malemburg.com/ _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/5C2JB3QU7E4S5MMRI7NCRSZ52MFKZCC5/ Code of Conduct: http://python.org/psf/codeofconduct/