diff options
author | Anthon van der Neut <anthon@mnt.org> | 2018-10-29 14:14:33 +0100 |
---|---|---|
committer | Anthon van der Neut <anthon@mnt.org> | 2018-10-29 14:14:33 +0100 |
commit | 82a72a27c6ba866878fdebe7a70bd4a86f54e81d (patch) | |
tree | 67899703ab03033622dcf6ead8880beea59a9232 /comments.py | |
parent | d6a0ec1e5bff3f20b6705bb345bba17b1fcb7f80 (diff) | |
download | ruamel.yaml-82a72a27c6ba866878fdebe7a70bd4a86f54e81d.tar.gz |
moved Anchor to own module
this prevents future circular imports
Diffstat (limited to 'comments.py')
-rw-r--r-- | comments.py | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/comments.py b/comments.py index 02a98b5..7048772 100644 --- a/comments.py +++ b/comments.py @@ -14,6 +14,7 @@ import copy from ruamel.yaml.compat import ordereddict, PY2, string_types, MutableSliceableSequence from ruamel.yaml.scalarstring import ScalarString +from ruamel.yaml.anchor import Anchor if PY2: from collections import MutableSet, Sized, Set, MutableMapping, Mapping @@ -24,15 +25,14 @@ if False: # MYPY from typing import Any, Dict, Optional, List, Union, Optional, Iterator # NOQA # fmt: off -__all__ = ["CommentedSeq", "CommentedKeySeq", - "CommentedMap", "CommentedOrderedMap", - "CommentedSet", 'comment_attrib', 'merge_attrib'] +__all__ = ['CommentedSeq', 'CommentedKeySeq', + 'CommentedMap', 'CommentedOrderedMap', + 'CommentedSet', 'comment_attrib', 'merge_attrib'] # fmt: on comment_attrib = '_yaml_comment' format_attrib = '_yaml_format' line_col_attrib = '_yaml_line_col' -anchor_attrib = '_yaml_anchor' merge_attrib = '_yaml_merge' tag_attrib = '_yaml_tag' @@ -163,16 +163,6 @@ class LineCol(object): self.data[key] = data -class Anchor(object): - __slots__ = 'value', 'always_dump' - attrib = anchor_attrib - - def __init__(self): - # type: () -> None - self.value = None - self.always_dump = False - - class Tag(object): """store tag information for roundtripping""" |