diff options
author | Anthon van der Neut <anthon@mnt.org> | 2021-06-09 15:29:00 +0200 |
---|---|---|
committer | Anthon van der Neut <anthon@mnt.org> | 2021-06-09 15:29:00 +0200 |
commit | 5a5b603289bfd9b9e1bcd57618cf8694bd0ec2aa (patch) | |
tree | 3244f3c128fbb54bfc57e06f309a3ea333a62938 /comments.py | |
parent | 148949be5260969391a5b993cbb3fb602bed55a6 (diff) | |
download | ruamel.yaml-5a5b603289bfd9b9e1bcd57618cf8694bd0ec2aa.tar.gz |
fix for issue 3870.17.8
tagged objects that have a templated (idNNN) anchor, did get the anchor added explicitly, resulting
potentially in double anchors
Diffstat (limited to 'comments.py')
-rw-r--r-- | comments.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/comments.py b/comments.py index 3df5f34..1e117e7 100644 --- a/comments.py +++ b/comments.py @@ -10,7 +10,7 @@ import sys import copy -from ruamel.yaml.compat import ordereddict # type: ignore +from ruamel.yaml.compat import ordereddict from ruamel.yaml.compat import MutableSliceableSequence, _F, nprintf # NOQA from ruamel.yaml.scalarstring import ScalarString from ruamel.yaml.anchor import Anchor @@ -118,7 +118,7 @@ class Comment: else: end = "" try: - ln = max([len(str(k)) for k in self._items]) + 1 # type: ignore + ln = max([len(str(k)) for k in self._items]) + 1 except ValueError: ln = '' # type: ignore it = ' '.join( @@ -137,7 +137,7 @@ class Comment: else: end = "" try: - ln = max([len(str(k)) for k in self._items]) + 1 # type: ignore + ln = max([len(str(k)) for k in self._items]) + 1 except ValueError: ln = '' # type: ignore it = ' '.join( @@ -632,7 +632,7 @@ class CommentedSeq(MutableSliceableSequence, list, CommentedBase): # type: igno # type: (Any) -> Any return list.__add__(self, other) - def sort(self, key=None, reverse=False): # type: ignore + def sort(self, key=None, reverse=False): # type: (Any, bool) -> None if key is None: tmp_lst = sorted(zip(self, range(len(self))), reverse=reverse) @@ -784,7 +784,7 @@ class CommentedMapValuesView(CommentedMapView): yield self._mapping[key] -class CommentedMap(ordereddict, CommentedBase): # type: ignore +class CommentedMap(ordereddict, CommentedBase): __slots__ = (Comment.attrib, '_ok', '_ref') def __init__(self, *args, **kw): |