mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-19 23:09:55 +08:00
Use typing_extensions.Self instead of _typeshed.Self (#9702)
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
import queue
|
||||
from _typeshed import Self
|
||||
from collections.abc import Mapping
|
||||
from logging import Logger
|
||||
from types import TracebackType
|
||||
from typing import Any, ClassVar
|
||||
from typing_extensions import Literal, TypeAlias
|
||||
from typing_extensions import Literal, Self, TypeAlias
|
||||
|
||||
from . import connection, exceptions, request, response
|
||||
from .connection import BaseSSLError as BaseSSLError, ConnectionError as ConnectionError, HTTPException as HTTPException
|
||||
@@ -47,7 +46,7 @@ class ConnectionPool:
|
||||
host: str
|
||||
port: int | None
|
||||
def __init__(self, host: str, port: int | None = ...) -> None: ...
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
def __enter__(self) -> Self: ...
|
||||
def __exit__(
|
||||
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
|
||||
) -> Literal[False]: ...
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import io
|
||||
from _typeshed import Self
|
||||
from collections.abc import Iterable, Iterator, Mapping
|
||||
from http.client import HTTPMessage as _HttplibHTTPMessage, HTTPResponse as _HttplibHTTPResponse
|
||||
from typing import IO, Any
|
||||
from typing_extensions import Literal, TypeAlias
|
||||
from typing_extensions import Literal, Self, TypeAlias
|
||||
|
||||
from urllib3.connectionpool import HTTPConnection
|
||||
|
||||
@@ -83,7 +82,7 @@ class HTTPResponse(io.IOBase):
|
||||
def read(self, amt: int | None = ..., decode_content: bool | None = ..., cache_content: bool = ...) -> bytes: ...
|
||||
def stream(self, amt: int | None = ..., decode_content: bool | None = ...) -> Iterator[bytes]: ...
|
||||
@classmethod
|
||||
def from_httplib(cls: type[Self], r: _HttplibHTTPResponse, **response_kw: Any) -> Self: ...
|
||||
def from_httplib(cls, r: _HttplibHTTPResponse, **response_kw: Any) -> Self: ...
|
||||
def getheaders(self) -> HTTPHeaderDict: ...
|
||||
def getheader(self, name, default=...) -> str | None: ...
|
||||
def info(self) -> HTTPHeaderDict: ...
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import logging
|
||||
from _typeshed import Self
|
||||
from collections.abc import Collection
|
||||
from types import TracebackType
|
||||
from typing import Any, ClassVar, NamedTuple
|
||||
from typing_extensions import Literal
|
||||
from typing_extensions import Literal, Self
|
||||
|
||||
from .. import exceptions
|
||||
from ..connectionpool import ConnectionPool
|
||||
@@ -62,7 +61,7 @@ class Retry:
|
||||
remove_headers_on_redirect: Collection[str] = ...,
|
||||
method_whitelist: Collection[str] | None = ...,
|
||||
) -> None: ...
|
||||
def new(self: Self, **kw: Any) -> Self: ...
|
||||
def new(self, **kw: Any) -> Self: ...
|
||||
@classmethod
|
||||
def from_int(
|
||||
cls, retries: Retry | bool | int | None, redirect: bool | int | None = ..., default: Retry | bool | int | None = ...
|
||||
|
||||
Reference in New Issue
Block a user