[Python-ideas] Dollar operator suggestion
Yan Pas
yanp.bugz at gmail.com
Thu Oct 26 07:06:45 EDT 2017
More information about the Python-ideas mailing list
Thu Oct 26 07:06:45 EDT 2017
- Previous message (by thread): [Python-ideas] Membership of infinite iterators
- Next message (by thread): [Python-ideas] Dollar operator suggestion
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I've looked up this feature in haskell. Dollar sign operator is used to avoid parentheses. Rationalle: Python tends to use functions instead of methods ( e.g. len([1,2,3]) instead of [1,2,3].len() ). Sometimes the expression inside parentheses may become big and using a lot of parentheses may tend to bad readability. I suggest the following syntax: len $ [1,2,3] Functions map be also chained: len $ list $ map(...) This operator may be used for function composition too: foo = len $ set $ in the same as foo = lambda *as,**kas : len(set(*as, **kas)) in current syntax Regards, Yan -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-ideas/attachments/20171026/748540eb/attachment.html>
- Previous message (by thread): [Python-ideas] Membership of infinite iterators
- Next message (by thread): [Python-ideas] Dollar operator suggestion
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-ideas mailing list