Skip to content
New issue

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

Breaking changes due to param ordering #142

Open
jarekwg opened this issue Jul 31, 2024 · 2 comments
Open

Breaking changes due to param ordering #142

jarekwg opened this issue Jul 31, 2024 · 2 comments

Comments

@jarekwg
Copy link

jarekwg commented Jul 31, 2024

Changing ordering of signature params like this is a surefire recipe for disaster:
https://github.com/XeroAPI/xero-python/blame/master/xero_python/accounting/models/contacts.py#L36

Introduced in 25a6d3e:
image
Where Contacts([Contact(...)]) would before create a Contacts instance with a single Contact, it now assigns that list to pagination...

That's a breaking change that's hard for consumers to track.

Recommendation: disallow positional params, require kwargs only:

def __init__(self, pagination=None, contacts=None):

->

def __init__(self, *, pagination=None, contacts=None):
Copy link

PETOSS-496

Copy link

Thanks for raising an issue, a ticket has been created to track your request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant