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

Method get_key

Lib/selectors.py:184–196  ·  view source on GitHub ↗

Return the key associated to a registered file object. Returns: SelectorKey for this file object

(self, fileobj)

Source from the content-addressed store, hash-verified

182 pass
183
184 def get_key(self, fileobj):
185 """Return the key associated to a registered file object.
186
187 Returns:
188 SelectorKey for this file object
189 """
190 mapping = self.get_map()
191 if mapping is None:
192 raise RuntimeError('Selector is closed')
193 try:
194 return mapping[fileobj]
195 except KeyError:
196 raise KeyError("{!r} is not registered".format(fileobj)) from None
197
198 @abstractmethod
199 def get_map(self):

Calls 2

get_mapMethod · 0.95
formatMethod · 0.45