diff options
author | Anthon van der Neut <anthon@mnt.org> | 2019-11-05 15:25:06 +0100 |
---|---|---|
committer | Anthon van der Neut <anthon@mnt.org> | 2019-11-05 15:25:06 +0100 |
commit | cc39b48f95d59bc09cea2470d1d69431dee43725 (patch) | |
tree | f9fe385a5b620497dba7e56ab79cac91f1028bf9 /comments.py | |
parent | 2350b5f2d52a129f9701b78de5fc71fb1cd4f811 (diff) | |
download | ruamel.yaml-cc39b48f95d59bc09cea2470d1d69431dee43725.tar.gz |
https://stackoverflow.com/a/58707111/1307905
Diffstat (limited to 'comments.py')
-rw-r--r-- | comments.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/comments.py b/comments.py index 61c1f0e..237ffd3 100644 --- a/comments.py +++ b/comments.py @@ -1115,10 +1115,12 @@ class CommentedSet(MutableSet, CommentedBase): # type: ignore # NOQA class TaggedScalar(CommentedBase): # the value and style attributes are set during roundtrip construction - def __init__(self): + def __init__(self, value=None, style=None, tag=None): # type: () -> None - self.value = None - self.style = None + self.value = value + self.style = style + if tag is not None: + self.yaml_set_tag(tag) def __str__(self): # type: () -> Any |