xero-python icon indicating copy to clipboard operation
xero-python copied to clipboard

Breaking changes due to param ordering

Open jarekwg opened this issue 1 year ago • 3 comments

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 25a6d3eb2e03a6205de966336e51ac44a7bcfc88: 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):

jarekwg avatar Jul 31 '24 07:07 jarekwg

PETOSS-496

github-actions[bot] avatar Jul 31 '24 07:07 github-actions[bot]

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

github-actions[bot] avatar Jul 31 '24 07:07 github-actions[bot]

This happened to me, took a while to figure it out.

j-osephlong avatar Nov 18 '24 19:11 j-osephlong