Skip to content

bpo-41857: Document timeout arguments in select module - #22406

Merged
taleinat merged 2 commits into
python:mainfrom
zaneb:select-poll-timeout-docstrings
Jan 20, 2022
Merged

bpo-41857: Document timeout arguments in select module#22406
taleinat merged 2 commits into
python:mainfrom
zaneb:select-poll-timeout-docstrings

Conversation

@zaneb

@zanebzaneb commented Sep 25, 2020

Copy link
Copy Markdown
Contributor

The docstring for the poll() methods of the select.poll and
select.devpoll classes did not describe the expected units of the
timeout argument (milliseconds). Previously this information was only
available from the online documentation.

This is a potential source of confusion, because other poll() methods in
the select module, such as epoll and kqueue Polling objects, use units
of seconds (and were documented).

Include the units in the docstring description so that this information
is at least available from interactive help.

https://bugs.python.org/issue41857

@zaneb

Copy link
Copy Markdown
ContributorAuthor

This is just a docs change so I believe it should be given the "skip news" label.

@taleinattaleinat left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @zaneb, this would certainly be an improvement!

A small request: I suggest more closely imitating the wording used by select.kqueue.control():

 timeout as otimeout: object = None
The maximum time to wait in seconds, or else None to wait forever.
This accepts floats for smaller timeouts, too.

@bedevere-bot

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.

@taleinattaleinat added the docs Documentation in the Doc dir label Sep 26, 2020
@zaneb
zanebforce-pushed the select-poll-timeout-docstrings branch from d54b73e to c4942e2CompareOctober 1, 2020 03:21
@zaneb

zaneb commented Oct 1, 2020

Copy link
Copy Markdown
ContributorAuthor

Thanks for the suggestion. I have made the requested changes; please review again.

@bedevere-bot

Copy link
Copy Markdown

Thanks for making the requested changes!

@taleinat: please review the changes made to this pull request.

@zaneb
zanebforce-pushed the select-poll-timeout-docstrings branch from c4942e2 to 891cd82CompareOctober 13, 2020 17:02
The docstring for the poll() methods of the select.poll[1] and
select.devpoll[2] classes did not describe the expected units of the
timeout argument (milliseconds). Previously this information was only
available from the online documentation.
This is a potential source of confusion, because other poll() methods in
the select module, such as select.epoll and select.kqueue objects, use
units of seconds (and were documented).
Include the units in the docstring description so that this information
is at least available from interactive help.
[1] https://docs.python.org/3/library/select.html#select.poll.poll
[2] https://docs.python.org/3/library/select.html#select.devpoll.poll
@zaneb
zanebforce-pushed the select-poll-timeout-docstrings branch from 891cd82 to 6f86628CompareNovember 24, 2020 22:06

@taleinattaleinat left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

Signed-off-by: Tal Einat <532281+taleinat@users.noreply.github.com>
@taleinat
taleinatforce-pushed the select-poll-timeout-docstrings branch from b48cc99 to adff1f0CompareJanuary 20, 2022 22:36
@taleinat
taleinat merged commit 27df756 into python:mainJan 20, 2022
@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @zaneb for the PR, and @taleinat for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9, 3.10.
🐍🍒⛏🤖

@miss-islington

Copy link
Copy Markdown
Contributor

Sorry, @zaneb and @taleinat, I could not cleanly backport this to 3.10 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 27df7566bc19699b967e0e30d7808637b90141f6 3.10

@miss-islington

Copy link
Copy Markdown
Contributor

Sorry @zaneb and @taleinat, I had trouble checking out the 3.9 backport branch.
Please backport using cherry_picker on command line.
cherry_picker 27df7566bc19699b967e0e30d7808637b90141f6 3.9

taleinat pushed a commit to taleinat/cpython that referenced this pull request Jan 21, 2022
… select.depoll() doc-strings (pythonGH-22406).
(cherry picked from commit 27df756)
Co-authored-by: Zane Bitter <zbitter@redhat.com>
taleinat pushed a commit to taleinat/cpython that referenced this pull request Jan 21, 2022
…select.depoll() doc-strings (pythonGH-22406).
(cherry picked from commit 27df756)
Co-authored-by: Zane Bitter <zbitter@redhat.com>
@bedevere-botbedevere-bot removed the needs backport to 3.10 only security fixes label Jan 21, 2022
@bedevere-bot

Copy link
Copy Markdown

GH-30741 is a backport of this pull request to the 3.10 branch.

@bedevere-bot

Copy link
Copy Markdown

GH-30742 is a backport of this pull request to the 3.9 branch.

taleinat added a commit that referenced this pull request Jan 21, 2022
… select.depoll() doc-strings (GH-22406)
(cherry picked from commit 27df756)
Co-authored-by: Zane Bitter <zbitter@redhat.com>
taleinat added a commit that referenced this pull request Jan 21, 2022
…select.depoll() doc-strings (GH-22406)
(cherry picked from commit 27df756)
Co-authored-by: Zane Bitter <zbitter@redhat.com>
hello-adam pushed a commit to hello-adam/cpython that referenced this pull request Jun 2, 2022
…select.depoll() doc-strings (pythonGH-22406)
(cherry picked from commit 27df756)
Co-authored-by: Zane Bitter <zbitter@redhat.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docsDocumentation in the Doc dirskip news

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@zaneb@bedevere-bot@miss-islington@taleinat@the-knights-who-say-ni