Skip to content

Commit

Permalink
Update getopt to accept any iterable for longopts (#12950)
Browse files Browse the repository at this point in the history
  • Loading branch information
brianschubert authored Nov 4, 2024
1 parent 5243d30 commit 1a1970d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions stdlib/getopt.pyi
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 1a1970d

Please sign in to comment.