Sorry, something went wrong.
|
If this is the proper way to do it, this PR should also fix the default values for poll.register and devpoll.register similarly. |
Sorry, something went wrong.
|
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.
|
Sorry, something went wrong.
|
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". |
Sorry, something went wrong.
|
I fixed a few others as well -- good catch |
Sorry, something went wrong.
|
Sorry, @asottile and @vstinner, I could not cleanly backport this to 3.9 due to a conflict. |
Sorry, something went wrong.
|
Sorry @asottile and @vstinner, I had trouble checking out the 3.8 backport branch. |
Sorry, something went wrong.
|
@asottile: Automated backport failed. Can you try to backport it manually (use cherry_picker or git cherry-pick -x)? |
Sorry, something went wrong.
|
GH-21097 is a backport of this pull request to the 3.9 branch. |
Sorry, something went wrong.
|
GH-21098 is a backport of this pull request to the 3.8 branch. |
Sorry, something went wrong.
|
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". |
Sorry, something went wrong.
this appears to have regressed in 6dc57e2
https://bugs.python.org/issue31938