Use _typeshed.FileDescriptorOrPath in stubs (#9695)

This commit is contained in:
Avasam
2023-02-09 02:30:19 -05:00
committed by GitHub
parent 6d535bf0a3
commit 372073d35b
13 changed files with 39 additions and 53 deletions

View File

@@ -1,4 +1,3 @@
from _typeshed import FileDescriptor, StrOrBytesPath
from collections.abc import Callable
from typing import TypeVar
from typing_extensions import TypeAlias
@@ -9,4 +8,3 @@ from Xlib.protocol.rq import Request
_T = TypeVar("_T")
ErrorHandler: TypeAlias = Callable[[XError, Request | None], _T]
Unused: TypeAlias = object
OpenFile: TypeAlias = StrOrBytesPath | FileDescriptor

View File

@@ -1,4 +1,4 @@
from Xlib._typing import OpenFile
from _typeshed import FileDescriptorOrPath
FamilyInternet: int
FamilyDECnet: int
@@ -9,7 +9,7 @@ FamilyLocal: int
class Xauthority:
entries: list[tuple[bytes, bytes, bytes, bytes, bytes]]
def __init__(self, filename: OpenFile | None = ...) -> None: ...
def __init__(self, filename: FileDescriptorOrPath | None = ...) -> None: ...
def __len__(self) -> int: ...
def __getitem__(self, i: int) -> tuple[bytes, bytes, bytes, bytes, bytes]: ...
def get_best_auth(