mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
Big diff: Use new "|" union syntax (#5872)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from typing import BinaryIO, Callable, Optional, Union
|
||||
from typing import BinaryIO, Callable, Union
|
||||
|
||||
_Path = Union[str, Path, BinaryIO]
|
||||
|
||||
@@ -9,16 +9,16 @@ class ZipAppError(ValueError): ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def create_archive(
|
||||
source: _Path,
|
||||
target: Optional[_Path] = ...,
|
||||
interpreter: Optional[str] = ...,
|
||||
main: Optional[str] = ...,
|
||||
filter: Optional[Callable[[Path], bool]] = ...,
|
||||
target: _Path | None = ...,
|
||||
interpreter: str | None = ...,
|
||||
main: str | None = ...,
|
||||
filter: Callable[[Path], bool] | None = ...,
|
||||
compressed: bool = ...,
|
||||
) -> None: ...
|
||||
|
||||
else:
|
||||
def create_archive(
|
||||
source: _Path, target: Optional[_Path] = ..., interpreter: Optional[str] = ..., main: Optional[str] = ...
|
||||
source: _Path, target: _Path | None = ..., interpreter: str | None = ..., main: str | None = ...
|
||||
) -> None: ...
|
||||
|
||||
def get_interpreter(archive: _Path) -> str: ...
|
||||
|
||||
Reference in New Issue
Block a user