My favorite example is: ','.join(['a', 'b'])
My favorite example is: ','.join(['a', 'b'])
> My favorite example is: ','.join(['a', 'b'])
I've always found the discrepancy between this example (instance method call), list(('a', 'b')) (technically a method call, but resembles a functional call), and str.lower('AB') (class method call) to be quite maddening.
* partial application is actually useful: I've actually used (','.join) before, but (lambda sep: sep.join(['a', 'b'])) seems relatively useless. That's why Haskell also uses this order with (intercalate sep listOfStrings).
* it accepts any iterable, rather than just lists.
I accept that you’ve identified some advantages of the Python version; it’s always possible to find cases where object.method() notation gets you something.
Well, 'hello'.join(', ') does not produce the same output as ', '.join('hello'), so the order of the arguments does matter.