mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
sockeserver: Add undocumented internals (#3924)
the `rfile` and `wfile` members are already implemented by StreamRequestHandler. In addition to them several (undocumented) class and instance variables exist according to <https://github.com/python/cpython/blob/master/Lib/socketserver.py#L742>: - `rbufsize` - `wbufsize` - `timeout` - `disable_nagle_algorithm` - `packet` and `socket` for datagrams The already exist with Python 2.7 <https://github.com/python/cpython/blob/2.7/Lib/SocketServer.py#L677> ```mermaid classDiagram BaseRequestHandler <|-- DatagramRequestHandler BaseRequestHandler <|-- StreamRequestHandler StreamRequestHandler <|-- BaseHTTPRequestHandler ```
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
# NB: SocketServer.pyi and socketserver.pyi must remain consistent!
|
||||
# Stubs for socketserver
|
||||
|
||||
from typing import Any, BinaryIO, Callable, List, Optional, Tuple, Type, Text, Union
|
||||
from typing import Any, BinaryIO, Callable, ClassVar, List, Optional, Tuple, Type, Text, Union
|
||||
from socket import SocketType
|
||||
import sys
|
||||
import types
|
||||
@@ -118,9 +118,16 @@ class BaseRequestHandler:
|
||||
def finish(self) -> None: ...
|
||||
|
||||
class StreamRequestHandler(BaseRequestHandler):
|
||||
rbufsize: ClassVar[int] # Undocumented
|
||||
wbufsize: ClassVar[int] # Undocumented
|
||||
timeout: ClassVar[Optional[float]] # Undocumented
|
||||
disable_nagle_algorithm: ClassVar[bool] # Undocumented
|
||||
connection: SocketType # Undocumented
|
||||
rfile: BinaryIO
|
||||
wfile: BinaryIO
|
||||
|
||||
class DatagramRequestHandler(BaseRequestHandler):
|
||||
packet: SocketType # Undocumented
|
||||
socket: SocketType # Undocumented
|
||||
rfile: BinaryIO
|
||||
wfile: BinaryIO
|
||||
|
||||
Reference in New Issue
Block a user