Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(48)

#19172: selectors: add keys() method

Can't Edit
Can't Publish+Mail
Start Review
Created:
6 years, 4 months ago by cf.natali
Modified:
6 years, 3 months ago
Reviewers:
guido
CC:
gvanrossum, AntoinePitrou, haypo, Charles-Fran├žois Natali, devnull_psf.upfronthosting.co.za, berkerpeksag
Visibility:
Public.

Patch Set 1 #

Patch Set 2 #

Patch Set 3 #

Total comments: 2

Patch Set 4 #

Unified diffs Side-by-side diffs Delta from patch set Stats Patch
Doc/library/selectors.rst View 1 2 3 1 chunk +8 lines, -0 lines 0 comments Download
Lib/selectors.py View 1 2 3 4 chunks +26 lines, -1 line 0 comments Download
Lib/test/test_selectors.py View 1 2 3 1 chunk +27 lines, -0 lines 0 comments Download

Messages

Total messages: 1
gvanrossum
6 years, 3 months ago #1
Totally unrelated: should we try to optimize modify() for some subclasses to
avoid syscalls where we can? There's a TODO in modify() about this.

http://bugs.python.org/review/19172/diff/9700/Lib/selectors.py
File Lib/selectors.py (right):

http://bugs.python.org/review/19172/diff/9700/Lib/selectors.py#newcode51
Lib/selectors.py:51: self._fd_to_key = selector._fd_to_key
I somehow think it would be better if this stores a reference to the selector
instead of to its _fd_to_key attribute. That way if someone ever resets
_fd_to_key to a new object (who knows, that may be the right thing to do at
fork()) this will continue to work.

http://bugs.python.org/review/19172/diff/9700/Lib/selectors.py#newcode173
Lib/selectors.py:173: def get_map(self):
I like having get_map(), but I would still like to keep get_key(). First of all,
that avoids having to change Tulip (which has evolved somewhat since it was
copied into the stdlib). Second, Tulip calls get_key() each time a FD is
registered or unregistered. The code duplication feels minimal and does not
concern me.
Sign in to reply to this message.

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+