From fd57aee5dae21bd962f9df5d0d1c427ff96c3670 Mon Sep 17 00:00:00 2001 From: Rebecca Chen Date: Sun, 21 Apr 2019 00:21:00 -0700 Subject: [PATCH] Make shlex.shlex convertable to a list in Python 2. (#2927) This simply copies the relevant lines over from the Python 3 stub. --- stdlib/2/shlex.pyi | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/stdlib/2/shlex.pyi b/stdlib/2/shlex.pyi index 3e53f1d10..5bf6fccdb 100644 --- a/stdlib/2/shlex.pyi +++ b/stdlib/2/shlex.pyi @@ -1,9 +1,12 @@ -from typing import Optional, List, Any, IO +from typing import Any, IO, List, Optional, TypeVar def split(s: Optional[str], comments: bool = ..., posix: bool = ...) -> List[str]: ... +_SLT = TypeVar('_SLT', bound=shlex) + class shlex: def __init__(self, instream: IO[Any] = ..., infile: IO[Any] = ..., posix: bool = ...) -> None: ... + def __iter__(self: _SLT) -> _SLT: ... def get_token(self) -> Optional[str]: ... def push_token(self, _str: str) -> None: ... def read_token(self) -> str: ...