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

Method default

src/docx/styles/styles.py:67–73  ·  view source on GitHub ↗

Return the default style for `style_type` or |None| if no default is defined for that type (not common).

(self, style_type: WD_STYLE_TYPE)

Source from the content-addressed store, hash-verified

65 return StyleFactory(style)
66
67 def default(self, style_type: WD_STYLE_TYPE):
68 """Return the default style for `style_type` or |None| if no default is defined
69 for that type (not common)."""
70 style = self._element.default_for(style_type)
71 if style is None:
72 return None
73 return StyleFactory(style)
74
75 def get_by_id(self, style_id: str | None, style_type: WD_STYLE_TYPE):
76 """Return the style of `style_type` matching `style_id`.

Calls 2

StyleFactoryFunction · 0.90
default_forMethod · 0.80