On Wed, Feb 20, 2019 at 11:03 AM Rhodri James <rho...@kynesim.co.uk> wrote:
> On 20/02/2019 18:24, Bruce Leban wrote: > > a = [1,2,3] > > ( _:= a ,_ .append(4) ,_ .sort() ) > > I'm not sure what problem you are solving here, but if that's the > solution I'd rather have the problem. There is absolutely nothing in > that syntax that suggests what's going on. > > Given the responses, I think I was a bug more obtuse than necessary. My apologies. This is already in Python 3.8. I am NOT actually suggesting a change to the language. I'm showing how to "solve" the "problem" of wanting to write chained method calls on a single line. I agree the solution is unreadable and worse than the problem. Any other proposed solution is merely bikeshedding the syntax and I think suffers from the same non-readability problem. For example these are essentially the same: _:= a ,_. append(4) ,_. sort() a :: append(4) :: sort() --- Bruce
_______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/