Extra parentheses are not hard to type but this notation is much better readable.

On Mon, Mar 28, 2022 at 11:06 PM Patrick Reader <python-ideas@pxeger.com> wrote:
(I originally wrote this in bpo47147, but apparently because it has to
go through python-ideas first?)

I would like to be able to use a `yield from` expression in a `return`
statement without parentheses, as a small quality of life tweak, i.e.:

return yield from gen

instead of

return (yield from gen)

I think this makes sense, since `yield from` can be used on the
right-hand-side of an assignment, which accepts any expression, and so
should `return`.

Here is a medium-sized real-world example of where I'm using this, where
it would be nice to allow `return yield

Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-leave@python.org
Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/L6XRQ5YWAE535JGZH2MF2TD32C65K5ZI/
Code of Conduct: http://python.org/psf/codeofconduct/

Andrew Svetlov