Return the comments of `key` as ``{"before": text, "eol": text}`` (a position without a comment is left out), or None. ``key=None`` returns the document comments ``{"start": ..., "end": ...}``. With box_dots, `key` can be a dotted path.
(self, key: Any = None)
| 362 | # ---- Comments (#184): kept outside the data, written by to_yaml with ruamel.yaml ---- |
| 363 | |
| 364 | def get_comment(self, key: Any = None) -> dict | None: |
| 365 | """ |
| 366 | Return the comments of `key` as ``{"before": text, "eol": text}`` (a position without a comment |
| 367 | is left out), or None. ``key=None`` returns the document comments ``{"start": ..., "end": ...}``. |
| 368 | With box_dots, `key` can be a dotted path. |
| 369 | """ |
| 370 | return _comments.get_comment(self, key) |
| 371 | |
| 372 | def set_comment(self, key: Any, text: Any, position: str | None = None) -> None: |
| 373 | """ |
no outgoing calls