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)
| 925 | # ---- Comments (#184): kept outside the data, written by to_yaml with ruamel.yaml ---- |
| 926 | |
| 927 | def get_comment(self, key: Any = None) -> dict | None: |
| 928 | """ |
| 929 | Return the comments of `key` as ``{"before": text, "eol": text}`` (a position without a comment |
| 930 | is left out), or None. ``key=None`` returns the document comments ``{"start": ..., "end": ...}``. |
| 931 | With box_dots, `key` can be a dotted path. |
| 932 | """ |
| 933 | return _comments.get_comment(self, key) |
| 934 | |
| 935 | def set_comment(self, key: Any, text: Any, position: str | None = None) -> None: |
| 936 | """ |
no outgoing calls