[Python-ideas] Another attempt at a sum() alternative: the concatenation protocol
David Mertz
mertz at gnosis.cx
Tue Jul 16 19:48:48 CEST 2013
On Tue, Jul 16, 2013 at 10:34 AM, Serhiy Storchaka <storchaka at gmail.com>wrote:
> 16.07.13 16:01, Nick Coghlan написав(ла):
>
> In effect, PEP 448 goes further than making chain a builtin: it gives
>> it syntax! With PEP 448, the generator expression:
>>
>> (*itr for itr in iterables)
>>
>> would be equivalent to either of the current:
>>
>> itertools.chain(*iterables)
>> itertools.chain.from_iterable(**iterables)
>>
>
> This looks as an argument against PEP 448. Why we need a new syntax if we
> can do this just with existent function?
PEP 448 would make a bunch of other contexts work differently too, and
arguably improved. It's just an edge-case side-effect that it gives us
syntax for a function in itertools in the process. The large majority of
what PEP 448 would change has no relation to itertools.chain.
--
Keeping medicines from the bloodstreams of the sick; food
from the bellies of the hungry; books from the hands of the
uneducated; technology from the underdeveloped; and putting
advocates of freedom in prisons. Intellectual property is
to the 21st century what the slave trade was to the 16th.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130716/2ff14db6/attachment.html>
More information about the Python-ideas
mailing list