mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
stdlib: fix many attributes which are read-only at runtime but read-write in the stub (#7395)
This commit is contained in:
@@ -9,6 +9,8 @@ class URLError(IOError):
|
||||
def __init__(self, reason: str | BaseException, filename: str | None = ...) -> None: ...
|
||||
|
||||
class HTTPError(URLError, addinfourl):
|
||||
@property
|
||||
def reason(self) -> str: ... # type: ignore[override]
|
||||
code: int
|
||||
def __init__(self, url: str, code: int, msg: str, hdrs: Message, fp: IO[bytes] | None) -> None: ...
|
||||
|
||||
|
||||
@@ -49,10 +49,14 @@ class _ResultMixinBytes(_ResultMixinBase[bytes]):
|
||||
def decode(self, encoding: str = ..., errors: str = ...) -> _ResultMixinStr: ...
|
||||
|
||||
class _NetlocResultMixinBase(Generic[AnyStr]):
|
||||
username: AnyStr | None
|
||||
password: AnyStr | None
|
||||
hostname: AnyStr | None
|
||||
port: int | None
|
||||
@property
|
||||
def username(self) -> AnyStr | None: ...
|
||||
@property
|
||||
def password(self) -> AnyStr | None: ...
|
||||
@property
|
||||
def hostname(self) -> AnyStr | None: ...
|
||||
@property
|
||||
def port(self) -> int | None: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user