Skip to content

Commit 8da23e0

Browse files
authored
Broaden the signature of subprocess.list2cmdline. (#5824)
Although the parameter is called 'seq', the implementation shows that it can be anything that can be passed to map(), which takes iterables: https://github.com/python/cpython/blob/0f42b726c87f72d522893f927b4cb592b8875641/Lib/subprocess.py#L565.
1 parent 95a45eb commit 8da23e0

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

stdlib/subprocess.pyi

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,22 @@
11
import sys
22
from _typeshed import Self, StrOrBytesPath
33
from types import TracebackType
4-
from typing import IO, Any, AnyStr, Callable, Generic, Mapping, Optional, Sequence, Tuple, Type, TypeVar, Union, overload
4+
from typing import (
5+
IO,
6+
Any,
7+
AnyStr,
8+
Callable,
9+
Generic,
10+
Iterable,
11+
Mapping,
12+
Optional,
13+
Sequence,
14+
Tuple,
15+
Type,
16+
TypeVar,
17+
Union,
18+
overload,
19+
)
520
from typing_extensions import Literal
621

722
if sys.version_info >= (3, 9):
@@ -1016,7 +1031,7 @@ class Popen(Generic[AnyStr]):
10161031
# The result really is always a str.
10171032
def getstatusoutput(cmd: _TXT) -> Tuple[int, str]: ...
10181033
def getoutput(cmd: _TXT) -> str: ...
1019-
def list2cmdline(seq: Sequence[str]) -> str: ... # undocumented
1034+
def list2cmdline(seq: Iterable[str]) -> str: ... # undocumented
10201035

10211036
if sys.platform == "win32":
10221037
class STARTUPINFO:

0 commit comments

Comments
 (0)