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

fix weeks property getter and add some tests by souliane · Pull Request #460 · dateutil/dateutil · GitHub

fix weeks property getter and add some tests - #460

Merged
pganssle merged 3 commits into
dateutil:masterfrom
souliane:master
Sep 14, 2017
Merged

pganssle merged 3 commits into
dateutil:masterfrom
souliane:master

Conversation

Copy link
Copy Markdown

fix for #459

Comment thread dateutil/relativedelta.py Outdated
@property
def weeks(self):
return self.days // 7
weeks = abs(self.days) // 7

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I think replace this with return int(weeks/7.0), that will give the right zero-symmetrical floor-div behavior without the if statement.

pganssle merged commit 9e03166 into dateutil:master Sep 14, 2017
pganssle added this to the 2.7.0 milestone Sep 17, 2017
pganssle mentioned this pull request Mar 11, 2018
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL