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

Method _comments_part

src/docx/parts/document.py:129–140  ·  view source on GitHub ↗

A |CommentsPart| object providing access to the comments added to this document. Creates a default comments part if one is not present.

(self)

Source from the content-addressed store, hash-verified

127
128 @property
129 def _comments_part(self) -> CommentsPart:
130 """A |CommentsPart| object providing access to the comments added to this document.
131
132 Creates a default comments part if one is not present.
133 """
134 try:
135 return cast(CommentsPart, self.part_related_by(RT.COMMENTS))
136 except KeyError:
137 assert self.package is not None
138 comments_part = CommentsPart.default(self.package)
139 self.relate_to(comments_part, RT.COMMENTS)
140 return comments_part
141
142 @property
143 def _settings_part(self) -> SettingsPart:

Callers

nothing calls this directly

Calls 3

part_related_byMethod · 0.45
defaultMethod · 0.45
relate_toMethod · 0.45

Tested by

no test coverage detected