On 30 January 2017 at 21:25, David Mertz <me...@gnosis.cx> wrote:
> On Mon, Jan 30, 2017 at 11:52 AM, Mikhail V <mikhail...@gmail.com> wrote: > >> *Theoretically* I see a solution by 'inlined' statements. >> Take a long example: >> >> print ( merge (a, b, merge ( long_variable2, long_variable2 ) ) >> >> Now just split it in 2 lines: >> >> tmp <> merge ( long_variable2, long_variable2 ) >> print ( merge (a, b, tmp ) ) >> >> So I'd for example invent a special sign which just marks >> statements that will be first collected as inline text, sort of macros. >> > > I have a great idea for this special sign. We could use the equal sign > '=' for this purpose of assigning a value into a temporary name. :-) > > tmp = merge(long_variable2, long_variable2) > print (merge(a, b, tmp) ) > > > Great idea :) But actually that was my idea initially, so just breaking it into two lines solves the readability issue perfectly with long expressions. Although if one is chasing some kind of optimisations... I don't know, I see very often people want to stick everything in one big expression.
_______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/