Big diff: Use new "|" union syntax (#5872)

This commit is contained in:
Akuli
2021-08-08 12:05:21 +03:00
committed by GitHub
parent b9adb7a874
commit ee487304d7
578 changed files with 8080 additions and 8966 deletions

View File

@@ -1,19 +1,19 @@
import sys
from typing import Callable, List, Optional, Sequence, Union
from typing import Callable, List, Sequence
class Error(Exception): ...
if sys.version_info >= (3, 7):
def register(
name: str, klass: Optional[Callable[[], BaseBrowser]], instance: Optional[BaseBrowser] = ..., *, preferred: bool = ...
name: str, klass: Callable[[], BaseBrowser] | None, instance: BaseBrowser | None = ..., *, preferred: bool = ...
) -> None: ...
else:
def register(
name: str, klass: Optional[Callable[[], BaseBrowser]], instance: Optional[BaseBrowser] = ..., update_tryorder: int = ...
name: str, klass: Callable[[], BaseBrowser] | None, instance: BaseBrowser | None = ..., update_tryorder: int = ...
) -> None: ...
def get(using: Optional[str] = ...) -> BaseBrowser: ...
def get(using: str | None = ...) -> BaseBrowser: ...
def open(url: str, new: int = ..., autoraise: bool = ...) -> bool: ...
def open_new(url: str) -> bool: ...
def open_new_tab(url: str) -> bool: ...
@@ -31,14 +31,14 @@ class GenericBrowser(BaseBrowser):
args: List[str]
name: str
basename: str
def __init__(self, name: Union[str, Sequence[str]]) -> None: ...
def __init__(self, name: str | Sequence[str]) -> None: ...
def open(self, url: str, new: int = ..., autoraise: bool = ...) -> bool: ...
class BackgroundBrowser(GenericBrowser):
def open(self, url: str, new: int = ..., autoraise: bool = ...) -> bool: ...
class UnixBrowser(BaseBrowser):
raise_opts: Optional[List[str]]
raise_opts: List[str] | None
background: bool
redirect_stdout: bool
remote_args: List[str]