stdlib: add argument default values (#9501)

This commit is contained in:
Jelle Zijlstra
2023-01-18 00:37:34 -08:00
committed by GitHub
parent 6cb934291f
commit ddfaca3200
272 changed files with 2529 additions and 2467 deletions

View File

@@ -8,10 +8,10 @@ __all__ = ["Error", "open", "open_new", "open_new_tab", "get", "register"]
class Error(Exception): ...
def register(
name: str, klass: Callable[[], BaseBrowser] | None, instance: BaseBrowser | None = ..., *, preferred: bool = ...
name: str, klass: Callable[[], BaseBrowser] | None, instance: BaseBrowser | None = None, *, preferred: bool = False
) -> None: ...
def get(using: str | None = ...) -> BaseBrowser: ...
def open(url: str, new: int = ..., autoraise: bool = ...) -> bool: ...
def get(using: str | None = None) -> BaseBrowser: ...
def open(url: str, new: int = 0, autoraise: bool = True) -> bool: ...
def open_new(url: str) -> bool: ...
def open_new_tab(url: str) -> bool: ...
@@ -19,20 +19,20 @@ class BaseBrowser:
args: list[str]
name: str
basename: str
def __init__(self, name: str = ...) -> None: ...
def __init__(self, name: str = "") -> None: ...
@abstractmethod
def open(self, url: str, new: int = ..., autoraise: bool = ...) -> bool: ...
def open(self, url: str, new: int = 0, autoraise: bool = True) -> bool: ...
def open_new(self, url: str) -> bool: ...
def open_new_tab(self, url: str) -> bool: ...
class GenericBrowser(BaseBrowser):
def __init__(self, name: str | Sequence[str]) -> None: ...
def open(self, url: str, new: int = ..., autoraise: bool = ...) -> bool: ...
def open(self, url: str, new: int = 0, autoraise: bool = True) -> bool: ...
class BackgroundBrowser(GenericBrowser): ...
class UnixBrowser(BaseBrowser):
def open(self, url: str, new: Literal[0, 1, 2] = ..., autoraise: bool = ...) -> bool: ... # type: ignore[override]
def open(self, url: str, new: Literal[0, 1, 2] = 0, autoraise: bool = True) -> bool: ... # type: ignore[override]
raise_opts: list[str] | None
background: bool
redirect_stdout: bool
@@ -51,10 +51,10 @@ class Opera(UnixBrowser): ...
class Elinks(UnixBrowser): ...
class Konqueror(BaseBrowser):
def open(self, url: str, new: int = ..., autoraise: bool = ...) -> bool: ...
def open(self, url: str, new: int = 0, autoraise: bool = True) -> bool: ...
class Grail(BaseBrowser):
def open(self, url: str, new: int = ..., autoraise: bool = ...) -> bool: ...
def open(self, url: str, new: int = 0, autoraise: bool = True) -> bool: ...
if sys.platform == "win32":
class WindowsDefault(BaseBrowser):
@@ -62,7 +62,7 @@ if sys.platform == "win32":
if sys.platform == "darwin":
class MacOSX(BaseBrowser):
def open(self, url: str, new: int = ..., autoraise: bool = ...) -> bool: ...
def open(self, url: str, new: int = 0, autoraise: bool = True) -> bool: ...
class MacOSXOSAScript(BaseBrowser): # In runtime this class does not have `name` and `basename`
def open(self, url: str, new: int = ..., autoraise: bool = ...) -> bool: ...
def open(self, url: str, new: int = 0, autoraise: bool = True) -> bool: ...