diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 00:30:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 00:30:09 +0000 |
commit | 4dd6e896edac1096089a9cd54296266436ffec03 (patch) | |
tree | a3da8663c704704177ad944ae5a680c302f29f55 /anchor.py | |
parent | Initial commit. (diff) | |
download | ruamel.yaml-4dd6e896edac1096089a9cd54296266436ffec03.tar.xz ruamel.yaml-4dd6e896edac1096089a9cd54296266436ffec03.zip |
Adding upstream version 0.18.5.upstream/0.18.5
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'anchor.py')
-rw-r--r-- | anchor.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/anchor.py b/anchor.py new file mode 100644 index 0000000..1eb1480 --- /dev/null +++ b/anchor.py @@ -0,0 +1,18 @@ +# coding: utf-8 + +from typing import Any, Dict, Optional, List, Union, Optional, Iterator # NOQA + +anchor_attrib = '_yaml_anchor' + + +class Anchor: + __slots__ = 'value', 'always_dump' + attrib = anchor_attrib + + def __init__(self) -> None: + self.value = None + self.always_dump = False + + def __repr__(self) -> Any: + ad = ', (always dump)' if self.always_dump else "" + return f'Anchor({self.value!r}{ad})' |