New submission from Patrick Reader <pxe...@protonmail.com>:

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 from`: 
https://gist.github.com/pxeger/48f97484364bf0b43dee974a8f0f4265

----------
components: Parser
messages: 416198
nosy: lys.nikolaou, pablogsal, pxeger
priority: normal
severity: normal
status: open
title: Allow `return yield from`
type: enhancement

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue47147>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to