@@ -23,7 +23,7 @@ from functools import cache
23
23
from optparse import Values
24
24
from os import PathLike
25
25
from 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
27
27
from typing_extensions import Self , TypeAlias
28
28
from urllib .parse import _QueryType , _QuoteVia
29
29
from xml .etree import ElementTree as ET
@@ -42,16 +42,16 @@ class NO_DEFAULT: ...
42
42
43
43
def IDENTITY (x : _T ) -> _T : ...
44
44
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 ]
55
55
56
56
@cache
57
57
def preferredencoding () -> str : ...
@@ -452,19 +452,19 @@ def filter_dict(dct: Mapping[_K, _V], cndn: Callable[[_K, _V], bool] = ...) -> d
452
452
def merge_dicts (* dicts : Mapping [Hashable , Any ]) -> dict [Hashable , Any ]: ...
453
453
def encode_compat_str (string : str , encoding : str = ..., errors : str = "strict" ) -> str : ...
454
454
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 ] ]
457
457
458
458
def parse_age_limit (s : int ) -> int | None : ...
459
459
def strip_jsonp (code : str ) -> str : ...
460
460
def js_to_json (code : str , vars : Mapping [str , Any ] = {}, * , strict : bool = False ) -> str : ...
461
461
def qualities (quality_ids : Sequence [int ]) -> Callable [[int ], int ]: ...
462
462
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 ]
468
468
469
469
def limit_length (s : str , length : int ) -> str : ...
470
470
def version_tuple (v : str ) -> tuple [int , ...]: ...
@@ -487,7 +487,7 @@ def urlhandle_detect_ext(url_handle: Response, default: str | type[NO_DEFAULT] =
487
487
def encode_data_uri (data : ReadableBuffer , mime_type : str ) -> str : ...
488
488
def age_restricted (content_limit : int | None , age_limit : int | None ) -> bool : ...
489
489
490
- BOMS : Collection [tuple [bytes , str ]]
490
+ BOMS : Final [ Collection [tuple [bytes , str ] ]]
491
491
492
492
def is_html (first_bytes : bytes ) -> bool : ...
493
493
def determine_protocol (info_dict : _InfoDict ) -> str : ...
@@ -551,10 +551,10 @@ def write_xattr(path: FileDescriptorOrPath, key: str, value: str) -> None: ...
551
551
def random_birthday (year_field : Hashable , month_field : Hashable , day_field : Hashable ) -> dict [Hashable , str ]: ...
552
552
def find_available_port (interface : str = "" ) -> Any | None : ...
553
553
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 ] ]
558
558
559
559
def iri_to_uri (iri : str ) -> str : ...
560
560
def to_high_limit_path (path : PathLike [AnyStr ]) -> str : ...
@@ -620,8 +620,8 @@ class Namespace(types.SimpleNamespace):
620
620
@property
621
621
def items_ (self ) -> dict [str , Any ]: ...
622
622
623
- MEDIA_EXTENSIONS : Namespace
624
- KNOWN_EXTENSIONS : tuple [str , ...]
623
+ MEDIA_EXTENSIONS : Final [ Namespace ]
624
+ KNOWN_EXTENSIONS : Final [ tuple [str , ...] ]
625
625
626
626
class _UnsafeExtensionError (Exception ):
627
627
ALLOWED_EXTENSIONS : frozenset [str ]
0 commit comments