We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In the current API, we define functions with arguments without forcing those arguments to be keyword arguments.
This is fine as long as we don't introduce new fields in the middle of the argument list.
For example:
def get_list( name=None, architecture=None, page=None, per_page=None, ): pass get_list(name, architecture, 2, 100)
If we add an extra field, we want to keep the organization logic and put the argument before the pagination argument:
def get_list( name=None, architecture=None, + some_field=None, page=None, per_page=None, ): pass
But the above would introduce a breaking change for the function call we previously defined:
get_list(name, architecture, 2, 100) # some_field=2, page=100
Describe the solution you'd like
In Python, we can set at which point in the argument list, the argument MUST be keyword arguments:
def get_list( name=None, *, architecture=None, page=None, per_page=None, ): pass
This will force the users to use kwargs like the following:
get_list(name, architecture=architecture, page=2, per_page=100)
Using this will allow us adding fields without risk of breaking someone's code.
This is breaking change, this can only happen in v2.0.0.
The text was updated successfully, but these errors were encountered:
This issue has been marked as stale because it has not had recent activity. The bot will close the issue if no further action occurs.
Sorry, something went wrong.
datacenter
No branches or pull requests
Feature Request
In the current API, we define functions with arguments without forcing those arguments to be keyword arguments.
This is fine as long as we don't introduce new fields in the middle of the argument list.
For example:
If we add an extra field, we want to keep the organization logic and put the argument before the pagination argument:
def get_list( name=None, architecture=None, + some_field=None, page=None, per_page=None, ): pass
But the above would introduce a breaking change for the function call we previously defined:
Describe the solution you'd like
In Python, we can set at which point in the argument list, the argument MUST be keyword arguments:
This will force the users to use kwargs like the following:
Using this will allow us adding fields without risk of breaking someone's code.
This is breaking change, this can only happen in v2.0.0.
The text was updated successfully, but these errors were encountered: