
June 7, 2022
10:59 p.m.
On Wed, 8 Jun 2022 at 00:36, <martineznicolas41541@gmail.com> wrote:
Hello!
Do you know if there has been discussions around why is the default argument is positional only in the dict methods get and pop?
I think
``` d.get(key, default=3) ```
way more readable than
``` d.get(key, 3) ```
specially since max and min builtin functions use default as a keyword argument.
With min and max, it MUST be a keyword argument, because positional arguments are the values to be compared. So I think the main reason is "because nobody ever bothered to do it". If there's enough value in it, that could probably be changed, although mere consistency alone isn't a very strong argument. ChrisA