mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-17 13:59:45 +08:00
Use TypeAlias where possible for type aliases (#7630)
This commit is contained in:
@@ -3,7 +3,7 @@ from contextlib import AbstractContextManager
|
||||
from stat import S_IMODE as S_IMODE
|
||||
from types import TracebackType
|
||||
from typing import IO, Any, Callable, Sequence
|
||||
from typing_extensions import Literal
|
||||
from typing_extensions import Literal, TypeAlias
|
||||
|
||||
import paramiko
|
||||
from paramiko import AuthenticationException as AuthenticationException
|
||||
@@ -32,8 +32,8 @@ class CnOpts:
|
||||
def __init__(self, knownhosts: str | None = ...) -> None: ...
|
||||
def get_hostkey(self, host: str) -> paramiko.PKey: ...
|
||||
|
||||
_Callback = Callable[[int, int], Any]
|
||||
_Path = str | bytes
|
||||
_Callback: TypeAlias = Callable[[int, int], Any]
|
||||
_Path: TypeAlias = str | bytes
|
||||
|
||||
class Connection:
|
||||
def __init__(
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
from collections.abc import Callable, Iterator
|
||||
from contextlib import AbstractContextManager
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
def known_hosts() -> str: ...
|
||||
def st_mode_to_int(val: int) -> int: ...
|
||||
@@ -26,7 +27,7 @@ def path_advance(thepath: str, sep: str = ...) -> Iterator[str]: ...
|
||||
def path_retreat(thepath: str, sep: str = ...) -> Iterator[str]: ...
|
||||
def reparent(newparent: str, oldpath: str) -> str: ...
|
||||
|
||||
_PathCallback = Callable[[str], None]
|
||||
_PathCallback: TypeAlias = Callable[[str], None]
|
||||
|
||||
def walktree(
|
||||
localpath: str, fcallback: _PathCallback, dcallback: _PathCallback, ucallback: _PathCallback, recurse: bool = ...
|
||||
|
||||
Reference in New Issue
Block a user