[Python-ideas] Fwd: New suggested built in keyword: do

Michael Selik mike at selik.org
Sat Jun 9 02:27:08 EDT 2018

The benefit of list, dict, and set comprehensions and generator expressions 
is that they evaluate, as opposed to simply exec. The purpose of making 
them one-liners is to allow them to be assigned to a variable or passed as 
an argument.

If you're not assigning or passing, then why not use a newline character? 
"Sparse is better than dense."

On Friday, June 8, 2018 at 7:13:07 AM UTC-7, Randy Diaz wrote:
> I think that the keyword do would solve problems that occur when people 
> want a simple way to run a command over an iterable but they dont want to 
> store the data.
> example:
> do print(x) for x in range(50)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20180608/be867c0d/attachment.html>

More information about the Python-ideas mailing list