Nevertheless, it's nice to see how powerful the new parser is! Any chance this would allow us to have a multi-line with statement?
with self.context_manager_one(some, parameters, that, are, passed) \ as return_value_one, \ self.context_manager_two(self.p, slice(None), None) \ as return_value_two: but with parentheses instead of backslash continuations? On Wednesday, June 10, 2020 at 12:55:01 PM UTC-4, Guido van Rossum wrote: > > On Tue, Jun 9, 2020 at 6:33 PM Greg Ewing <greg...@canterbury.ac.nz > <javascript:>> wrote: > >> Why is this being proposed? >> >> I think we would need a very strong reason to consider this, >> and so far I haven't seen any justification other than "because >> we can". >> > > There was definitely something of that... I was looking at the new PEG > parser and realized that *if people wanted it* this would be easy to do. So > I spent a pleasant hour or two coding it up to my satisfaction. > > But I was also trying to satisfy some demand. When Python 3 was young, > print becoming a function was one of the most frequent complaints, and > it's still occasionally seen on Twitter. I found at least two StackOverflow > issues about it, but the combined upvote count was less than 100. > > An early post in this thread reminded me that IPython has a feature called > "autocall" that allows exactly this syntax. I don't know how popular it is. > However, apparently there the form `f x+1` ends up calling `f("x+1")` (i.e. > stringifying the argument), so introducing similar syntax in Python with > different semantics would hardly be helpful. (If someone wants to start a > debate on argument quoting, please start a new thread, so we can lay this > one to rest.) > > All in all, it's clear that there's no future for this idea, and I will > happily withdraw it. > > -- > --Guido van Rossum (python.org/~guido) > *Pronouns: he/him **(why is my pronoun here?)* > <http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-world/> >
_______________________________________________ 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/GE2A256YFTMSSYOQLURCTKZZGL4ZQMG7/ Code of Conduct: http://python.org/psf/codeofconduct/