GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-79888: support __index__ and __float__ in time functions by jdemeyer · Pull Request #11636 · python/cpython

Conversation

@jdemeyer

@jdemeyer jdemeyer commented Jan 21, 2019 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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.

  • Issue: time.sleep() should support objects with __float__ #79888

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

slel reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Jan 21, 2019
@bedevere-bot bedevere-bot added the awaiting review label Jan 21, 2019
@jdemeyer
jdemeyer force-pushed the time_float branch from 4fc1a6d to ee7683d Compare January 21, 2019 13:54
@ned-deily ned-deily closed this Jan 24, 2019
@ned-deily ned-deily reopened this Jan 24, 2019
@jdemeyer

jdemeyer commented Jan 25, 2019

Copy link
Copy Markdown
Contributor Author

CC @abalkin as suggested by https://devguide.python.org/experts/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jdemeyer
jdemeyer force-pushed the time_float branch from ee7683d to 1ad2f3d Compare January 29, 2019 10:54
auvipy
auvipy approved these changes Jun 2, 2019
View reviewed changes
@bedevere-bot bedevere-bot added awaiting core review and removed awaiting review labels Jun 2, 2019
@jdemeyer jdemeyer mentioned this pull request Jun 7, 2019
bpo-37086: fixed time.sleep error message #13768
Closed
@jdemeyer

jdemeyer commented Jun 18, 2019

Copy link
Copy Markdown
Contributor Author

CC @pganssle

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@pganssle
pganssle self-requested a review June 18, 2019 14:00
pganssle
pganssle reviewed Jun 18, 2019
View reviewed changes
Comment thread Lib/test/test_time.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@jdemeyer

jdemeyer commented Jun 18, 2019

Copy link
Copy Markdown
Contributor Author

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jdemeyer
bpo-35707: support __index__ and __float__ in time functions
e90cc9d
@jdemeyer

jdemeyer commented Jul 4, 2019

Copy link
Copy Markdown
Contributor Author

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jdemeyer
bpo-35707: improve tests for time.sleep()
b84ba0e
@jdemeyer
jdemeyer force-pushed the time_float branch from 1ad2f3d to b84ba0e Compare July 4, 2019 10:45
@jdemeyer
jdemeyer requested a review from abalkin as a code owner July 4, 2019 10:45
@jdemeyer

jdemeyer commented Jul 4, 2019 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jdemeyer jdemeyer added the needs backport to 3.8 label Aug 23, 2019
@csabella
csabella requested review from abalkin and pganssle and removed request for abalkin May 23, 2020 00:13
@ambv ambv removed the needs backport to 3.8 label May 4, 2021
@ezio-melotti ezio-melotti removed the CLA signed label Jul 13, 2022
iritkatriel
iritkatriel requested changes Dec 7, 2022
View reviewed changes

@iritkatriel iritkatriel left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

This has merge conflicts now.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-bot bedevere-bot removed the awaiting core review label Dec 7, 2022
@bedevere-bot

bedevere-bot commented Dec 7, 2022

Copy link
Copy Markdown

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot added the awaiting changes label Dec 7, 2022
@embray embray mentioned this pull request Jan 14, 2022
py3: strange behavior of sleep() on Sage types sagemath/sage#26311
Open
@arhadthedev arhadthedev changed the title bpo-35707: support __index__ and __float__ in time functions gh-79888: support __index__ and __float__ in time functions May 6, 2023
@bedevere-bot bedevere-bot added awaiting review and removed awaiting changes labels May 6, 2023
@arhadthedev arhadthedev added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label May 6, 2023
@jdemeyer jdemeyer mentioned this pull request Aug 3, 2023
time.sleep() should support objects with __float__ #79888
Closed
@python-cla-bot

python-cla-bot Bot commented Apr 6, 2025

Copy link
Copy Markdown

The following commit authors need to sign the Contributor License Agreement:

  • [email protected]

CLA signed

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Jun 15, 2025

Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label Jun 15, 2025
@StanFromIreland

StanFromIreland commented Nov 1, 2025

Copy link
Copy Markdown
Member

Closing as this PR has merge conflicts and has been stale for several months now.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@StanFromIreland StanFromIreland closed this Nov 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@iritkatriel iritkatriel iritkatriel requested changes
@pganssle pganssle Awaiting requested review from pganssle pganssle is a code owner
@abalkin abalkin Awaiting requested review from abalkin
+1 more reviewer
@auvipy auvipy auvipy approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

awaiting review interpreter-core (Objects, Python, Grammar, and Parser dirs) stale Stale PR or inactive for long period of time.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

11 participants

@jdemeyer @bedevere-bot @StanFromIreland @iritkatriel @pganssle @auvipy @ambv @arhadthedev @ned-deily @the-knights-who-say-ni @ezio-melotti
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.