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 — bpo-31938: Fix default-value signatures of several functions in the select module by asottile · Pull Request #21066 · python/cpython

Conversation

@asottile

@asottile asottile commented Jun 23, 2020 •
edited by bedevere-bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

this appears to have regressed in 6dc57e2

https://bugs.python.org/issue31938

Sorry, something went wrong.

Uh oh!

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

All reactions
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Jun 23, 2020
@bedevere-bot bedevere-bot added the awaiting review label Jun 23, 2020
@taleinat

taleinat commented Jun 23, 2020 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

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

All reactions

Sorry, something went wrong.

Uh oh!

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

@vstinner vstinner mentioned this pull request Jun 23, 2020
bpo-31938: Fix select.epoll.register() signature #21067
Closed
@vstinner

vstinner commented Jun 23, 2020

Copy link
Copy Markdown
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.
All reactions

Sorry, something went wrong.

Uh oh!

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

@vstinner

vstinner commented Jun 23, 2020

Copy link
Copy Markdown
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".

All reactions

Sorry, something went wrong.

Uh oh!

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

@vstinner vstinner added needs backport to 3.8 labels Jun 23, 2020
@asottile
Fix default-value signatures of several functions in the select module
ea850df
@asottile
asottile force-pushed the pydoc_select_31938 branch from 8f69adc to ea850df Compare June 23, 2020 20:20
@asottile asottile changed the title bpo-31938: Fix pydoc of select module bpo-31938: Fix default-value signatures of several functions in the select module Jun 23, 2020
@asottile

asottile commented Jun 23, 2020

Copy link
Copy Markdown
Contributor Author

I fixed a few others as well -- good catch

All reactions

Sorry, something went wrong.

Uh oh!

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

@vstinner
vstinner merged commit d051801 into python:master Jun 23, 2020
@miss-islington

miss-islington commented Jun 23, 2020

Copy link
Copy Markdown
Contributor

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

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-bot bedevere-bot removed the awaiting review label Jun 23, 2020
@miss-islington

miss-islington commented Jun 23, 2020

Copy link
Copy Markdown
Contributor

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

All reactions

Sorry, something went wrong.

Uh oh!

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

@miss-islington miss-islington assigned vstinner Jun 23, 2020
@miss-islington

miss-islington commented Jun 23, 2020

Copy link
Copy Markdown
Contributor

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

All reactions

Sorry, something went wrong.

Uh oh!

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

@vstinner

vstinner commented Jun 23, 2020

Copy link
Copy Markdown
Member

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

All reactions

Sorry, something went wrong.

Uh oh!

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

@asottile
asottile deleted the pydoc_select_31938 branch June 23, 2020 21:57
asottile added a commit to asottile/cpython that referenced this pull request Jun 23, 2020
@asottile
bpo-31938: Fix default-value signatures of several functions in the s…
7f7548e
…elect module (pythonGH-21066)

(cherry picked from commit d051801)
@bedevere-bot

bedevere-bot commented Jun 23, 2020

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-bot bedevere-bot removed the needs backport to 3.9 label Jun 23, 2020
@bedevere-bot

bedevere-bot commented Jun 23, 2020

Copy link
Copy Markdown

GH-21098 is a backport of this pull request to the 3.8 branch.

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-bot bedevere-bot removed the needs backport to 3.8 label Jun 23, 2020
asottile added a commit to asottile/cpython that referenced this pull request Jun 23, 2020
@asottile
bpo-31938: Fix default-value signatures of several functions in the s…
501e18d
…elect module (pythonGH-21066)

(cherry picked from commit d051801)
@asottile asottile mentioned this pull request Jun 23, 2020
automatic conflict resolution for argument clinic generated files? python/cherry-picker#18
Closed
miss-islington pushed a commit that referenced this pull request Jun 23, 2020
@asottile
[3.8] bpo-31938: Fix default-value signatures of several functions in…
60cbdc8
… the select module (GH-21066) (GH-21098)

(cherry picked from commit d051801)

Automerge-Triggered-By: @vstinner
miss-islington pushed a commit that referenced this pull request Jun 23, 2020
@asottile
[3.9] bpo-31938: Fix default-value signatures of several functions in…
48fc35a
… the select module (GH-21066) (GH-21097)

(cherry picked from commit d051801)

Automerge-Triggered-By: @vstinner
@vstinner

vstinner commented Jun 23, 2020 •
edited by bedevere-bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

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

All reactions

Sorry, something went wrong.

Uh oh!

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

fasih pushed a commit to fasih/cpython that referenced this pull request Jun 29, 2020
@asottile @fasihahmad
bpo-31938: Fix default-value signatures of several functions in the s…
db530d1
…elect module (pythonGH-21066)
@vstinner vstinner mentioned this pull request Nov 3, 2022
inspect.signature() doesn't parse __text_signature__ containing a newline character #85267
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

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

Assignees

@vstinner vstinner

Labels

None yet

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.

6 participants

@asottile @taleinat @vstinner @miss-islington @bedevere-bot @the-knights-who-say-ni
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 01402503 — 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.