Update getopt to accept any iterable for longopts (#12950)

This commit is contained in:
Brian Schubert
2024-11-04 16:38:17 -05:00
committed by GitHub
parent 5243d30744
commit 1a1970d950

View File

@@ -1,7 +1,11 @@
from collections.abc import Iterable
__all__ = ["GetoptError", "error", "getopt", "gnu_getopt"]
def getopt(args: list[str], shortopts: str, longopts: list[str] = []) -> tuple[list[tuple[str, str]], list[str]]: ...
def gnu_getopt(args: list[str], shortopts: str, longopts: list[str] = []) -> tuple[list[tuple[str, str]], list[str]]: ...
def getopt(args: list[str], shortopts: str, longopts: Iterable[str] | str = []) -> tuple[list[tuple[str, str]], list[str]]: ...
def gnu_getopt(
args: list[str], shortopts: str, longopts: Iterable[str] | str = []
) -> tuple[list[tuple[str, str]], list[str]]: ...
class GetoptError(Exception):
msg: str