[Python-ideas] A more readable way to nest functions
Brent Brinkley
brentbrinkley at gmail.com
Fri Jan 27 16:07:27 EST 2017
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20170127/10707862/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/10707862/attachment-0002.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/10707862/attachment-0003.png>
More information about the Python-ideas
mailing list