mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-25 12:26:44 +08:00
Big diff: Use new "|" union syntax (#5872)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import sys
|
||||
from _typeshed import StrPath
|
||||
from typing import Any, Optional, Protocol
|
||||
from typing import Any, Protocol
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
from py_compile import PycInvalidationMode
|
||||
@@ -11,34 +11,34 @@ class _SupportsSearch(Protocol):
|
||||
if sys.version_info >= (3, 9):
|
||||
def compile_dir(
|
||||
dir: StrPath,
|
||||
maxlevels: Optional[int] = ...,
|
||||
ddir: Optional[StrPath] = ...,
|
||||
maxlevels: int | None = ...,
|
||||
ddir: StrPath | None = ...,
|
||||
force: bool = ...,
|
||||
rx: Optional[_SupportsSearch] = ...,
|
||||
rx: _SupportsSearch | None = ...,
|
||||
quiet: int = ...,
|
||||
legacy: bool = ...,
|
||||
optimize: int = ...,
|
||||
workers: int = ...,
|
||||
invalidation_mode: Optional[PycInvalidationMode] = ...,
|
||||
invalidation_mode: PycInvalidationMode | None = ...,
|
||||
*,
|
||||
stripdir: Optional[str] = ..., # TODO: change to Optional[StrPath] once https://bugs.python.org/issue40447 is resolved
|
||||
prependdir: Optional[StrPath] = ...,
|
||||
limit_sl_dest: Optional[StrPath] = ...,
|
||||
stripdir: str | None = ..., # TODO: change to StrPath | None once https://bugs.python.org/issue40447 is resolved
|
||||
prependdir: StrPath | None = ...,
|
||||
limit_sl_dest: StrPath | None = ...,
|
||||
hardlink_dupes: bool = ...,
|
||||
) -> int: ...
|
||||
def compile_file(
|
||||
fullname: StrPath,
|
||||
ddir: Optional[StrPath] = ...,
|
||||
ddir: StrPath | None = ...,
|
||||
force: bool = ...,
|
||||
rx: Optional[_SupportsSearch] = ...,
|
||||
rx: _SupportsSearch | None = ...,
|
||||
quiet: int = ...,
|
||||
legacy: bool = ...,
|
||||
optimize: int = ...,
|
||||
invalidation_mode: Optional[PycInvalidationMode] = ...,
|
||||
invalidation_mode: PycInvalidationMode | None = ...,
|
||||
*,
|
||||
stripdir: Optional[str] = ..., # TODO: change to Optional[StrPath] once https://bugs.python.org/issue40447 is resolved
|
||||
prependdir: Optional[StrPath] = ...,
|
||||
limit_sl_dest: Optional[StrPath] = ...,
|
||||
stripdir: str | None = ..., # TODO: change to StrPath | None once https://bugs.python.org/issue40447 is resolved
|
||||
prependdir: StrPath | None = ...,
|
||||
limit_sl_dest: StrPath | None = ...,
|
||||
hardlink_dupes: bool = ...,
|
||||
) -> int: ...
|
||||
|
||||
@@ -46,33 +46,33 @@ elif sys.version_info >= (3, 7):
|
||||
def compile_dir(
|
||||
dir: StrPath,
|
||||
maxlevels: int = ...,
|
||||
ddir: Optional[StrPath] = ...,
|
||||
ddir: StrPath | None = ...,
|
||||
force: bool = ...,
|
||||
rx: Optional[_SupportsSearch] = ...,
|
||||
rx: _SupportsSearch | None = ...,
|
||||
quiet: int = ...,
|
||||
legacy: bool = ...,
|
||||
optimize: int = ...,
|
||||
workers: int = ...,
|
||||
invalidation_mode: Optional[PycInvalidationMode] = ...,
|
||||
invalidation_mode: PycInvalidationMode | None = ...,
|
||||
) -> int: ...
|
||||
def compile_file(
|
||||
fullname: StrPath,
|
||||
ddir: Optional[StrPath] = ...,
|
||||
ddir: StrPath | None = ...,
|
||||
force: bool = ...,
|
||||
rx: Optional[_SupportsSearch] = ...,
|
||||
rx: _SupportsSearch | None = ...,
|
||||
quiet: int = ...,
|
||||
legacy: bool = ...,
|
||||
optimize: int = ...,
|
||||
invalidation_mode: Optional[PycInvalidationMode] = ...,
|
||||
invalidation_mode: PycInvalidationMode | None = ...,
|
||||
) -> int: ...
|
||||
|
||||
else:
|
||||
def compile_dir(
|
||||
dir: StrPath,
|
||||
maxlevels: int = ...,
|
||||
ddir: Optional[StrPath] = ...,
|
||||
ddir: StrPath | None = ...,
|
||||
force: bool = ...,
|
||||
rx: Optional[_SupportsSearch] = ...,
|
||||
rx: _SupportsSearch | None = ...,
|
||||
quiet: int = ...,
|
||||
legacy: bool = ...,
|
||||
optimize: int = ...,
|
||||
@@ -80,9 +80,9 @@ else:
|
||||
) -> int: ...
|
||||
def compile_file(
|
||||
fullname: StrPath,
|
||||
ddir: Optional[StrPath] = ...,
|
||||
ddir: StrPath | None = ...,
|
||||
force: bool = ...,
|
||||
rx: Optional[_SupportsSearch] = ...,
|
||||
rx: _SupportsSearch | None = ...,
|
||||
quiet: int = ...,
|
||||
legacy: bool = ...,
|
||||
optimize: int = ...,
|
||||
@@ -96,7 +96,7 @@ if sys.version_info >= (3, 7):
|
||||
quiet: int = ...,
|
||||
legacy: bool = ...,
|
||||
optimize: int = ...,
|
||||
invalidation_mode: Optional[PycInvalidationMode] = ...,
|
||||
invalidation_mode: PycInvalidationMode | None = ...,
|
||||
) -> int: ...
|
||||
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user