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

bpo-35707: support __index__ and __float__ in time functions #11636

Open
wants to merge 2 commits into
base: master
from

Conversation

@jdemeyer
Copy link
Contributor

commented Jan 21, 2019

https://bugs.python.org/issue35707

Note that there is substantial code duplication in my patch, but that is only because the existing code already had substantial duplication. It would be possible to fix that, at the expense of a slightly more complicated (and therefore probably slightly slower) implementation.

@jdemeyer

This comment has been minimized.

Copy link
Contributor Author

commented Jan 25, 2019

@jdemeyer jdemeyer force-pushed the jdemeyer:time_float branch from ee7683d to 1ad2f3d Jan 29, 2019

@auvipy

auvipy approved these changes Jun 2, 2019

@jdemeyer

This comment has been minimized.

Copy link
Contributor Author

commented Jun 18, 2019

@pganssle pganssle self-requested a review Jun 18, 2019

Lib/test/test_time.py Outdated Show resolved Hide resolved
@jdemeyer

This comment has been minimized.

Copy link
Contributor Author

commented Jun 18, 2019

it would be much better if we could make an assertion about the duration of the sleep in the Decimal('0.99') case

Good point, we could check that it takes at least 0.9 seconds to execute that.

@jdemeyer

This comment has been minimized.

Copy link
Contributor Author

commented Jul 4, 2019

Admittedly time.sleep is quite hard to test, so maybe this is the best we can do

There are already various tests for sleep time, so I'll base myself on those.

@jdemeyer jdemeyer force-pushed the jdemeyer:time_float branch from 1ad2f3d to b84ba0e Jul 4, 2019

@jdemeyer jdemeyer requested a review from abalkin as a code owner Jul 4, 2019

@jdemeyer

This comment has been minimized.

Copy link
Contributor Author

commented Jul 4, 2019

This is a bugfix (this used to work correctly before bpo-22117, in particular on Python 2.7), so should be backported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.