codekingpro/portable-devtools
114k
1 2from __future__ import annotations3 4if False: # MYPY5 from typing import Any, Dict, Optional, List, Union, Iterator # NOQA6 7anchor_attrib = '_yaml_anchor'8 9 10class Anchor:11 __slots__ = 'value', 'always_dump'12 attrib = anchor_attrib13 14 def __init__(self) -> None:15 self.value = None16 self.always_dump = False17 18 def __repr__(self) -> Any:19 ad = ', (always dump)' if self.always_dump else ""20 return f'Anchor({self.value!r}{ad})'21 