summaryrefslogtreecommitdiff
path: root/anchor.py
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2023-05-01 19:13:50 +0200
committerAnthon van der Neut <anthon@mnt.org>2023-05-01 19:13:50 +0200
commit8b731994b1543d7886af85f926d9eea5a22d0732 (patch)
tree3553d4cbc80b541484d7a3f39e00cdcfd8f9d030 /anchor.py
parent45111ba0b67e8619265d89f3202635e62c13cde6 (diff)
downloadruamel.yaml-8b731994b1543d7886af85f926d9eea5a22d0732.tar.gz
retrofitted 0.18 changes
Diffstat (limited to 'anchor.py')
-rw-r--r--anchor.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/anchor.py b/anchor.py
index 1deea78..1eb1480 100644
--- a/anchor.py
+++ b/anchor.py
@@ -1,6 +1,6 @@
# coding: utf-8
-if False: # MYPY
- from typing import Any, Dict, Optional, List, Union, Optional, Iterator # NOQA
+
+from typing import Any, Dict, Optional, List, Union, Optional, Iterator # NOQA
anchor_attrib = '_yaml_anchor'
@@ -9,12 +9,10 @@ class Anchor:
__slots__ = 'value', 'always_dump'
attrib = anchor_attrib
- def __init__(self):
- # type: () -> None
+ def __init__(self) -> None:
self.value = None
self.always_dump = False
- def __repr__(self):
- # type: () -> Any
+ def __repr__(self) -> Any:
ad = ', (always dump)' if self.always_dump else ""
- return 'Anchor({!r}{})'.format(self.value, ad)
+ return f'Anchor({self.value!r}{ad})'