On Sun, May 24, 2020, 5:11 PM Alex Hall > But when you *read* a call to filter(), it's generally pretty obvious > which argument is which, even if you don't remember the signature. You just > need to see which one's callable or which one's iterable (few things are > both). You can probably guess just from the variable names. If you read `f@g`, > you can only guess if one of `f(g(x))` or `g(f(x))` is nonsense, which I > think is typically less obvious. >
I definitely agree. My way of remembering which way filter goes was to try the wrong one in a shell and get an exception. In contrast, quite likely both f(g(h(x))) and h(g(f(x))) produce a value, but only one is the one I want. If x is string, or a list, or a number, or a NumPy array, most functions I'd call return something of the same type. Mutations are usually not order independent.
_______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/JKW6HJPPIUSS4IHBTWUGLL4HMMFLOM6T/ Code of Conduct: http://python.org/psf/codeofconduct/