Skip to content

Use setdefault on kwds to standardize behavior #17443

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

Closed
wants to merge 1 commit into from

Conversation

jbrockmendel
Copy link
Member

DateOffset.kwds does not behave consistently, see brief discussion here.

This PR changes kwds.get(name, default) to kwds.setdefault(name, default) in each of the __init__ methods in tseries.offsets. This ensures that explicitly passing the default value gives the same result as not using the kwarg.

This also edits Tick.__ne__ and Tick.__eq__ to skip calling DateOffset.__ne__ and DateOffset.__eq__, respectively, since these will always return True and False, respectively. I make no claims as to the performance implications, but if a reader wanted to make an inference...

  • closes #xxxx
  • tests added / passed
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry

@jbrockmendel
Copy link
Member Author

Test errors suggest that this can't be papered over as easily as I had hoped. To fix this, I'll need the go-ahead to make some non-zero backwards-breaking changes. See #17176.

@jbrockmendel jbrockmendel deleted the offset_kwds branch September 7, 2017 04:07
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

Successfully merging this pull request may close these issues.

1 participant