mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
Use PEP 585 syntax in Python 2, protobuf & _ast stubs, where possible (#6949)
This commit is contained in:
@@ -1,18 +1,18 @@
|
||||
from types import FrameType, TracebackType
|
||||
from typing import Any, Callable, Iterable, List, Mapping, Optional, Text, Type, TypeVar
|
||||
from typing import Any, Callable, Iterable, Mapping, Optional, Text, TypeVar
|
||||
|
||||
# TODO recursive type
|
||||
_TF = Callable[[FrameType, str, Any], Optional[Callable[..., Any]]]
|
||||
|
||||
_PF = Callable[[FrameType, str, Any], None]
|
||||
|
||||
__all__: List[str]
|
||||
__all__: list[str]
|
||||
|
||||
def active_count() -> int: ...
|
||||
def activeCount() -> int: ...
|
||||
def current_thread() -> Thread: ...
|
||||
def currentThread() -> Thread: ...
|
||||
def enumerate() -> List[Thread]: ...
|
||||
def enumerate() -> list[Thread]: ...
|
||||
def settrace(func: _TF) -> None: ...
|
||||
def setprofile(func: _PF | None) -> None: ...
|
||||
def stack_size(size: int = ...) -> int: ...
|
||||
@@ -52,7 +52,7 @@ class Lock:
|
||||
def __init__(self) -> None: ...
|
||||
def __enter__(self) -> bool: ...
|
||||
def __exit__(
|
||||
self, exc_type: Type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
|
||||
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
|
||||
) -> bool | None: ...
|
||||
def acquire(self, blocking: bool = ...) -> bool: ...
|
||||
def release(self) -> None: ...
|
||||
@@ -62,7 +62,7 @@ class _RLock:
|
||||
def __init__(self) -> None: ...
|
||||
def __enter__(self) -> bool: ...
|
||||
def __exit__(
|
||||
self, exc_type: Type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
|
||||
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
|
||||
) -> bool | None: ...
|
||||
def acquire(self, blocking: bool = ...) -> bool: ...
|
||||
def release(self) -> None: ...
|
||||
@@ -73,7 +73,7 @@ class Condition:
|
||||
def __init__(self, lock: Lock | _RLock | None = ...) -> None: ...
|
||||
def __enter__(self) -> bool: ...
|
||||
def __exit__(
|
||||
self, exc_type: Type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
|
||||
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
|
||||
) -> bool | None: ...
|
||||
def acquire(self, blocking: bool = ...) -> bool: ...
|
||||
def release(self) -> None: ...
|
||||
@@ -85,7 +85,7 @@ class Condition:
|
||||
class Semaphore:
|
||||
def __init__(self, value: int = ...) -> None: ...
|
||||
def __exit__(
|
||||
self, exc_type: Type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
|
||||
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
|
||||
) -> bool | None: ...
|
||||
def acquire(self, blocking: bool = ...) -> bool: ...
|
||||
def __enter__(self, blocking: bool = ...) -> bool: ...
|
||||
|
||||
Reference in New Issue
Block a user