mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
Update select and selectors to use _HasFileno protocol (#3057)
This commit is contained in:
committed by
Jelle Zijlstra
parent
1f740a7926
commit
d36a519b95
@@ -1,9 +1,10 @@
|
||||
import sys
|
||||
from typing import Any, Optional, Sequence, Tuple, Iterable, List, Union
|
||||
from typing import Any, Iterable, List, Optional, Protocol, Sequence, Tuple, Union
|
||||
|
||||
# When we have protocols, this should change to a protocol with a fileno method
|
||||
# See https://docs.python.org/3/c-api/file.html#c.PyObject_AsFileDescriptor
|
||||
_FileDescriptor = Union[int, Any]
|
||||
class _HasFileno(Protocol):
|
||||
def fileno(self) -> int: ...
|
||||
|
||||
_FileDescriptor = Union[int, _HasFileno]
|
||||
|
||||
EPOLLERR: int
|
||||
EPOLLET: int
|
||||
|
||||
Reference in New Issue
Block a user