mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
Big diff: Use new "|" union syntax (#5872)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import sys
|
||||
from _typeshed import FileDescriptor, FileDescriptorLike, Self
|
||||
from abc import ABCMeta, abstractmethod
|
||||
from typing import Any, List, Mapping, NamedTuple, Optional, Tuple
|
||||
from typing import Any, List, Mapping, NamedTuple, Tuple
|
||||
|
||||
_EventMask = int
|
||||
|
||||
@@ -21,7 +21,7 @@ class BaseSelector(metaclass=ABCMeta):
|
||||
def unregister(self, fileobj: FileDescriptorLike) -> SelectorKey: ...
|
||||
def modify(self, fileobj: FileDescriptorLike, events: _EventMask, data: Any = ...) -> SelectorKey: ...
|
||||
@abstractmethod
|
||||
def select(self, timeout: Optional[float] = ...) -> List[Tuple[SelectorKey, _EventMask]]: ...
|
||||
def select(self, timeout: float | None = ...) -> List[Tuple[SelectorKey, _EventMask]]: ...
|
||||
def close(self) -> None: ...
|
||||
def get_key(self, fileobj: FileDescriptorLike) -> SelectorKey: ...
|
||||
@abstractmethod
|
||||
@@ -32,14 +32,14 @@ class BaseSelector(metaclass=ABCMeta):
|
||||
class SelectSelector(BaseSelector):
|
||||
def register(self, fileobj: FileDescriptorLike, events: _EventMask, data: Any = ...) -> SelectorKey: ...
|
||||
def unregister(self, fileobj: FileDescriptorLike) -> SelectorKey: ...
|
||||
def select(self, timeout: Optional[float] = ...) -> List[Tuple[SelectorKey, _EventMask]]: ...
|
||||
def select(self, timeout: float | None = ...) -> List[Tuple[SelectorKey, _EventMask]]: ...
|
||||
def get_map(self) -> Mapping[FileDescriptorLike, SelectorKey]: ...
|
||||
|
||||
if sys.platform != "win32":
|
||||
class PollSelector(BaseSelector):
|
||||
def register(self, fileobj: FileDescriptorLike, events: _EventMask, data: Any = ...) -> SelectorKey: ...
|
||||
def unregister(self, fileobj: FileDescriptorLike) -> SelectorKey: ...
|
||||
def select(self, timeout: Optional[float] = ...) -> List[Tuple[SelectorKey, _EventMask]]: ...
|
||||
def select(self, timeout: float | None = ...) -> List[Tuple[SelectorKey, _EventMask]]: ...
|
||||
def get_map(self) -> Mapping[FileDescriptorLike, SelectorKey]: ...
|
||||
|
||||
if sys.platform == "linux":
|
||||
@@ -47,25 +47,25 @@ if sys.platform == "linux":
|
||||
def fileno(self) -> int: ...
|
||||
def register(self, fileobj: FileDescriptorLike, events: _EventMask, data: Any = ...) -> SelectorKey: ...
|
||||
def unregister(self, fileobj: FileDescriptorLike) -> SelectorKey: ...
|
||||
def select(self, timeout: Optional[float] = ...) -> List[Tuple[SelectorKey, _EventMask]]: ...
|
||||
def select(self, timeout: float | None = ...) -> List[Tuple[SelectorKey, _EventMask]]: ...
|
||||
def get_map(self) -> Mapping[FileDescriptorLike, SelectorKey]: ...
|
||||
|
||||
class DevpollSelector(BaseSelector):
|
||||
def fileno(self) -> int: ...
|
||||
def register(self, fileobj: FileDescriptorLike, events: _EventMask, data: Any = ...) -> SelectorKey: ...
|
||||
def unregister(self, fileobj: FileDescriptorLike) -> SelectorKey: ...
|
||||
def select(self, timeout: Optional[float] = ...) -> List[Tuple[SelectorKey, _EventMask]]: ...
|
||||
def select(self, timeout: float | None = ...) -> List[Tuple[SelectorKey, _EventMask]]: ...
|
||||
def get_map(self) -> Mapping[FileDescriptorLike, SelectorKey]: ...
|
||||
|
||||
class KqueueSelector(BaseSelector):
|
||||
def fileno(self) -> int: ...
|
||||
def register(self, fileobj: FileDescriptorLike, events: _EventMask, data: Any = ...) -> SelectorKey: ...
|
||||
def unregister(self, fileobj: FileDescriptorLike) -> SelectorKey: ...
|
||||
def select(self, timeout: Optional[float] = ...) -> List[Tuple[SelectorKey, _EventMask]]: ...
|
||||
def select(self, timeout: float | None = ...) -> List[Tuple[SelectorKey, _EventMask]]: ...
|
||||
def get_map(self) -> Mapping[FileDescriptorLike, SelectorKey]: ...
|
||||
|
||||
class DefaultSelector(BaseSelector):
|
||||
def register(self, fileobj: FileDescriptorLike, events: _EventMask, data: Any = ...) -> SelectorKey: ...
|
||||
def unregister(self, fileobj: FileDescriptorLike) -> SelectorKey: ...
|
||||
def select(self, timeout: Optional[float] = ...) -> List[Tuple[SelectorKey, _EventMask]]: ...
|
||||
def select(self, timeout: float | None = ...) -> List[Tuple[SelectorKey, _EventMask]]: ...
|
||||
def get_map(self) -> Mapping[FileDescriptorLike, SelectorKey]: ...
|
||||
|
||||
Reference in New Issue
Block a user