mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
Use PEP 585 syntax in Python 2, protobuf & _ast stubs, where possible (#6949)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import sys
|
||||
from _typeshed import FileDescriptorLike
|
||||
from typing import Any, Iterable, List, Tuple
|
||||
from typing import Any, Iterable
|
||||
|
||||
if sys.platform != "win32":
|
||||
PIPE_BUF: int
|
||||
@@ -21,11 +21,11 @@ class poll:
|
||||
def register(self, fd: FileDescriptorLike, eventmask: int = ...) -> None: ...
|
||||
def modify(self, fd: FileDescriptorLike, eventmask: int) -> None: ...
|
||||
def unregister(self, fd: FileDescriptorLike) -> None: ...
|
||||
def poll(self, timeout: float | None = ...) -> List[Tuple[int, int]]: ...
|
||||
def poll(self, timeout: float | None = ...) -> list[tuple[int, int]]: ...
|
||||
|
||||
def select(
|
||||
__rlist: Iterable[Any], __wlist: Iterable[Any], __xlist: Iterable[Any], __timeout: float | None = ...
|
||||
) -> Tuple[List[Any], List[Any], List[Any]]: ...
|
||||
) -> tuple[list[Any], list[Any], list[Any]]: ...
|
||||
|
||||
class error(Exception): ...
|
||||
|
||||
@@ -54,7 +54,7 @@ if sys.platform != "linux" and sys.platform != "win32":
|
||||
def close(self) -> None: ...
|
||||
def control(
|
||||
self, __changelist: Iterable[kevent] | None, __maxevents: int, __timeout: float | None = ...
|
||||
) -> List[kevent]: ...
|
||||
) -> list[kevent]: ...
|
||||
def fileno(self) -> int: ...
|
||||
@classmethod
|
||||
def fromfd(cls, __fd: FileDescriptorLike) -> kqueue: ...
|
||||
@@ -106,7 +106,7 @@ if sys.platform == "linux":
|
||||
def register(self, fd: FileDescriptorLike, eventmask: int = ...) -> None: ...
|
||||
def modify(self, fd: FileDescriptorLike, eventmask: int) -> None: ...
|
||||
def unregister(self, fd: FileDescriptorLike) -> None: ...
|
||||
def poll(self, timeout: float | None = ..., maxevents: int = ...) -> List[Tuple[int, int]]: ...
|
||||
def poll(self, timeout: float | None = ..., maxevents: int = ...) -> list[tuple[int, int]]: ...
|
||||
@classmethod
|
||||
def fromfd(cls, __fd: FileDescriptorLike) -> epoll: ...
|
||||
EPOLLERR: int
|
||||
|
||||
Reference in New Issue
Block a user