mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-04-28 09:25:33 +08:00
socket: constructor accepts bytes on Windows (#9095)
https://github.com/python/cpython/blob/d04899abb0da4cc7c0a390f5bc52d57ace8955fd/Modules/socketmodule.c#L5318 This is used in `socket.fromshare`. It must be bytes, not some other buffer.
This commit is contained in:
+5
-1
@@ -583,7 +583,11 @@ class socket:
|
||||
def proto(self) -> int: ...
|
||||
@property
|
||||
def timeout(self) -> float | None: ...
|
||||
def __init__(self, family: int = ..., type: int = ..., proto: int = ..., fileno: _FD | None = ...) -> None: ...
|
||||
if sys.platform == "win32":
|
||||
def __init__(self, family: int = ..., type: int = ..., proto: int = ..., fileno: _FD | bytes | None = ...) -> None: ...
|
||||
else:
|
||||
def __init__(self, family: int = ..., type: int = ..., proto: int = ..., fileno: _FD | None = ...) -> None: ...
|
||||
|
||||
def bind(self, __address: _Address) -> None: ...
|
||||
def close(self) -> None: ...
|
||||
def connect(self, __address: _Address) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user