stdlib: add argument default values (#9501)

This commit is contained in:
Jelle Zijlstra
2023-01-18 00:37:34 -08:00
committed by GitHub
parent 6cb934291f
commit ddfaca3200
272 changed files with 2529 additions and 2467 deletions

View File

@@ -79,7 +79,7 @@ def _strftime(value: _XMLDate) -> str: ... # undocumented
class DateTime:
value: str # undocumented
def __init__(self, value: int | str | datetime | time.struct_time | tuple[int, ...] = ...) -> None: ...
def __init__(self, value: int | str | datetime | time.struct_time | tuple[int, ...] = 0) -> None: ...
def __lt__(self, other: _DateTimeComparable) -> bool: ...
def __le__(self, other: _DateTimeComparable) -> bool: ...
def __gt__(self, other: _DateTimeComparable) -> bool: ...
@@ -96,7 +96,7 @@ def _datetime_type(data: str) -> datetime: ... # undocumented
class Binary:
data: bytes
def __init__(self, data: bytes | bytearray | None = ...) -> None: ...
def __init__(self, data: bytes | bytearray | None = None) -> None: ...
def decode(self, data: ReadableBuffer) -> None: ...
def encode(self, out: SupportsWrite[str]) -> None: ...
def __eq__(self, other: object) -> bool: ...
@@ -119,7 +119,7 @@ class Marshaller:
data: None
encoding: str | None
allow_none: bool
def __init__(self, encoding: str | None = ..., allow_none: bool = ...) -> None: ...
def __init__(self, encoding: str | None = None, allow_none: bool = False) -> None: ...
def dumps(self, values: Fault | Iterable[_Marshallable]) -> str: ...
def __dump(self, value: _Marshallable, write: _WriteCallback) -> None: ... # undocumented
def dump_nil(self, value: None, write: _WriteCallback) -> None: ...
@@ -150,7 +150,7 @@ class Unmarshaller:
append: Callable[[Any], None]
_use_datetime: bool
_use_builtin_types: bool
def __init__(self, use_datetime: bool = ..., use_builtin_types: bool = ...) -> None: ...
def __init__(self, use_datetime: bool = False, use_builtin_types: bool = False) -> None: ...
def close(self) -> tuple[_Marshallable, ...]: ...
def getmethodname(self) -> str | None: ...
def xml(self, encoding: str, standalone: Any) -> None: ... # Standalone is ignored
@@ -200,17 +200,19 @@ FastMarshaller: Marshaller | None
FastParser: ExpatParser | None
FastUnmarshaller: Unmarshaller | None
def getparser(use_datetime: bool = ..., use_builtin_types: bool = ...) -> tuple[ExpatParser, Unmarshaller]: ...
def getparser(use_datetime: bool = False, use_builtin_types: bool = False) -> tuple[ExpatParser, Unmarshaller]: ...
def dumps(
params: Fault | tuple[_Marshallable, ...],
methodname: str | None = ...,
methodresponse: bool | None = ...,
encoding: str | None = ...,
allow_none: bool = ...,
methodname: str | None = None,
methodresponse: bool | None = None,
encoding: str | None = None,
allow_none: bool = False,
) -> str: ...
def loads(data: str, use_datetime: bool = ..., use_builtin_types: bool = ...) -> tuple[tuple[_Marshallable, ...], str | None]: ...
def loads(
data: str, use_datetime: bool = False, use_builtin_types: bool = False
) -> tuple[tuple[_Marshallable, ...], str | None]: ...
def gzip_encode(data: ReadableBuffer) -> bytes: ... # undocumented
def gzip_decode(data: ReadableBuffer, max_decode: int = ...) -> bytes: ... # undocumented
def gzip_decode(data: ReadableBuffer, max_decode: int = 20971520) -> bytes: ... # undocumented
class GzipDecodedResponse(gzip.GzipFile): # undocumented
@@ -239,16 +241,16 @@ class Transport:
if sys.version_info >= (3, 8):
def __init__(
self, use_datetime: bool = ..., use_builtin_types: bool = ..., *, headers: Iterable[tuple[str, str]] = ...
self, use_datetime: bool = False, use_builtin_types: bool = False, *, headers: Iterable[tuple[str, str]] = ...
) -> None: ...
else:
def __init__(self, use_datetime: bool = ..., use_builtin_types: bool = ...) -> None: ...
def request(
self, host: _HostType, handler: str, request_body: _BufferWithLen, verbose: bool = ...
self, host: _HostType, handler: str, request_body: _BufferWithLen, verbose: bool = False
) -> tuple[_Marshallable, ...]: ...
def single_request(
self, host: _HostType, handler: str, request_body: _BufferWithLen, verbose: bool = ...
self, host: _HostType, handler: str, request_body: _BufferWithLen, verbose: bool = False
) -> tuple[_Marshallable, ...]: ...
def getparser(self) -> tuple[ExpatParser, Unmarshaller]: ...
def get_host_info(self, host: _HostType) -> tuple[str, list[tuple[str, str]], dict[str, str]]: ...
@@ -266,11 +268,11 @@ class SafeTransport(Transport):
if sys.version_info >= (3, 8):
def __init__(
self,
use_datetime: bool = ...,
use_builtin_types: bool = ...,
use_datetime: bool = False,
use_builtin_types: bool = False,
*,
headers: Iterable[tuple[str, str]] = ...,
context: Any | None = ...,
context: Any | None = None,
) -> None: ...
else:
def __init__(self, use_datetime: bool = ..., use_builtin_types: bool = ..., *, context: Any | None = ...) -> None: ...
@@ -290,15 +292,15 @@ class ServerProxy:
def __init__(
self,
uri: str,
transport: Transport | None = ...,
encoding: str | None = ...,
verbose: bool = ...,
allow_none: bool = ...,
use_datetime: bool = ...,
use_builtin_types: bool = ...,
transport: Transport | None = None,
encoding: str | None = None,
verbose: bool = False,
allow_none: bool = False,
use_datetime: bool = False,
use_builtin_types: bool = False,
*,
headers: Iterable[tuple[str, str]] = ...,
context: Any | None = ...,
context: Any | None = None,
) -> None: ...
else:
def __init__(

View File

@@ -32,7 +32,7 @@ _DispatchProtocol: TypeAlias = (
_DispatchArity0 | _DispatchArity1 | _DispatchArity2 | _DispatchArity3 | _DispatchArity4 | _DispatchArityN
)
def resolve_dotted_attribute(obj: Any, attr: str, allow_dotted_names: bool = ...) -> Any: ... # undocumented
def resolve_dotted_attribute(obj: Any, attr: str, allow_dotted_names: bool = True) -> Any: ... # undocumented
def list_public_methods(obj: Any) -> list[str]: ... # undocumented
class SimpleXMLRPCDispatcher: # undocumented
@@ -42,16 +42,16 @@ class SimpleXMLRPCDispatcher: # undocumented
allow_none: bool
encoding: str
use_builtin_types: bool
def __init__(self, allow_none: bool = ..., encoding: str | None = ..., use_builtin_types: bool = ...) -> None: ...
def register_instance(self, instance: Any, allow_dotted_names: bool = ...) -> None: ...
def register_function(self, function: _DispatchProtocol | None = ..., name: str | None = ...) -> Callable[..., Any]: ...
def __init__(self, allow_none: bool = False, encoding: str | None = None, use_builtin_types: bool = False) -> None: ...
def register_instance(self, instance: Any, allow_dotted_names: bool = False) -> None: ...
def register_function(self, function: _DispatchProtocol | None = None, name: str | None = None) -> Callable[..., Any]: ...
def register_introspection_functions(self) -> None: ...
def register_multicall_functions(self) -> None: ...
def _marshaled_dispatch(
self,
data: str,
dispatch_method: Callable[[str | None, tuple[_Marshallable, ...]], Fault | tuple[_Marshallable, ...]] | None = ...,
path: Any | None = ...,
dispatch_method: Callable[[str | None, tuple[_Marshallable, ...]], Fault | tuple[_Marshallable, ...]] | None = None,
path: Any | None = None,
) -> str: ... # undocumented
def system_listMethods(self) -> list[str]: ... # undocumented
def system_methodSignature(self, method_name: str) -> str: ... # undocumented
@@ -76,11 +76,11 @@ class SimpleXMLRPCServer(socketserver.TCPServer, SimpleXMLRPCDispatcher):
self,
addr: tuple[str, int],
requestHandler: type[SimpleXMLRPCRequestHandler] = ...,
logRequests: bool = ...,
allow_none: bool = ...,
encoding: str | None = ...,
bind_and_activate: bool = ...,
use_builtin_types: bool = ...,
logRequests: bool = True,
allow_none: bool = False,
encoding: str | None = None,
bind_and_activate: bool = True,
use_builtin_types: bool = False,
) -> None: ...
class MultiPathXMLRPCServer(SimpleXMLRPCServer): # undocumented
@@ -90,31 +90,31 @@ class MultiPathXMLRPCServer(SimpleXMLRPCServer): # undocumented
self,
addr: tuple[str, int],
requestHandler: type[SimpleXMLRPCRequestHandler] = ...,
logRequests: bool = ...,
allow_none: bool = ...,
encoding: str | None = ...,
bind_and_activate: bool = ...,
use_builtin_types: bool = ...,
logRequests: bool = True,
allow_none: bool = False,
encoding: str | None = None,
bind_and_activate: bool = True,
use_builtin_types: bool = False,
) -> None: ...
def add_dispatcher(self, path: str, dispatcher: SimpleXMLRPCDispatcher) -> SimpleXMLRPCDispatcher: ...
def get_dispatcher(self, path: str) -> SimpleXMLRPCDispatcher: ...
class CGIXMLRPCRequestHandler(SimpleXMLRPCDispatcher):
def __init__(self, allow_none: bool = ..., encoding: str | None = ..., use_builtin_types: bool = ...) -> None: ...
def __init__(self, allow_none: bool = False, encoding: str | None = None, use_builtin_types: bool = False) -> None: ...
def handle_xmlrpc(self, request_text: str) -> None: ...
def handle_get(self) -> None: ...
def handle_request(self, request_text: str | None = ...) -> None: ...
def handle_request(self, request_text: str | None = None) -> None: ...
class ServerHTMLDoc(pydoc.HTMLDoc): # undocumented
def docroutine( # type: ignore[override]
self,
object: object,
name: str,
mod: str | None = ...,
mod: str | None = None,
funcs: Mapping[str, str] = ...,
classes: Mapping[str, str] = ...,
methods: Mapping[str, str] = ...,
cl: type | None = ...,
cl: type | None = None,
) -> str: ...
def docserver(self, server_name: str, package_documentation: str, methods: dict[str, str]) -> str: ...
@@ -136,11 +136,11 @@ class DocXMLRPCServer(SimpleXMLRPCServer, XMLRPCDocGenerator):
self,
addr: tuple[str, int],
requestHandler: type[SimpleXMLRPCRequestHandler] = ...,
logRequests: bool = ...,
allow_none: bool = ...,
encoding: str | None = ...,
bind_and_activate: bool = ...,
use_builtin_types: bool = ...,
logRequests: bool = True,
allow_none: bool = False,
encoding: str | None = None,
bind_and_activate: bool = True,
use_builtin_types: bool = False,
) -> None: ...
class DocCGIXMLRPCRequestHandler(CGIXMLRPCRequestHandler, XMLRPCDocGenerator):