diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-14 20:19:53 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-14 20:19:53 +0000 |
commit | e7ee850d46d54789979bf0c5244bae1825fb7149 (patch) | |
tree | 6e94ed55df9ec749682a3c792ce752d07892b968 /lib/ruyaml/anchor.py | |
parent | Initial commit. (diff) | |
download | python-ruyaml-upstream.tar.xz python-ruyaml-upstream.zip |
Adding upstream version 0.91.0.upstream/0.91.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'lib/ruyaml/anchor.py')
-rw-r--r-- | lib/ruyaml/anchor.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/ruyaml/anchor.py b/lib/ruyaml/anchor.py new file mode 100644 index 0000000..369d5b1 --- /dev/null +++ b/lib/ruyaml/anchor.py @@ -0,0 +1,20 @@ +# coding: utf-8 +if False: # MYPY + from typing import Any, Dict, Iterator, List, Optional, Union # NOQA + +anchor_attrib = '_yaml_anchor' + + +class Anchor: + __slots__ = 'value', 'always_dump' + attrib = anchor_attrib + + def __init__(self): + # type: () -> None + self.value = None + self.always_dump = False + + def __repr__(self): + # type: () -> Any + ad = ', (always dump)' if self.always_dump else "" + return 'Anchor({!r}{})'.format(self.value, ad) |