From 88a0f58c67dfec44cb885f3cbdb7ba1b278aecdc Mon Sep 17 00:00:00 2001 From: Brian Schubert Date: Sun, 13 Oct 2024 08:50:11 -0400 Subject: [PATCH] Reuse `hashlib._Hash` in `hmac` (#12793) --- stdlib/hmac.pyi | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/stdlib/hmac.pyi b/stdlib/hmac.pyi index ac1372dd1..eccfbdc23 100644 --- a/stdlib/hmac.pyi +++ b/stdlib/hmac.pyi @@ -1,12 +1,11 @@ from _typeshed import ReadableBuffer, SizedBuffer from collections.abc import Callable +from hashlib import _Hash as _HashlibHash from types import ModuleType -from typing import Any, AnyStr, overload +from typing import AnyStr, overload from typing_extensions import TypeAlias -# TODO more precise type for object of hashlib -_Hash: TypeAlias = Any -_DigestMod: TypeAlias = str | Callable[[], _Hash] | ModuleType +_DigestMod: TypeAlias = str | Callable[[], _HashlibHash] | ModuleType trans_5C: bytes trans_36: bytes