From 3fe1f5d6c46b39b8b4632aadc70477a729241d25 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Tue, 21 Jun 2022 16:20:13 +0100 Subject: [PATCH] `requests`, `regex`: use re-exports instead of assignments in a few places (#8127) --- stubs/regex/regex/regex.pyi | 3 +-- stubs/requests/requests/models.pyi | 8 +++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/stubs/regex/regex/regex.pyi b/stubs/regex/regex/regex.pyi index 3cad72224..86cb4ed83 100644 --- a/stubs/regex/regex/regex.pyi +++ b/stubs/regex/regex/regex.pyi @@ -3,6 +3,7 @@ from collections.abc import Callable from typing import Any, AnyStr, overload from . import _regex +from ._regex import Match as Match, Pattern as Pattern from ._regex_core import * __version__: str @@ -306,6 +307,4 @@ def cache_all(value: None) -> bool: ... def escape(pattern: AnyStr, special_only: bool = ..., literal_spaces: bool = ...) -> AnyStr: ... def template(pattern: AnyStr | _regex.Pattern[AnyStr], flags: int = ...) -> _regex.Pattern[AnyStr]: ... -Pattern = _regex.Pattern[AnyStr] -Match = _regex.Match[AnyStr] Regex = compile diff --git a/stubs/requests/requests/models.pyi b/stubs/requests/requests/models.pyi index 38fb47453..e58361869 100644 --- a/stubs/requests/requests/models.pyi +++ b/stubs/requests/requests/models.pyi @@ -2,17 +2,15 @@ import datetime from _typeshed import Self from collections.abc import Callable, Iterator from json import JSONDecoder -from typing import Any, TypeVar +from typing import Any from urllib3 import exceptions as urllib3_exceptions, fields, filepost, util -from . import auth, cookies, exceptions, hooks, status_codes, structures, utils +from . import auth, cookies, exceptions, hooks, status_codes, utils from .cookies import RequestsCookieJar - -_VT = TypeVar("_VT") +from .structures import CaseInsensitiveDict as CaseInsensitiveDict default_hooks = hooks.default_hooks -CaseInsensitiveDict = structures.CaseInsensitiveDict[_VT] HTTPBasicAuth = auth.HTTPBasicAuth cookiejar_from_dict = cookies.cookiejar_from_dict get_cookie_header = cookies.get_cookie_header