MCPcopy Index your code
hub / github.com/python/cpython / __getitem__

Method __getitem__

Lib/selectors.py:73–78  ·  view source on GitHub ↗
(self, fileobj)

Source from the content-addressed store, hash-verified

71 return self._selector._fd_to_key.get(fd, default)
72
73 def __getitem__(self, fileobj):
74 fd = self._selector._fileobj_lookup(fileobj)
75 key = self._selector._fd_to_key.get(fd)
76 if key is None:
77 raise KeyError("{!r} is not registered".format(fileobj))
78 return key
79
80 def __iter__(self):
81 return iter(self._selector._fd_to_key)

Callers

nothing calls this directly

Calls 3

_fileobj_lookupMethod · 0.80
getMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected