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 timedelta specifications in add_timeout #329

Closed
wants to merge 1 commit into from

Conversation

rbu
Copy link
Contributor

@rbu rbu commented Aug 4, 2011

The timedelta API makes this easier to use (and test).

@bdarnell
Copy link
Member

bdarnell commented Aug 6, 2011

Good idea. I had thought about doing something like this if the number passed in was in the distant past, but it always felt ugly to have some magic number at which everything changed. Using timedelta objects makes it unambiguous. I've committed a slightly different version of this to use the total_seconds() method instead of converting it to seconds by hand. I also considered adding support for datetime objects for completeness, but converting datetime to timestamps is a pain so I'm leaving it out for now.

@bdarnell bdarnell closed this in 688d59d Aug 6, 2011
@rbu
Copy link
Contributor Author

rbu commented Aug 22, 2011

total_seconds was introduced in Python 2.7, is this version limitation intented?
http://docs.python.org/library/datetime.html#datetime.timedelta.total_seconds

@bdarnell
Copy link
Member

No, it's not intentional. I'll change it to compute the total manually.

@rbu
Copy link
Contributor Author

rbu commented Aug 25, 2011

Just for reference, this was fixed in 6b7ddc9

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.

2 participants