3535if TYPE_CHECKING :
3636 # noinspection PyProtectedMember
3737 from ruamel .yaml .comments import LineCol
38- from ruamel .yaml .compat import StreamTextType , VersionType
38+ from ruamel .yaml .compat import StreamTextType
3939 from ruamel .yaml .nodes import ScalarNode
4040 from ruamel .yaml .representer import RoundTripRepresenter
4141 from ruamel .yaml .tokens import CommentToken
@@ -758,7 +758,7 @@ def __init__( # pylint: disable=too-many-arguments
758758 pure : bool = False ,
759759 output : Any = None ,
760760 plug_ins : list [str ] | None = None ,
761- version : VersionType | None = None ,
761+ version : tuple [ int , int ] | None = None ,
762762 ):
763763 """Return a configured ``ruamel.yaml.YAML`` instance.
764764
@@ -822,8 +822,8 @@ def __init__( # pylint: disable=too-many-arguments
822822 if isinstance (version , str ):
823823 x , y = version .split ("." , maxsplit = 1 )
824824 version = (int (x ), int (y ))
825- self ._yaml_version_default : VersionType = version
826- self ._yaml_version : VersionType = self ._yaml_version_default
825+ self ._yaml_version_default : tuple [ int , int ] = version
826+ self ._yaml_version : tuple [ int , int ] = self ._yaml_version_default
827827 super ().__init__ (typ = typ , pure = pure , output = output , plug_ins = plug_ins )
828828
829829 # NB: We ignore some mypy issues because ruamel.yaml typehints are not great.
@@ -925,7 +925,7 @@ def _defaults_from_yamllint_config() -> dict[str, bool | int | str]:
925925 return cast (dict [str , Union [bool , int , str ]], config )
926926
927927 @property
928- def version (self ) -> VersionType | None :
928+ def version (self ) -> tuple [ int , int ] | None :
929929 """Return the YAML version used to parse or dump.
930930
931931 Ansible uses PyYAML which only supports YAML 1.1. ruamel.yaml defaults to 1.2.
@@ -938,7 +938,7 @@ def version(self) -> VersionType | None:
938938 return None
939939
940940 @version .setter
941- def version (self , value : str | tuple [int , int ] | None ) -> None :
941+ def version (self , value : tuple [int , int ] | None ) -> None :
942942 """Ensure that yaml version uses our default value.
943943
944944 The yaml Reader updates this value based on the ``%YAML`` directive in files.
0 commit comments