Skip to content
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

Allow durations to be divided by other durations #48

Merged
merged 1 commit into from
Apr 18, 2016

Conversation

eric-wieser
Copy link
Contributor

For instance Duration(secs=10) / Duration(secs=5) == 2

@dirk-thomas
Copy link
Member

Please update the docblocks to clarify that duration arguments are also supported.

@@ -398,6 +398,8 @@ def __floordiv__(self, val):
return Duration(self.secs // val, self.nsecs // val)
elif t == float:
return Duration.from_sec(self.to_sec() // val)
elif isinstance(val, Duration):
return self.to_sec() // val.to_sec()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note that unlike everything else mentioned in #49, Duration // Duration is meaningful

@eric-wieser
Copy link
Contributor Author

Docblocks are done - would you prefer I squash this?

@dirk-thomas
Copy link
Member

Yes, please squash.

For instance `Duration(secs=10) / Duration(secs=5) == 2`

Update docstrings
@eric-wieser
Copy link
Contributor Author

(squashed)

@eric-wieser
Copy link
Contributor Author

ICYMI, github now can squash PRs when merging

@dirk-thomas
Copy link
Member

Thanks.

@dirk-thomas dirk-thomas merged commit 1988d18 into ros:indigo-devel Apr 18, 2016
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.

None yet

2 participants