MCPcopy Index your code
hub / github.com/RustPython/RustPython / select

Method select

Lib/selectors.py:310–327  ·  view source on GitHub ↗
(self, timeout=None)

Source from the content-addressed store, hash-verified

308 _select = select.select
309
310 def select(self, timeout=None):
311 timeout = None if timeout is None else max(timeout, 0)
312 ready = []
313 try:
314 r, w, _ = self._select(self._readers, self._writers, [], timeout)
315 except InterruptedError:
316 return ready
317 r = frozenset(r)
318 w = frozenset(w)
319 rw = r | w
320 fd_to_key_get = self._fd_to_key.get
321 for fd in rw:
322 key = fd_to_key_get(fd)
323 if key:
324 events = ((fd in r and EVENT_READ)
325 | (fd in w and EVENT_WRITE))
326 ready.append((key, events & key.events))
327 return ready
328
329
330class _PollLikeSelector(_BaseSelectorImpl):

Callers

nothing calls this directly

Calls 3

_selectMethod · 0.95
maxFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected