mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-24 20:12:08 +08:00
Use PEP 585 syntax wherever possible (#6717)
This commit is contained in:
@@ -3,11 +3,11 @@ import pydoc
|
||||
import socketserver
|
||||
import sys
|
||||
from datetime import datetime
|
||||
from typing import Any, Callable, Dict, Iterable, List, Mapping, Pattern, Protocol, Tuple, Type, Union
|
||||
from typing import Any, Callable, Iterable, Mapping, Pattern, Protocol, Type, Union
|
||||
from xmlrpc.client import Fault
|
||||
|
||||
# TODO: Recursive type on tuple, list, dict
|
||||
_Marshallable = Union[None, bool, int, float, str, bytes, Tuple[Any, ...], List[Any], Dict[Any, Any], datetime]
|
||||
_Marshallable = Union[None, bool, int, float, str, bytes, tuple[Any, ...], list[Any], dict[Any, Any], datetime]
|
||||
|
||||
# The dispatch accepts anywhere from 0 to N arguments, no easy way to allow this in mypy
|
||||
class _DispatchArity0(Protocol):
|
||||
@@ -53,7 +53,7 @@ class SimpleXMLRPCDispatcher: # undocumented
|
||||
def _marshaled_dispatch(
|
||||
self,
|
||||
data: str,
|
||||
dispatch_method: Callable[[str | None, Tuple[_Marshallable, ...]], Fault | Tuple[_Marshallable, ...]] | None = ...,
|
||||
dispatch_method: Callable[[str | None, tuple[_Marshallable, ...]], Fault | tuple[_Marshallable, ...]] | None = ...,
|
||||
path: Any | None = ...,
|
||||
) -> str: ... # undocumented
|
||||
def system_listMethods(self) -> list[str]: ... # undocumented
|
||||
@@ -109,7 +109,7 @@ class MultiPathXMLRPCServer(SimpleXMLRPCServer): # undocumented
|
||||
def _marshaled_dispatch(
|
||||
self,
|
||||
data: str,
|
||||
dispatch_method: Callable[[str | None, Tuple[_Marshallable, ...]], Fault | Tuple[_Marshallable, ...]] | None = ...,
|
||||
dispatch_method: Callable[[str | None, tuple[_Marshallable, ...]], Fault | tuple[_Marshallable, ...]] | None = ...,
|
||||
path: Any | None = ...,
|
||||
) -> str: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user