I thought I had sent a response to this a few hours ago, but it seems to 
have been eaten by the email gremlins.

Apologies if this ends up as a duplicate.

On Fri, Apr 30, 2021 at 12:03:15PM -0400, David Álvarez Lombardi wrote:
> I propose a syntax for constructing/filtering strings analogous to the one
> available for all other builtin iterables.

*All* others?

The builtin interables bytearray, bytes, enumerate, filter frozenset, 
map, memoryview, range, reversed, tuple and zip suggest differently.

It isn't that str is the exceptional case, it is that dict, list and set 
are the exceptional cases. In fact, there is a sense that this is a 
historical accident, that list comprehensions happened to have been 
invented first. If we were re-designing Python from scratch today, it is 
quite likely that we would have only generator comprehensions:

    list(expression for x in iterable)
    set(expression for x in iterable)
    dict((key, value) for x in iterable)


-- 
Steve
_______________________________________________
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/2STIOCYZQ6DAOAQTEJJ5N3KRJFANKMBP/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to