File: text_file.pyi

package info (click to toggle)
typeshed 0.0~git20241223.ea91db2-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 28,756 kB
  • sloc: python: 7,741; makefile: 20; sh: 18
file content (21 lines) | stat: -rw-r--r-- 787 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from typing import IO, Literal

class TextFile:
    def __init__(
        self,
        filename: str | None = None,
        file: IO[str] | None = None,
        *,
        strip_comments: bool | Literal[0, 1] = ...,
        lstrip_ws: bool | Literal[0, 1] = ...,
        rstrip_ws: bool | Literal[0, 1] = ...,
        skip_blanks: bool | Literal[0, 1] = ...,
        join_lines: bool | Literal[0, 1] = ...,
        collapse_join: bool | Literal[0, 1] = ...,
    ) -> None: ...
    def open(self, filename: str) -> None: ...
    def close(self) -> None: ...
    def warn(self, msg: str, line: list[int] | tuple[int, int] | int | None = None) -> None: ...
    def readline(self) -> str | None: ...
    def readlines(self) -> list[str]: ...
    def unreadline(self, line: str) -> str: ...