1111from typing import ClassVar
1212
1313from schema_salad .runtime import (
14+ Saveable ,
1415 file_uri ,
1516 parse_errors ,
1617 prefix_url ,
2425 from typing_extensions import Self
2526
2627import copy
27-
2828from collections .abc import MutableSequence , Sequence , MutableMapping
2929from io import StringIO
3030from itertools import chain
31- from typing import Any , Final , cast , Generic , TypeVar
31+ from typing import Any , Final , cast , Generic
3232from urllib .parse import urldefrag , urlsplit , urlunsplit
3333
3434from ruamel .yaml .comments import CommentedMap
3535
3636from schema_salad .exceptions import ValidationException , SchemaSaladException
37- from schema_salad .runtime import LoadingOptions , convert_typing , extract_type , Saveable
37+ from schema_salad .runtime import (
38+ LoadingOptions ,
39+ convert_typing ,
40+ extract_type ,
41+ SaveableType ,
42+ )
3843from schema_salad .sourceline import SourceLine , add_lc_filename
3944from schema_salad .utils import yaml_no_ts # requires schema-salad v8.2+
4045
41- S = TypeVar ("S" , bound = Saveable )
42-
43-
4446_vocab : Final [dict [str , str ]] = {}
4547_rvocab : Final [dict [str , str ]] = {}
4648
@@ -285,10 +287,10 @@ def load(
285287 return self .inner .load (r , baseuri , loadingOptions , docRoot , lc = lc )
286288
287289
288- class _RecordLoader (_Loader , Generic [S ]):
290+ class _RecordLoader (_Loader , Generic [SaveableType ]):
289291 def __init__ (
290292 self ,
291- classtype : type [S ],
293+ classtype : type [SaveableType ],
292294 container : str | None = None ,
293295 no_link_check : bool | None = None ,
294296 ) -> None :
@@ -303,7 +305,7 @@ def load(
303305 loadingOptions : LoadingOptions ,
304306 docRoot : str | None = None ,
305307 lc : Any | None = None ,
306- ) -> S :
308+ ) -> SaveableType :
307309 if not isinstance (doc , MutableMapping ):
308310 raise ValidationException (
309311 f"Value is a { convert_typing (extract_type (type (doc )))} , "
0 commit comments