FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-105331: Fix asyncio.sleep() bug by weijay0804 · Pull Request #105501 · python/cpython · GitHub

Repository navigation

gh-105331: Fix asyncio.sleep() bug - #105501

Closed
weijay0804 wants to merge 3 commits into
python:mainfrom
weijay0804:fix-issue-105331
Closed

weijay0804 wants to merge 3 commits into
python:mainfrom
weijay0804:fix-issue-105331

Conversation

weijay0804 commented Jun 8, 2023 •
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Contributor

Copy link
Copy Markdown

Most changes to Python require a NEWS entry.

Please add it using the blurb_it web app or the blurb command-line tool.

ghost commented Jun 8, 2023 •
edited by ghost
Loading

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

Comment thread Lib/asyncio/tasks.py
"""
yield

def __check_delay(delay):

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Nitpick: Does it really need double underscore? If you want to mark something as "private API" use one leading underscore

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Get it!
Thank you

Comment thread Lib/asyncio/tasks.py

SEC_TO_NS = 1000 * 1000 * 1000

if not (isinstance(delay, int) or isinstance(delay, float)):

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality
Suggested change
if not (isinstance(delay, int) or isinstance(delay, float)):
if not isinstance(delay, (int, float)):

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Wow! This is much clearer now.

Comment thread Lib/asyncio/tasks.py
SEC_TO_NS = 1000 * 1000 * 1000

if not (isinstance(delay, int) or isinstance(delay, float)):
raise TypeError(f"'{type(delay)} object cannot be interpreted as an integer'")

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality
Suggested change
raise TypeError(f"'{type(delay)} object cannot be interpreted as an integer'")
raise TypeError(f"{type(delay)} object cannot be interpreted as an integer")

There's no need for single quotes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Ok
Thank you

weijay0804 closed this Jun 8, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

3 participants


Back | FazBrowse Home | New Git URL