mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-09 13:02:22 +08:00
Big diff: Use new "|" union syntax (#5872)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import sys
|
||||
from logging import Logger
|
||||
from types import TracebackType
|
||||
from typing import Optional, Type, Union
|
||||
from typing import Type
|
||||
|
||||
def logger() -> Logger: ...
|
||||
|
||||
@@ -13,24 +13,24 @@ class _Acquire_ReturnProxy:
|
||||
def __init__(self, lock: str) -> None: ...
|
||||
def __enter__(self) -> str: ...
|
||||
def __exit__(
|
||||
self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], traceback: Optional[TracebackType]
|
||||
self, exc_type: Type[BaseException] | None, exc_val: BaseException | None, traceback: TracebackType | None
|
||||
) -> None: ...
|
||||
|
||||
class BaseFileLock:
|
||||
def __init__(self, lock_file: str, timeout: Union[float, int, str] = ...) -> None: ...
|
||||
def __init__(self, lock_file: str, timeout: float | int | str = ...) -> None: ...
|
||||
@property
|
||||
def lock_file(self) -> str: ...
|
||||
@property
|
||||
def timeout(self) -> float: ...
|
||||
@timeout.setter
|
||||
def timeout(self, value: Union[int, str, float]) -> None: ... # type: ignore
|
||||
def timeout(self, value: int | str | float) -> None: ... # type: ignore
|
||||
@property
|
||||
def is_locked(self) -> bool: ...
|
||||
def acquire(self, timeout: Optional[float] = ..., poll_intervall: float = ...) -> _Acquire_ReturnProxy: ...
|
||||
def acquire(self, timeout: float | None = ..., poll_intervall: float = ...) -> _Acquire_ReturnProxy: ...
|
||||
def release(self, force: bool = ...) -> None: ...
|
||||
def __enter__(self) -> BaseFileLock: ...
|
||||
def __exit__(
|
||||
self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], traceback: Optional[TracebackType]
|
||||
self, exc_type: Type[BaseException] | None, exc_val: BaseException | None, traceback: TracebackType | None
|
||||
) -> None: ...
|
||||
def __del__(self) -> None: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user