From 8b731994b1543d7886af85f926d9eea5a22d0732 Mon Sep 17 00:00:00 2001 From: Anthon van der Neut Date: Mon, 1 May 2023 19:13:50 +0200 Subject: retrofitted 0.18 changes --- anchor.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'anchor.py') 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})' -- cgit v1.2.1