summaryrefslogtreecommitdiff
path: root/anchor.py
diff options
context:
space:
mode:
Diffstat (limited to 'anchor.py')
-rw-r--r--anchor.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/anchor.py b/anchor.py
index d702126..1eb1480 100644
--- a/anchor.py
+++ b/anchor.py
@@ -1,19 +1,18 @@
-if False: # MYPY
- from typing import Any, Dict, Optional, List, Union, Optional, Iterator # NOQA
+# coding: utf-8
+
+from typing import Any, Dict, Optional, List, Union, Optional, Iterator # NOQA
anchor_attrib = '_yaml_anchor'
-class Anchor(object):
+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})'