FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Reject bool for relativedelta/tzoffset/rrule integer args by Pitchfork-and-Torch · Pull Request #1572 · dateutil/dateutil · GitHub

Reject bool for relativedelta/tzoffset/rrule integer args - #1572

Open
Pitchfork-and-Torch wants to merge 1 commit into
dateutil:masterfrom
Pitchfork-and-Torch:cook/reject-bool-relativedelta-tzoffset-rrule
Open

Pitchfork-and-Torch wants to merge 1 commit into
dateutil:masterfrom
Pitchfork-and-Torch:cook/reject-bool-relativedelta-tzoffset-rrule

Conversation

Copy link
Copy Markdown

Summary

bool is a subclass of int, so:

  • relativedelta(years=True) became +1 year (and absolute year=True set year to 1)
  • tzoffset(name, True) became a 1-second offset
  • rrule(..., count=True) / interval=True silently became 1

Raise TypeError for bool on these numeric parameters.

Test plan

  • Added tests/test_bool_rejects.py covering relativedelta, tzoffset, and rrule
  • Int values still accepted

bool is a subclass of int, so relativedelta(years=True) became +1 year,
tzoffset(name, True) became a 1-second offset, and rrule(count=True)
became count=1. Raise TypeError for bool on these numeric parameters.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL