3 ms·
> y <- f(x) > z <- g(y) > w <- h(z) So you would basically want "<-" instead of "yield from"? Or is there something additional I'm missing? My main thing
by jonesetc 11y ago
> y <- f(x)
> z <- g(y)
> w <- h(z)
So you would basically want "<-" instead of "yield from"? Or is there something additional I'm missing? My main thing against this, is that it's very opposed with general Python principles. Think "||" vs "or", "&&" vs "and", and "test ? value : alternate" vs "value if test else alternate".
- nostrademons 11y agoYeah, it's just syntactic sugar. "<-" is chosen to match roughly-equivalent constructs in other languages, like Erlang, Go, or CSP. The reasoning behind it is that 'yield' is common enough to warrant special syntactic sugar - there are other precedents, like allowing dict['value'] instead of getitem(dict, value) or the @ matrix multiplication operator that was just added in Python 3.5.