diff options
Diffstat (limited to 'anchor.py')
-rw-r--r-- | anchor.py | 15 |
1 files changed, 7 insertions, 8 deletions
@@ -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})' |