Add defaults for third-party stubs Q-T (#9959)

This commit is contained in:
Alex Waygood
2023-03-28 13:16:31 +02:00
committed by GitHub
parent 72456da2a3
commit b69b17c3d8
274 changed files with 3918 additions and 3735 deletions
+7 -7
View File
@@ -22,9 +22,9 @@ class tqdm_asyncio(Generic[_T], std_tqdm[_T]):
cls,
fs: Iterable[Awaitable[_T]],
*,
loop: bool | None = ...,
timeout: float | None = ...,
total: int | None = ...,
loop: bool | None = None,
timeout: float | None = None,
total: int | None = None,
desc: str | None = ...,
leave: bool | None = ...,
file: SupportsWrite[str] | None = ...,
@@ -53,9 +53,9 @@ class tqdm_asyncio(Generic[_T], std_tqdm[_T]):
async def gather(
cls,
*fs: Awaitable[_T],
loop: bool | None = ...,
timeout: float | None = ...,
total: int | None = ...,
loop: bool | None = None,
timeout: float | None = None,
total: int | None = None,
iterable: Iterable[_T] = ...,
desc: str | None = ...,
leave: bool | None = ...,
@@ -115,7 +115,7 @@ class tqdm_asyncio(Generic[_T], std_tqdm[_T]):
@overload
def __init__(
self: tqdm_asyncio[NoReturn],
iterable: None = ...,
iterable: None = None,
desc: str | None = ...,
total: float | None = ...,
leave: bool | None = ...,
+1 -1
View File
@@ -2,4 +2,4 @@ from collections.abc import Sequence
__all__ = ["main"]
def main(fp=..., argv: Sequence[str] | None = ...) -> None: ...
def main(fp=..., argv: Sequence[str] | None = None) -> None: ...
+2 -2
View File
@@ -7,9 +7,9 @@ __all__ = ["tenumerate", "tzip", "tmap"]
class DummyTqdmFile(ObjectWrapper):
def __init__(self, wrapped) -> None: ...
def write(self, x, nolock: bool = ...) -> None: ...
def write(self, x, nolock: bool = False) -> None: ...
def __del__(self) -> None: ...
def tenumerate(iterable, start: int = ..., total: Incomplete | None = ..., tqdm_class: type[Incomplete] = ..., **tqdm_kwargs): ...
def tenumerate(iterable, start: int = 0, total: Incomplete | None = None, tqdm_class: type[Incomplete] = ..., **tqdm_kwargs): ...
def tzip(iter1, *iter2plus, **tqdm_kwargs) -> Generator[Incomplete, None, None]: ...
def tmap(function: Callable[..., Incomplete], *sequences, **tqdm_kwargs) -> Generator[Incomplete, None, None]: ...
+1 -1
View File
@@ -51,7 +51,7 @@ class tqdm_discord(Generic[_T], tqdm_auto[_T]):
@overload
def __init__(
self: tqdm_discord[NoReturn],
iterable: None = ...,
iterable: None = None,
desc: str | None = ...,
total: float | None = ...,
leave: bool | None = ...,
+1 -1
View File
@@ -9,7 +9,7 @@ from ..std import tqdm as std_tqdm
_TqdmT = TypeVar("_TqdmT", bound=std_tqdm[Any])
def logging_redirect_tqdm(
loggers: Sequence[logging.Logger] | None = ..., tqdm_class: type[std_tqdm[Any]] = ...
loggers: Sequence[logging.Logger] | None = None, tqdm_class: type[std_tqdm[Any]] = ...
) -> _GeneratorContextManager[None]: ...
# TODO type *args, **kwargs here more precisely
+1 -1
View File
@@ -54,7 +54,7 @@ class tqdm_slack(Generic[_T], tqdm_auto[_T]):
@overload
def __init__(
self: tqdm_slack[NoReturn],
iterable: None = ...,
iterable: None = None,
desc: str | None = ...,
total: float | None = ...,
leave: bool | None = ...,
+1 -1
View File
@@ -59,7 +59,7 @@ class tqdm_telegram(Generic[_T], tqdm_auto[_T]):
@overload
def __init__(
self: tqdm_telegram[NoReturn],
iterable: None = ...,
iterable: None = None,
desc: str | None = ...,
total: float | None = ...,
leave: bool | None = ...,
+1 -1
View File
@@ -57,7 +57,7 @@ class tqdm_gui(Generic[_T], std_tqdm[_T]):
@overload
def __init__(
self: tqdm_gui[NoReturn],
iterable: None = ...,
iterable: None = None,
desc: str | None = ...,
total: float | None = ...,
leave: bool | None = ...,
+5 -5
View File
@@ -29,7 +29,7 @@ class _Callback:
class TqdmCallback(_Callback):
@staticmethod
def bar2callback(bar, pop: Incomplete | None = ..., delta=...): ...
def bar2callback(bar, pop: Incomplete | None = None, delta=...): ...
tqdm_class: Incomplete
epoch_bar: Incomplete
on_epoch_end: Incomplete
@@ -39,10 +39,10 @@ class TqdmCallback(_Callback):
on_batch_end: Incomplete
def __init__(
self,
epochs: Incomplete | None = ...,
data_size: Incomplete | None = ...,
batch_size: Incomplete | None = ...,
verbose: int = ...,
epochs: Incomplete | None = None,
data_size: Incomplete | None = None,
batch_size: Incomplete | None = None,
verbose: int = 1,
tqdm_class=...,
**tqdm_kwargs,
) -> None: ...
+9 -9
View File
@@ -11,16 +11,16 @@ _T = TypeVar("_T")
class tqdm_notebook(Generic[_T], std_tqdm[_T]):
@staticmethod
def status_printer(
_: SupportsWrite[str] | None, total: float | None = ..., desc: str | None = ..., ncols: int | None = ...
_: SupportsWrite[str] | None, total: float | None = None, desc: str | None = None, ncols: int | None = None
): ...
displayed: bool
def display(
self,
msg: str | None = ...,
pos: int | None = ...,
close: bool = ...,
bar_style: str | None = ...,
check_delay: bool = ...,
msg: str | None = None,
pos: int | None = None,
close: bool = False,
bar_style: str | None = None,
check_delay: bool = True,
) -> None: ...
@property
def colour(self): ...
@@ -63,7 +63,7 @@ class tqdm_notebook(Generic[_T], std_tqdm[_T]):
@overload
def __init__(
self: tqdm_notebook[NoReturn],
iterable: None = ...,
iterable: None = None,
desc: str | None = ...,
total: float | None = ...,
leave: bool | None = ...,
@@ -92,10 +92,10 @@ class tqdm_notebook(Generic[_T], std_tqdm[_T]):
**kwargs,
) -> None: ...
def __iter__(self) -> Iterator[_T]: ...
def update(self, n: int = ...): ... # type: ignore[override]
def update(self, n: int = 1): ... # type: ignore[override]
def close(self) -> None: ...
def clear(self, *_, **__) -> None: ...
def reset(self, total: float | None = ...): ...
def reset(self, total: float | None = None): ...
tqdm = tqdm_notebook
tnrange = trange
+1 -1
View File
@@ -72,7 +72,7 @@ class tqdm_rich(Generic[_T], std_tqdm[_T]):
@overload
def __init__(
self: tqdm_rich[NoReturn],
iterable: None = ...,
iterable: None = None,
desc: str | None = ...,
total: float | None = ...,
leave: bool | None = ...,
+75 -75
View File
@@ -23,7 +23,7 @@ class TqdmTypeError(TypeError): ...
class TqdmKeyError(KeyError): ...
class TqdmWarning(Warning):
def __init__(self, msg, fp_write: Incomplete | None = ..., *a, **k) -> None: ...
def __init__(self, msg, fp_write: Incomplete | None = None, *a, **k) -> None: ...
class TqdmExperimentalWarning(TqdmWarning, FutureWarning): ...
class TqdmDeprecationWarning(TqdmWarning, DeprecationWarning): ...
@@ -36,7 +36,7 @@ class tqdm(Generic[_T], Iterable[_T], Comparable):
monitor: ClassVar[TMonitor | None]
@staticmethod
def format_sizeof(num: float, suffix: str = ..., divisor: float = ...) -> str: ...
def format_sizeof(num: float, suffix: str = "", divisor: float = 1000) -> str: ...
@staticmethod
def format_interval(t: float) -> str: ...
@staticmethod
@@ -48,86 +48,86 @@ class tqdm(Generic[_T], Iterable[_T], Comparable):
n: float,
total: float,
elapsed: float,
ncols: int | None = ...,
prefix: str | None = ...,
ascii: bool | str | None = ...,
unit: str | None = ...,
unit_scale: bool | float | None = ...,
rate: float | None = ...,
bar_format: str | None = ...,
postfix: str | Mapping[str, object] | None = ...,
unit_divisor: float | None = ...,
initial: float | None = ...,
colour: str | None = ...,
ncols: int | None = None,
prefix: str | None = "",
ascii: bool | str | None = False,
unit: str | None = "it",
unit_scale: bool | float | None = False,
rate: float | None = None,
bar_format: str | None = None,
postfix: str | Mapping[str, object] | None = None,
unit_divisor: float | None = 1000,
initial: float | None = 0,
colour: str | None = None,
) -> str: ...
@overload
def __init__(
self,
iterable: Iterable[_T],
desc: str | None = ...,
total: float | None = ...,
leave: bool | None = ...,
file: SupportsWrite[str] | None = ...,
ncols: int | None = ...,
mininterval: float = ...,
maxinterval: float = ...,
miniters: float | None = ...,
ascii: bool | str | None = ...,
disable: bool | None = ...,
unit: str = ...,
unit_scale: bool | float = ...,
dynamic_ncols: bool = ...,
smoothing: float = ...,
bar_format: str | None = ...,
initial: float = ...,
position: int | None = ...,
postfix: Mapping[str, object] | str | None = ...,
unit_divisor: float = ...,
desc: str | None = None,
total: float | None = None,
leave: bool | None = True,
file: SupportsWrite[str] | None = None,
ncols: int | None = None,
mininterval: float = 0.1,
maxinterval: float = 10.0,
miniters: float | None = None,
ascii: bool | str | None = None,
disable: bool | None = False,
unit: str = "it",
unit_scale: bool | float = False,
dynamic_ncols: bool = False,
smoothing: float = 0.3,
bar_format: str | None = None,
initial: float = 0,
position: int | None = None,
postfix: Mapping[str, object] | str | None = None,
unit_divisor: float = 1000,
write_bytes: bool = False,
lock_args: tuple[bool | None, float | None] | tuple[bool | None] | None = ...,
nrows: int | None = ...,
colour: str | None = ...,
delay: float | None = ...,
gui: bool = ...,
lock_args: tuple[bool | None, float | None] | tuple[bool | None] | None = None,
nrows: int | None = None,
colour: str | None = None,
delay: float | None = 0,
gui: bool = False,
**kwargs,
) -> None: ...
@overload
def __init__(
self: tqdm[NoReturn],
iterable: None = ...,
desc: str | None = ...,
total: float | None = ...,
leave: bool | None = ...,
file: SupportsWrite[str] | None = ...,
ncols: int | None = ...,
mininterval: float = ...,
maxinterval: float = ...,
miniters: float | None = ...,
ascii: bool | str | None = ...,
disable: bool | None = ...,
unit: str = ...,
unit_scale: bool | float = ...,
dynamic_ncols: bool = ...,
smoothing: float = ...,
bar_format: str | None = ...,
initial: float = ...,
position: int | None = ...,
postfix: Mapping[str, object] | str | None = ...,
unit_divisor: float = ...,
write_bytes: bool | None = ...,
lock_args: tuple[bool | None, float | None] | tuple[bool | None] | None = ...,
nrows: int | None = ...,
colour: str | None = ...,
delay: float | None = ...,
gui: bool = ...,
iterable: None = None,
desc: str | None = None,
total: float | None = None,
leave: bool | None = True,
file: SupportsWrite[str] | None = None,
ncols: int | None = None,
mininterval: float = 0.1,
maxinterval: float = 10.0,
miniters: float | None = None,
ascii: bool | str | None = None,
disable: bool | None = False,
unit: str = "it",
unit_scale: bool | float = False,
dynamic_ncols: bool = False,
smoothing: float = 0.3,
bar_format: str | None = None,
initial: float = 0,
position: int | None = None,
postfix: Mapping[str, object] | str | None = None,
unit_divisor: float = 1000,
write_bytes: bool | None = False,
lock_args: tuple[bool | None, float | None] | tuple[bool | None] | None = None,
nrows: int | None = None,
colour: str | None = None,
delay: float | None = 0,
gui: bool = False,
**kwargs,
) -> None: ...
def __new__(cls, *_, **__) -> Self: ...
@classmethod
def write(cls, s: str, file: SupportsWrite[str] | None = ..., end: str = ..., nolock: bool = ...) -> None: ...
def write(cls, s: str, file: SupportsWrite[str] | None = None, end: str = "\n", nolock: bool = False) -> None: ...
@classmethod
def external_write_mode(
cls, file: SupportsWrite[str] | None = ..., nolock: bool = ...
cls, file: SupportsWrite[str] | None = None, nolock: bool = False
) -> contextlib._GeneratorContextManager[None]: ...
@classmethod
def set_lock(cls, lock) -> None: ...
@@ -206,25 +206,25 @@ class tqdm(Generic[_T], Iterable[_T], Comparable):
def __del__(self) -> None: ...
def __hash__(self) -> int: ...
def __iter__(self) -> Iterator[_T]: ...
def update(self, n: float | None = ...) -> bool | None: ...
def update(self, n: float | None = 1) -> bool | None: ...
def close(self) -> None: ...
def clear(self, nolock: bool = ...) -> None: ...
def clear(self, nolock: bool = False) -> None: ...
def refresh(
self, nolock: bool = ..., lock_args: tuple[bool | None, float | None] | tuple[bool | None] | None = ...
self, nolock: bool = False, lock_args: tuple[bool | None, float | None] | tuple[bool | None] | None = None
) -> None: ...
def unpause(self) -> None: ...
def reset(self, total: float | None = ...) -> None: ...
def set_description(self, desc: str | None = ..., refresh: bool | None = ...) -> None: ...
def set_description_str(self, desc: str | None = ..., refresh: bool | None = ...) -> None: ...
def set_postfix(self, ordered_dict: Mapping[str, object] | None = ..., refresh: bool | None = ..., **kwargs) -> None: ...
def set_postfix_str(self, s: str = ..., refresh: bool = ...) -> None: ...
def reset(self, total: float | None = None) -> None: ...
def set_description(self, desc: str | None = None, refresh: bool | None = True) -> None: ...
def set_description_str(self, desc: str | None = None, refresh: bool | None = True) -> None: ...
def set_postfix(self, ordered_dict: Mapping[str, object] | None = None, refresh: bool | None = True, **kwargs) -> None: ...
def set_postfix_str(self, s: str = "", refresh: bool = True) -> None: ...
def moveto(self, n) -> None: ...
@property
def format_dict(self) -> MutableMapping[str, Any]: ...
def display(self, msg: str | None = ..., pos: int | None = ...) -> None: ...
def display(self, msg: str | None = None, pos: int | None = None) -> None: ...
@classmethod
def wrapattr(
cls, stream, method: Literal["read", "write"], total: float | None = ..., bytes: bool | None = ..., **tqdm_kwargs
cls, stream, method: Literal["read", "write"], total: float | None = None, bytes: bool | None = True, **tqdm_kwargs
) -> contextlib._GeneratorContextManager[Incomplete]: ...
@overload
+4 -4
View File
@@ -46,7 +46,7 @@ class tqdm_tk(Generic[_T], std_tqdm[_T]):
@overload
def __init__(
self: tqdm_tk[NoReturn],
iterable: None = ...,
iterable: None = None,
desc: str | None = ...,
total: float | None = ...,
leave: bool | None = ...,
@@ -81,11 +81,11 @@ class tqdm_tk(Generic[_T], std_tqdm[_T]):
def close(self) -> None: ...
def clear(self, *_, **__) -> None: ...
def display(self, *_, **__) -> None: ...
def set_description(self, desc: str | None = ..., refresh: bool | None = ...) -> None: ...
def set_description(self, desc: str | None = None, refresh: bool | None = True) -> None: ...
desc: Incomplete
def set_description_str(self, desc: str | None = ..., refresh: bool | None = ...) -> None: ...
def set_description_str(self, desc: str | None = None, refresh: bool | None = True) -> None: ...
def cancel(self) -> None: ...
def reset(self, total: Incomplete | None = ...) -> None: ...
def reset(self, total: Incomplete | None = None) -> None: ...
def ttkrange(*args, **kwargs) -> tqdm_tk[int]: ...
+2 -2
View File
@@ -12,7 +12,7 @@ RE_ANSI: Pattern[str]
class FormatReplace:
replace: str
format_called: int
def __init__(self, replace: str = ...) -> None: ...
def __init__(self, replace: str = "") -> None: ...
def __format__(self, _) -> str: ...
class _Has__Comparable(Protocol):
@@ -49,7 +49,7 @@ class DisableOnWriteError(ObjectWrapper):
def __eq__(self, other: object) -> bool: ...
class CallbackIOWrapper(ObjectWrapper):
def __init__(self, callback: Callable[[int], object], stream, method: str = ...) -> None: ...
def __init__(self, callback: Callable[[int], object], stream, method: str = "read") -> None: ...
def disp_len(data: str) -> int: ...
def disp_trim(data: str, length: int) -> str: ...