[Python-ideas] Dollar operator suggestion
Rhodri James
rhodri at kynesim.co.uk
Thu Oct 26 07:47:44 EDT 2017
More information about the Python-ideas mailing list
Thu Oct 26 07:47:44 EDT 2017
- Previous message (by thread): [Python-ideas] Dollar operator suggestion
- Next message (by thread): [Python-ideas] Dollar operator suggestion
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 26/10/17 12:06, Yan Pas wrote: > I've looked up this feature in haskell. Dollar sign operator is used to > avoid parentheses. If I understand your example correctly, it does no such thing. "A $ B" appears to mean "apply callable A to object B", at least the way you portray it below. I don't speak Haskell so I can't comment on the original. > 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. If you have that sort of legibility problem, it suggests that you are trying to do far too much on a single line. New syntax won't help with that (in fact it will make it worse IMHO). > I suggest the following syntax: > > len $ [1,2,3] How is this better or easier to read than "len([1,2,3])" ? What do you do for functions with two or more arguments? The obvious thing would be to make the right-hand side of the $ operator a tuple, and whoops, there are your parentheses again. I don't think this proposal achieves your aim, and I dislike it for a lot of other reasons. -- Rhodri James *-* Kynesim Ltd
- Previous message (by thread): [Python-ideas] Dollar operator suggestion
- Next message (by thread): [Python-ideas] Dollar operator suggestion
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-ideas mailing list