Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

bpo-31938: Fix default-value signatures of several functions in the select module#21066

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
vstinner merged 1 commit intopython:masterfromasottile:pydoc_select_31938
Jun 23, 2020

Conversation

@asottile
Copy link
Contributor

@asottileasottile commentedJun 23, 2020
edited by bedevere-bot
Loading

this appears to have regressed in6dc57e2

https://bugs.python.org/issue31938

@taleinat
Copy link
Contributor

taleinat commentedJun 23, 2020
edited
Loading

If this is the proper way to do it, this PR should also fix the default values forpoll.register anddevpoll.register similarly.

@vstinner
Copy link
Member

Oops, I didn't notice that you proposed a PR and so I wrote PR#21067 which is the same fix :-) Copy of my comment there.

inspect.signature() doesn't see the event_mask. Is it a bug in signature which doesn't support a signature written on two lines?

cc@serhiy-storchaka@1st1@ambv

11:47:01 vstinner@apu$ ./python Python 3.10.0a0 (heads/pydoc_select:486e11db95, Jun 23 2020, 11:45:39) >>> import select>>> select.epoll.register.__text_signature__'($self, /, fd,\n         eventmask=select.EPOLLIN | select.EPOLLPRI | select.EPOLLOUT)'>>> import inspect>>> inspect.signature(select.epoll.register)<Signature (self, /, fd)>

So pydoc doesn't show the whole signature:

./python -m pydoc select(...)     |  register(self, /, fd)     |      Registers a new fd or raises an OSError if the fd is already registered.     |           |        fd     |          the target file descriptor of the operation     |        eventmask     |          a bit set composed of the various EPOLL constants     |           |      The epoll interface supports all file descriptors that support poll.

@vstinner
Copy link
Member

If this is the proper way to do it, this PR should also fix the default values for poll.register and devpoll.register similarly.

IMO the fix is correct, so I concur thta the two other functions signature should also be fixed.

By the way, I suggest to rephase the NEWS entry to explain that the change fix the "signature" rather than fixing "pydoc".

@asottileasottile changed the titlebpo-31938: Fix pydoc of select modulebpo-31938: Fix default-value signatures of several functions in the select moduleJun 23, 2020
@asottile
Copy link
ContributorAuthor

I fixed a few others as well -- good catch

@vstinnervstinner merged commitd051801 intopython:masterJun 23, 2020
@miss-islington
Copy link
Contributor

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

@miss-islington
Copy link
Contributor

Sorry,@asottile and@vstinner, I could not cleanly backport this to3.9 due to a conflict.
Please backport usingcherry_picker on command line.
cherry_picker d051801052211b533c46a593b1c1bccf649a171c 3.9

@miss-islington
Copy link
Contributor

Sorry@asottile and@vstinner, I had trouble checking out the3.8 backport branch.
Please backport usingcherry_picker on command line.
cherry_picker d051801052211b533c46a593b1c1bccf649a171c 3.8

@vstinner
Copy link
Member

@asottile: Automated backport failed. Can you try to backport it manually (use cherry_picker or git cherry-pick -x)?

@asottileasottile deleted the pydoc_select_31938 branchJune 23, 2020 21:57
asottile added a commit to asottile/cpython that referenced this pull requestJun 23, 2020
@bedevere-bot
Copy link

GH-21097 is a backport of this pull request to the3.9 branch.

@bedevere-bot
Copy link

GH-21098 is a backport of this pull request to the3.8 branch.

asottile added a commit to asottile/cpython that referenced this pull requestJun 23, 2020
miss-islington pushed a commit that referenced this pull requestJun 23, 2020
… the select module (GH-21066) (GH-21098)(cherry picked from commitd051801)Automerge-Triggered-By:@vstinner
miss-islington pushed a commit that referenced this pull requestJun 23, 2020
… the select module (GH-21066) (GH-21097)(cherry picked from commitd051801)Automerge-Triggered-By:@vstinner
@vstinner
Copy link
Member

vstinner commentedJun 23, 2020
edited by bedevere-bot
Loading

pydoc doesn't show the eventmask parameter whereas it is in select.epoll.register.text_signature. I createdbpo-41095: "inspect.signature() doesn't parsetext_signature containing a newline character".

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

@vstinnervstinner

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

6 participants

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

[8]ページ先頭

©2009-2025 Movatter.jp