more 3.7 features (#2015)

This commit is contained in:
Jelle Zijlstra
2018-04-06 11:09:11 -07:00
committed by Guido van Rossum
parent ce0656a8c7
commit 7cfbc7d17f
6 changed files with 30 additions and 4 deletions

View File

@@ -1,11 +1,16 @@
# Stubs for zipapp (Python 3.5+)
from pathlib import Path
from typing import BinaryIO, Optional, Union
import sys
from typing import BinaryIO, Callable, Optional, Union
_Path = Union[str, Path, BinaryIO]
class ZipAppError(Exception): ...
def create_archive(source: _Path, target: Optional[_Path] = ..., interpreter: Optional[str] = ..., main: Optional[str] = ...) -> None: ...
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]] = ..., compressed: bool = ...) -> None: ...
else:
def create_archive(source: _Path, target: Optional[_Path] = ..., interpreter: Optional[str] = ..., main: Optional[str] = ...) -> None: ...
def get_interpreter(archive: _Path) -> str: ...