mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-30 08:04:24 +08:00
Improve shlex.push_source types (#7071)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import sys
|
||||
from _typeshed import Self
|
||||
from typing import Any, Iterable, TextIO
|
||||
from typing import Iterable, TextIO
|
||||
|
||||
def split(s: str, comments: bool = ..., posix: bool = ...) -> list[str]: ...
|
||||
|
||||
@@ -17,7 +17,7 @@ class shlex(Iterable[str]):
|
||||
quotes: str
|
||||
escapedquotes: str
|
||||
whitespace_split: bool
|
||||
infile: str
|
||||
infile: str | None
|
||||
instream: TextIO
|
||||
source: str
|
||||
debug: int
|
||||
@@ -36,8 +36,7 @@ class shlex(Iterable[str]):
|
||||
def push_token(self, tok: str) -> None: ...
|
||||
def read_token(self) -> str: ...
|
||||
def sourcehook(self, newfile: str) -> tuple[str, TextIO]: ...
|
||||
# TODO argument types
|
||||
def push_source(self, newstream: Any, newfile: Any = ...) -> None: ...
|
||||
def push_source(self, newstream: str | TextIO, newfile: str | None = ...) -> None: ...
|
||||
def pop_source(self) -> None: ...
|
||||
def error_leader(self, infile: str | None = ..., lineno: int | None = ...) -> None: ...
|
||||
def __iter__(self: Self) -> Self: ...
|
||||
|
||||
Reference in New Issue
Block a user