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

Method modify

Lib/selectors.py:258–270  ·  view source on GitHub ↗
(self, fileobj, events, data=None)

Source from the content-addressed store, hash-verified

256 return key
257
258 def modify(self, fileobj, events, data=None):
259 try:
260 key = self._fd_to_key[self._fileobj_lookup(fileobj)]
261 except KeyError:
262 raise KeyError("{!r} is not registered".format(fileobj)) from None
263 if events != key.events:
264 self.unregister(fileobj)
265 key = self.register(fileobj, events, data)
266 elif data != key.data:
267 # Use a shortcut to update the data.
268 key = key._replace(data=data)
269 self._fd_to_key[key.fd] = key
270 return key
271
272 def close(self):
273 self._fd_to_key.clear()

Callers

nothing calls this directly

Calls 5

_fileobj_lookupMethod · 0.95
unregisterMethod · 0.95
registerMethod · 0.95
formatMethod · 0.45
_replaceMethod · 0.45

Tested by

no test coverage detected