File: tempfile.pyi

package info (click to toggle)
mypy 0.470-complete-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 5,864 kB
  • ctags: 3,264
  • sloc: python: 21,838; makefile: 18
file content (51 lines) | stat: -rw-r--r-- 1,685 bytes parent folder | download
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
# Stubs for tempfile
# Ron Murawski <ron@horizonchess.com>

# based on http://docs.python.org/3.3/library/tempfile.html

from types import TracebackType
from typing import BinaryIO, Optional, Tuple, Type

# global variables
tempdir = ...  # type: str
template = ...  # type: str

# TODO text files

# function stubs
def TemporaryFile(
    mode: str = ..., buffering: int = ..., encoding: str = ...,
    newline: str = ..., suffix: str = ..., prefix: str = ...,
    dir: str = ...
) -> BinaryIO:
    ...
def NamedTemporaryFile(
    mode: str = ..., buffering: int = ..., encoding: str = ...,
    newline: str = ..., suffix: str = ..., prefix: str = ...,
    dir: str = ..., delete: bool =...
) -> BinaryIO:
    ...
def SpooledTemporaryFile(
    max_size: int = ..., mode: str = ..., buffering: int = ...,
    encoding: str = ..., newline: str = ..., suffix: str = ...,
    prefix: str = ..., dir: str = ...
) -> BinaryIO:
    ...

class TemporaryDirectory:
    name = ...  # type: str
    def __init__(self, suffix: str = ..., prefix: str = ...,
                 dir: str = ...) -> None: ...
    def cleanup(self) -> None: ...
    def __enter__(self) -> str: ...
    def __exit__(self, exc_type: Optional[Type[BaseException]],
                 exc_val: Optional[Exception],
                 exc_tb: Optional[TracebackType]) -> bool: ...

def mkstemp(suffix: str = ..., prefix: str = ..., dir: str = ...,
            text: bool = ...) -> Tuple[int, str]: ...
def mkdtemp(suffix: str = ..., prefix: str = ...,
            dir: str = ...) -> str: ...
def mktemp(suffix: str = ..., prefix: str = ..., dir: str = ...) -> str: ...
def gettempdir() -> str: ...
def gettempprefix() -> str: ...