Skip to content

fix weeks property getter and add some tests#460

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

fix weeks property getter and add some tests#460
pganssle merged 3 commits into
dateutil:masterfrom
souliane:master

Conversation

@souliane

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.

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