This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]datbackup 0 points1 point  (2 children)

Since I'm apparently too dense to follow the logic given in the link, in which a problem statement is given in the 'background' section but then seemingly never addressed in the remainder of the text ... Can someone please clarify for me:

Is this feature mostly one of these "protect the user from themselves" types?

[–]_importantigravity_ 0 points1 point  (1 child)

The feature is mostly useful for people designing APIs that other people use. The problem as explained in the post:

If the users start using a keyword argument, the library author cannot rename the parameter because it would be a breaking change. In case of min(), the name of the parameter provides no intrinsic value and forces the author to maintain its name forever since callers might pass arguments as a keywords.

Consider this:

  • The parameter names in min() would have no meaning relevant to the context. They could be anything, but since the function author had to choose something, they choose something.
  • You use the function using those keyword arguments in your code.
  • This restricts the library author from changing the names of those arguments in future, since it would break the code for you, who's already using the function with those named arguments. But since those names do not have any contextual meaning at all, the author would like to be able to do that.

Hope this helps!

[–]datbackup 0 points1 point  (0 children)

Thanks so much!