Skip to content

Commit 5fb54bd

Browse files
_operator: Accept readable buffers in _compare_digest (#16211)
1 parent 6fba3ae commit 5fb54bd

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

stdlib/_operator.pyi

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import sys
22
from _typeshed import (
3+
ReadableBuffer,
34
SupportsAdd,
45
SupportsGetItem,
56
SupportsMod,
@@ -12,7 +13,7 @@ from _typeshed import (
1213
)
1314
from collections.abc import Callable, Container, Iterable, MutableMapping, MutableSequence, Sequence
1415
from operator import attrgetter as attrgetter, itemgetter as itemgetter, methodcaller as methodcaller
15-
from typing import Any, AnyStr, ParamSpec, Protocol, SupportsAbs, SupportsIndex, TypeAlias, TypeVar, overload, type_check_only
16+
from typing import Any, ParamSpec, Protocol, SupportsAbs, SupportsIndex, TypeAlias, TypeVar, overload, type_check_only
1617
from typing_extensions import TypeIs
1718

1819
_R = TypeVar("_R")
@@ -150,7 +151,10 @@ def ixor(a, b, /): ...
150151
if sys.version_info >= (3, 11):
151152
def call(obj: Callable[_P, _R], /, *args: _P.args, **kwargs: _P.kwargs) -> _R: ...
152153

153-
def _compare_digest(a: AnyStr, b: AnyStr, /) -> bool: ...
154+
@overload
155+
def _compare_digest(a: ReadableBuffer, b: ReadableBuffer, /) -> bool: ...
156+
@overload
157+
def _compare_digest(a: str, b: str, /) -> bool: ...
154158

155159
if sys.version_info >= (3, 14):
156160
def is_none(a: object, /) -> TypeIs[None]: ...

0 commit comments

Comments
 (0)