MCPcopy Index your code
hub / github.com/python-openxml/python-docx / __contains__

Method __contains__

src/docx/styles/styles.py:26–29  ·  view source on GitHub ↗

Enables `in` operator on style name.

(self, name)

Source from the content-addressed store, hash-verified

24 self._element = styles
25
26 def __contains__(self, name):
27 """Enables `in` operator on style name."""
28 internal_name = BabelFish.ui2internal(name)
29 return any(style.name_val == internal_name for style in self._element.style_lst)
30
31 def __getitem__(self, key: str):
32 """Enables dictionary-style access by UI name.

Callers

nothing calls this directly

Calls 1

ui2internalMethod · 0.80

Tested by

no test coverage detected