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

Method matches

Lib/importlib/metadata/__init__.py:255–277  ·  view source on GitHub ↗

EntryPoint matches the given parameters. >>> ep = EntryPoint(group='foo', name='bar', value='bing:bong [extra1, extra2]') >>> ep.matches(group='foo') True >>> ep.matches(name='bar', value='bing:bong [extra1, extra2]') True >>> ep.matches(grou

(self, **params)

Source from the content-addressed store, hash-verified

253 return self
254
255 def matches(self, **params):
256 """
257 EntryPoint matches the given parameters.
258
259 >>> ep = EntryPoint(group='foo', name='bar', value='bing:bong [extra1, extra2]')
260 >>> ep.matches(group='foo')
261 True
262 >>> ep.matches(name='bar', value='bing:bong [extra1, extra2]')
263 True
264 >>> ep.matches(group='foo', name='other')
265 False
266 >>> ep.matches()
267 True
268 >>> ep.matches(extras=['extra1', 'extra2'])
269 True
270 >>> ep.matches(module='bing')
271 True
272 >>> ep.matches(attr='bong')
273 True
274 """
275 self._disallow_dist(params)
276 attrs = (getattr(self, param) for param in params)
277 return all(map(operator.eq, params.values(), attrs))
278
279 @staticmethod
280 def _disallow_dist(params):

Callers 1

selectMethod · 0.45

Calls 2

_disallow_distMethod · 0.95
valuesMethod · 0.45

Tested by

no test coverage detected