> c"f(c) for c in some_string if g(c)"

Even this example would allow the interpreter to skip building the generator 
object and having to feed the result of every f(c) back into the iterator 
protocol. This is similar to f-strings vs str.format. You could say that 
f-strings are redundant because they can't do anything that str.format can't, 
but  they make it possible to shave off the static overhead of going through 
python's protocols and enable additional optimizations.
_______________________________________________
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/UPXU2CNCACBAO7EV4XI3MMKZDAFSHTAA/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to