[Python-ideas] A more readable way to nest functions
João Santos
jmcs at jsantos.eu
Fri Jan 27 16:19:34 EST 2017
Hi,
This would break apart as soon as one of left functions takes more than one
parameter.
Best regards,
João Santos
On Fri, 27 Jan 2017, 22:08 Brent Brinkley, <brentbrinkley at gmail.com> wrote:
> HI Everyone,
>
> I’m relatively new to the world of python but in my short time here I’ve
> fallen in love with how readable this language is. One issue that I’ve seen
> in a lot of languages struggle with is nested function calls. Parenthesis
> when nested inherently create readability issues. I stumbled upon what I
> believe is an elegant solution within the elm platform in their use of the
> backward pipe operator <|.
>
>
> Current Ex.
>
>
> Suggested Structure
>
> This aligns with the Zen of Python in the following ways
>
>
> - Simple is better than complex
> - Flat is better than nested
> - Sparse is better than dense
> - Readability counts
> - Practicality beats purity
>
>
> Ways it may conflict
>
>
> - Explicit is better than implicit
> - Special cases aren't special enough to break the rules
>
>
> Just curious to see what the rest of the community thinks 😊
>
> Best Regards,
>
> Brent
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20170127/4be33cc5/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2017-01-26 at 2.43.34 PM.png
Type: image/png
Size: 13716 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20170127/4be33cc5/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2017-01-26 at 12.36.26 PM.png
Type: image/png
Size: 14199 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20170127/4be33cc5/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2017-01-26 at 2.43.34 PM.png
Type: image/png
Size: 13716 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20170127/4be33cc5/attachment-0005.png>
More information about the Python-ideas
mailing list