Skip to content

Breaking changes due to param ordering #142

Open

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

Activity

  1. github-actions commented on Jul 31, 2024

    @github-actions

    PETOSS-496

  2. github-actions commented on Jul 31, 2024

    @github-actions

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

  3. j-osephlong commented on Nov 18, 2024

    @j-osephlong

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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