[Python-ideas] A more readable way to nest functions
David Mertz
mertz at gnosis.cx
Mon Jan 30 15:25:54 EST 2017
On Mon, Jan 30, 2017 at 11:52 AM, Mikhail V <mikhailwas at 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) )
--
Keeping medicines from the bloodstreams of the sick; food
from the bellies of the hungry; books from the hands of the
uneducated; technology from the underdeveloped; and putting
advocates of freedom in prisons. Intellectual property is
to the 21st century what the slave trade was to the 16th.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20170130/8a924e28/attachment-0001.html>
More information about the Python-ideas
mailing list