mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
Use PEP 604 syntax wherever possible (#7493)
This commit is contained in:
@@ -20,7 +20,7 @@ from multiprocessing.process import active_children as active_children, current_
|
||||
# multiprocessing.queues or the aliases defined below. See #4266 for discussion.
|
||||
from multiprocessing.queues import JoinableQueue as JoinableQueue, Queue as Queue, SimpleQueue as SimpleQueue
|
||||
from multiprocessing.spawn import freeze_support as freeze_support
|
||||
from typing import Any, Union, overload
|
||||
from typing import Any, overload
|
||||
from typing_extensions import Literal
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
@@ -134,7 +134,7 @@ _SemaphoreType = synchronize.Semaphore
|
||||
# be identical (modulo self).
|
||||
|
||||
# Synchronization primitives
|
||||
_LockLike = Union[synchronize.Lock, synchronize.RLock]
|
||||
_LockLike = synchronize.Lock | synchronize.RLock
|
||||
RawValue = context._default_context.RawValue
|
||||
RawArray = context._default_context.RawArray
|
||||
Value = context._default_context.Value
|
||||
|
||||
@@ -8,7 +8,7 @@ from multiprocessing import queues, synchronize
|
||||
from multiprocessing.pool import Pool as _Pool
|
||||
from multiprocessing.process import BaseProcess
|
||||
from multiprocessing.sharedctypes import SynchronizedArray, SynchronizedBase
|
||||
from typing import Any, ClassVar, TypeVar, Union, overload
|
||||
from typing import Any, ClassVar, TypeVar, overload
|
||||
from typing_extensions import Literal
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
@@ -16,7 +16,7 @@ if sys.version_info >= (3, 8):
|
||||
else:
|
||||
__all__: list[str] = []
|
||||
|
||||
_LockLike = Union[synchronize.Lock, synchronize.RLock]
|
||||
_LockLike = synchronize.Lock | synchronize.RLock
|
||||
_CT = TypeVar("_CT", bound=_CData)
|
||||
|
||||
class ProcessError(Exception): ...
|
||||
|
||||
@@ -3,11 +3,11 @@ import threading
|
||||
from contextlib import AbstractContextManager
|
||||
from multiprocessing.context import BaseContext
|
||||
from types import TracebackType
|
||||
from typing import Any, Callable, Union
|
||||
from typing import Any, Callable
|
||||
|
||||
__all__ = ["Lock", "RLock", "Semaphore", "BoundedSemaphore", "Condition", "Event"]
|
||||
|
||||
_LockLike = Union[Lock, RLock]
|
||||
_LockLike = Lock | RLock
|
||||
|
||||
class Barrier(threading.Barrier):
|
||||
def __init__(
|
||||
|
||||
Reference in New Issue
Block a user