MCPcopy Create free account
hub / github.com/Python-Markdown/markdown / get_index_for_name

Method get_index_for_name

markdown/util.py:351–360  ·  view source on GitHub ↗

Return the index of the given name.

(self, name: str)

Source from the content-addressed store, hash-verified

349 return '<{}({})>'.format(self.__class__.__name__, list(self))
350
351 def get_index_for_name(self, name: str) -> int:
352 """
353 Return the index of the given name.
354 """
355 if name in self:
356 self._sort()
357 return self._priority.index(
358 [x for x in self._priority if x.name == name][0]
359 )
360 raise ValueError('No item named "{}" exists.'.format(name))
361
362 def register(self, item: _T, name: str, priority: float) -> None:
363 """

Callers 3

deregisterMethod · 0.95
testIsSortedMethod · 0.95
testGetIndexForNameMethod · 0.95

Calls 1

_sortMethod · 0.95

Tested by 2

testIsSortedMethod · 0.76
testGetIndexForNameMethod · 0.76