mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
Use TypeAlias for type aliases where possible, part II (#7667)
This commit is contained in:
@@ -2,20 +2,20 @@ import queue
|
||||
import sys
|
||||
import threading
|
||||
from _typeshed import Self
|
||||
from builtins import dict as _dict, list as _list # Conflicts with method names
|
||||
from collections.abc import Callable, Iterable, Mapping, Sequence
|
||||
from types import TracebackType
|
||||
from typing import Any, AnyStr, Generic, TypeVar
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
from .connection import Connection
|
||||
from .context import BaseContext
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
from .shared_memory import _SLT, ShareableList, SharedMemory
|
||||
from .shared_memory import _SLT, ShareableList as _ShareableList, SharedMemory as _SharedMemory
|
||||
|
||||
__all__ = ["BaseManager", "SyncManager", "BaseProxy", "Token", "SharedMemoryManager"]
|
||||
|
||||
_SharedMemory = SharedMemory
|
||||
_ShareableList = ShareableList
|
||||
else:
|
||||
__all__ = ["BaseManager", "SyncManager", "BaseProxy", "Token"]
|
||||
|
||||
@@ -31,7 +31,7 @@ class Namespace:
|
||||
def __getattr__(self, __name: str) -> Any: ...
|
||||
def __setattr__(self, __name: str, __value: Any) -> None: ...
|
||||
|
||||
_Namespace = Namespace
|
||||
_Namespace: TypeAlias = Namespace
|
||||
|
||||
class Token:
|
||||
typeid: str | bytes | None
|
||||
@@ -101,10 +101,6 @@ class BaseManager:
|
||||
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
|
||||
) -> None: ...
|
||||
|
||||
# Conflicts with method names
|
||||
_dict = dict
|
||||
_list = list
|
||||
|
||||
class SyncManager(BaseManager):
|
||||
def BoundedSemaphore(self, value: Any = ...) -> threading.BoundedSemaphore: ...
|
||||
def Condition(self, lock: Any = ...) -> threading.Condition: ...
|
||||
|
||||
Reference in New Issue
Block a user