summaryrefslogtreecommitdiffstats
path: root/lib/ruyaml/anchor.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--lib/ruyaml/anchor.py20
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)