Skip to content

Breaking changes due to param ordering #142

@jarekwg

Description

@jarekwg

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions