-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/
tempfile.pyi
91 lines (80 loc) · 3.74 KB
/
tempfile.pyi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# Stubs for tempfile
# Ron Murawski <[email protected]>
# based on http://docs.python.org/3.3/library/tempfile.html
import sys
from types import TracebackType
from typing import Any, AnyStr, Generic, IO, Optional, Tuple, Type
# global variables
TMP_MAX: int
tempdir = ... # type: Optional[str]
template = ... # type: str
if sys.version_info >= (3, 5):
def TemporaryFile(
mode: str = ..., buffering: int = ..., encoding: Optional[str] = ...,
newline: Optional[str] = ..., suffix: Optional[AnyStr] = ..., prefix: Optional[AnyStr] = ...,
dir: Optional[AnyStr] = ...
) -> IO[Any]:
...
def NamedTemporaryFile(
mode: str = ..., buffering: int = ..., encoding: Optional[str] = ...,
newline: Optional[str] = ..., suffix: Optional[AnyStr] = ..., prefix: Optional[AnyStr] = ...,
dir: Optional[AnyStr] = ..., delete: bool =...
) -> IO[Any]:
...
def SpooledTemporaryFile(
max_size: int = ..., mode: str = ..., buffering: int = ...,
encoding: str = ..., newline: str = ..., suffix: Optional[AnyStr] = ...,
prefix: Optional[AnyStr] = ..., dir: Optional[AnyStr] = ...
) -> IO[Any]:
...
class TemporaryDirectory(Generic[AnyStr]):
name = ... # type: str
def __init__(self, suffix: Optional[AnyStr] = ..., prefix: Optional[AnyStr] = ...,
dir: Optional[AnyStr] = ...) -> None: ...
def cleanup(self) -> None: ...
def __enter__(self) -> AnyStr: ...
def __exit__(self, exc_type: Optional[Type[BaseException]],
exc_val: Optional[BaseException],
exc_tb: Optional[TracebackType]) -> bool: ...
def mkstemp(suffix: Optional[AnyStr] = ..., prefix: Optional[AnyStr] = ..., dir: Optional[AnyStr] = ...,
text: bool = ...) -> Tuple[int, AnyStr]: ...
def mkdtemp(suffix: Optional[AnyStr] = ..., prefix: Optional[AnyStr] = ...,
dir: Optional[str] = ...) -> AnyStr: ...
def mktemp(suffix: Optional[AnyStr] = ..., prefix: Optional[AnyStr] = ..., dir: Optional[AnyStr] = ...) -> AnyStr: ...
def gettempdirb() -> bytes: ...
def gettempprefixb() -> bytes: ...
else:
def TemporaryFile(
mode: str = ..., buffering: int = ..., encoding: Optional[str] = ...,
newline: Optional[str] = ..., suffix: str = ..., prefix: str = ...,
dir: Optional[str] = ...
) -> IO[Any]:
...
def NamedTemporaryFile(
mode: str = ..., buffering: int = ..., encoding: Optional[str] = ...,
newline: Optional[str] = ..., suffix: str = ..., prefix: str = ...,
dir: Optional[str] = ..., delete: bool =...
) -> IO[Any]:
...
def SpooledTemporaryFile(
max_size: int = ..., mode: str = ..., buffering: int = ...,
encoding: str = ..., newline: str = ..., suffix: str = ...,
prefix: str = ..., dir: Optional[str] = ...
) -> IO[Any]:
...
class TemporaryDirectory:
name = ... # type: str
def __init__(self, suffix: str = ..., prefix: str = ...,
dir: Optional[str] = ...) -> None: ...
def cleanup(self) -> None: ...
def __enter__(self) -> str: ...
def __exit__(self, exc_type: Optional[Type[BaseException]],
exc_val: Optional[BaseException],
exc_tb: Optional[TracebackType]) -> bool: ...
def mkstemp(suffix: str = ..., prefix: str = ..., dir: Optional[str] = ...,
text: bool = ...) -> Tuple[int, str]: ...
def mkdtemp(suffix: str = ..., prefix: str = ...,
dir: Optional[str] = ...) -> str: ...
def mktemp(suffix: str = ..., prefix: str = ..., dir: Optional[str] = ...) -> str: ...
def gettempdir() -> str: ...
def gettempprefix() -> str: ...