@@ -15,7 +15,7 @@ from _typeshed import (
1515)
1616from collections .abc import Callable , Container , Iterable , MutableMapping , MutableSequence , Sequence
1717from operator import attrgetter as attrgetter , itemgetter as itemgetter , methodcaller as methodcaller
18- from typing import Any , AnyStr , Protocol , SupportsAbs , SupportsIndex , TypeVar , overload , type_check_only
18+ from typing import Any , Protocol , SupportsAbs , SupportsIndex , TypeVar , overload , type_check_only
1919from typing_extensions import ParamSpec , TypeAlias , TypeIs
2020
2121_R = TypeVar ("_R" )
@@ -280,7 +280,16 @@ def ixor(a: _SupportsIXOr[_T_contra, _T_co], b: _T_contra, /) -> _T_co: ...
280280if sys .version_info >= (3 , 11 ):
281281 def call (obj : Callable [_P , _R ], / , * args : _P .args , ** kwargs : _P .kwargs ) -> _R : ...
282282
283- def _compare_digest (a : AnyStr , b : AnyStr , / ) -> bool : ...
283+ if sys .version_info >= (3 , 12 ):
284+ from collections .abc import Buffer
285+ _B = TypeVar ("_B" , bound = Buffer )
286+ @overload
287+ def _compare_digest (a : str , b : str , / ) -> bool : ...
288+ @overload
289+ def _compare_digest (a : _B , b : _B , / ) -> bool : ...
290+ else :
291+ from typing import AnyStr
292+ def _compare_digest (a : AnyStr , b : AnyStr , / ) -> bool : ...
284293
285294if sys .version_info >= (3 , 14 ):
286295 def is_none (a : object , / ) -> TypeIs [None ]: ...
0 commit comments