diff options
author | Anthon van der Neut <anthon@mnt.org> | 2023-05-01 19:13:50 +0200 |
---|---|---|
committer | Anthon van der Neut <anthon@mnt.org> | 2023-05-01 19:13:50 +0200 |
commit | 8b731994b1543d7886af85f926d9eea5a22d0732 (patch) | |
tree | 3553d4cbc80b541484d7a3f39e00cdcfd8f9d030 /anchor.py | |
parent | 45111ba0b67e8619265d89f3202635e62c13cde6 (diff) | |
download | ruamel.yaml-8b731994b1543d7886af85f926d9eea5a22d0732.tar.gz |
retrofitted 0.18 changes
Diffstat (limited to 'anchor.py')
-rw-r--r-- | anchor.py | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -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})' |