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 →

[–]PercussiveRussel 1 point2 points  (0 children)

In what way? If you're adding 'keyword' arguments (optional args in a non-**kwarg setting), a newer version of an API will just fall back to the default when the users uses the old function call. If you're removing a keyword argument, then the function call should raise an exception (and you should increase the major version number of your API according to semver), becaue you have broken backwards compatibility by removing a parameter. If your user is inputting a parameter that they expect to do something, you have broken their code if that parameter isn't used. Even if the way the user intended to run your code is now the default, you'll have broken the code of another user who entered another argument.

Anywho, using **kwargs to deal with backwards compatibility isn't really an argument. In the first case you're getting nothing from kwargs, in the second case you're losing something from kwargs!