mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
Big diff: Use new "|" union syntax (#5872)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import sys
|
||||
from _typeshed import FileDescriptorLike, Self
|
||||
from types import TracebackType
|
||||
from typing import Any, Iterable, List, Optional, Tuple, Type
|
||||
from typing import Any, Iterable, List, Tuple, Type
|
||||
|
||||
if sys.platform != "win32":
|
||||
PIPE_BUF: int
|
||||
@@ -22,10 +22,10 @@ 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: Optional[float] = ...) -> 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: Optional[float] = ...
|
||||
__rlist: Iterable[Any], __wlist: Iterable[Any], __xlist: Iterable[Any], __timeout: float | None = ...
|
||||
) -> Tuple[List[Any], List[Any], List[Any]]: ...
|
||||
|
||||
error = OSError
|
||||
@@ -54,7 +54,7 @@ if sys.platform != "linux" and sys.platform != "win32":
|
||||
def __init__(self) -> None: ...
|
||||
def close(self) -> None: ...
|
||||
def control(
|
||||
self, __changelist: Optional[Iterable[kevent]], __maxevents: int, __timeout: Optional[float] = ...
|
||||
self, __changelist: Iterable[kevent] | None, __maxevents: int, __timeout: float | None = ...
|
||||
) -> List[kevent]: ...
|
||||
def fileno(self) -> int: ...
|
||||
@classmethod
|
||||
@@ -104,9 +104,9 @@ if sys.platform == "linux":
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
def __exit__(
|
||||
self,
|
||||
exc_type: Optional[Type[BaseException]] = ...,
|
||||
exc_val: Optional[BaseException] = ...,
|
||||
exc_tb: Optional[TracebackType] = ...,
|
||||
exc_type: Type[BaseException] | None = ...,
|
||||
exc_val: BaseException | None = ...,
|
||||
exc_tb: TracebackType | None = ...,
|
||||
) -> None: ...
|
||||
def close(self) -> None: ...
|
||||
closed: bool
|
||||
@@ -114,7 +114,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: Optional[float] = ..., 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
|
||||
@@ -140,4 +140,4 @@ if sys.platform != "linux" and sys.platform != "darwin" and sys.platform != "win
|
||||
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: Optional[float] = ...) -> List[Tuple[int, int]]: ...
|
||||
def poll(self, timeout: float | None = ...) -> List[Tuple[int, int]]: ...
|
||||
|
||||
Reference in New Issue
Block a user