@@ -23,7 +23,7 @@ from functools import cache
2323from optparse import Values
2424from os import PathLike
2525from re import Pattern
26- from typing import IO , Any , AnyStr , BinaryIO , Generic , Literal , NamedTuple , TextIO , TypeVar , overload
26+ from typing import IO , Any , AnyStr , BinaryIO , Final , Generic , Literal , NamedTuple , TextIO , TypeVar , overload
2727from typing_extensions import Self , TypeAlias
2828from urllib .parse import _QueryType , _QuoteVia
2929from xml .etree import ElementTree as ET
@@ -42,16 +42,16 @@ class NO_DEFAULT: ...
4242
4343def IDENTITY (x : _T ) -> _T : ...
4444
45- ENGLISH_MONTH_NAMES : Sequence [str ]
46- MONTH_NAMES : Mapping [str , Sequence [str ]]
47- TIMEZONE_NAMES : Mapping [str , str ]
48- ACCENT_CHARS : Mapping [str , str ]
49- DATE_FORMATS : Sequence [str ]
50- DATE_FORMATS_DAY_FIRST : Sequence [str ]
51- DATE_FORMATS_MONTH_FIRST : Sequence [str ]
52- PACKED_CODES_RE : str
53- JSON_LD_RE : str
54- NUMBER_RE : str
45+ ENGLISH_MONTH_NAMES : Final [ Sequence [str ] ]
46+ MONTH_NAMES : Final [ Mapping [str , Sequence [str ] ]]
47+ TIMEZONE_NAMES : Final [ Mapping [str , str ] ]
48+ ACCENT_CHARS : Final [ Mapping [str , str ] ]
49+ DATE_FORMATS : Final [ Sequence [str ] ]
50+ DATE_FORMATS_DAY_FIRST : Final [ Sequence [str ] ]
51+ DATE_FORMATS_MONTH_FIRST : Final [ Sequence [str ] ]
52+ PACKED_CODES_RE : Final [ str ]
53+ JSON_LD_RE : Final [ str ]
54+ NUMBER_RE : Final [ str ]
5555
5656@cache
5757def preferredencoding () -> str : ...
@@ -452,19 +452,19 @@ def filter_dict(dct: Mapping[_K, _V], cndn: Callable[[_K, _V], bool] = ...) -> d
452452def merge_dicts (* dicts : Mapping [Hashable , Any ]) -> dict [Hashable , Any ]: ...
453453def encode_compat_str (string : str , encoding : str = ..., errors : str = "strict" ) -> str : ...
454454
455- US_RATINGS : Mapping [str , int ]
456- TV_PARENTAL_GUIDELINES : Mapping [str , int ]
455+ US_RATINGS : Final [ Mapping [str , int ] ]
456+ TV_PARENTAL_GUIDELINES : Final [ Mapping [str , int ] ]
457457
458458def parse_age_limit (s : int ) -> int | None : ...
459459def strip_jsonp (code : str ) -> str : ...
460460def js_to_json (code : str , vars : Mapping [str , Any ] = {}, * , strict : bool = False ) -> str : ...
461461def qualities (quality_ids : Sequence [int ]) -> Callable [[int ], int ]: ...
462462
463- POSTPROCESS_WHEN : tuple [str , ...]
464- DEFAULT_OUTTMPL : Mapping [str , str ]
465- OUTTMPL_TYPES : Mapping [str , str | None ]
466- STR_FORMAT_RE_TMPL : str
467- STR_FORMAT_TYPES : str
463+ POSTPROCESS_WHEN : Final [ tuple [str , ...] ]
464+ DEFAULT_OUTTMPL : Final [ Mapping [str , str ] ]
465+ OUTTMPL_TYPES : Final [ Mapping [str , str | None ] ]
466+ STR_FORMAT_RE_TMPL : Final [ str ]
467+ STR_FORMAT_TYPES : Final [ str ]
468468
469469def limit_length (s : str , length : int ) -> str : ...
470470def version_tuple (v : str ) -> tuple [int , ...]: ...
@@ -487,7 +487,7 @@ def urlhandle_detect_ext(url_handle: Response, default: str | type[NO_DEFAULT] =
487487def encode_data_uri (data : ReadableBuffer , mime_type : str ) -> str : ...
488488def age_restricted (content_limit : int | None , age_limit : int | None ) -> bool : ...
489489
490- BOMS : Collection [tuple [bytes , str ]]
490+ BOMS : Final [ Collection [tuple [bytes , str ] ]]
491491
492492def is_html (first_bytes : bytes ) -> bool : ...
493493def determine_protocol (info_dict : _InfoDict ) -> str : ...
@@ -551,10 +551,10 @@ def write_xattr(path: FileDescriptorOrPath, key: str, value: str) -> None: ...
551551def random_birthday (year_field : Hashable , month_field : Hashable , day_field : Hashable ) -> dict [Hashable , str ]: ...
552552def find_available_port (interface : str = "" ) -> Any | None : ...
553553
554- DOT_URL_LINK_TEMPLATE : str
555- DOT_WEBLOC_LINK_TEMPLATE : str
556- DOT_DESKTOP_LINK_TEMPLATE : str
557- LINK_TEMPLATES : Mapping [str , str ]
554+ DOT_URL_LINK_TEMPLATE : Final [ str ]
555+ DOT_WEBLOC_LINK_TEMPLATE : Final [ str ]
556+ DOT_DESKTOP_LINK_TEMPLATE : Final [ str ]
557+ LINK_TEMPLATES : Final [ Mapping [str , str ] ]
558558
559559def iri_to_uri (iri : str ) -> str : ...
560560def to_high_limit_path (path : PathLike [AnyStr ]) -> str : ...
@@ -620,8 +620,8 @@ class Namespace(types.SimpleNamespace):
620620 @property
621621 def items_ (self ) -> dict [str , Any ]: ...
622622
623- MEDIA_EXTENSIONS : Namespace
624- KNOWN_EXTENSIONS : tuple [str , ...]
623+ MEDIA_EXTENSIONS : Final [ Namespace ]
624+ KNOWN_EXTENSIONS : Final [ tuple [str , ...] ]
625625
626626class _UnsafeExtensionError (Exception ):
627627 ALLOWED_EXTENSIONS : frozenset [str ]
0 commit comments