Replace Any with Incomplete in many places (#9558)

This commit is contained in:
Alex Waygood
2023-01-18 08:48:16 +00:00
committed by GitHub
parent ddfaca3200
commit 4fea314594
460 changed files with 3779 additions and 2909 deletions
@@ -1,4 +1,5 @@
import datetime
from _typeshed import Incomplete
from re import Pattern
from types import TracebackType
from typing import Any, NamedTuple
@@ -36,7 +37,7 @@ class Timer:
resumable: bool
start_time: float
total_time: float
def __init__(self, start_time: Any | None = ..., resumable: bool = ...) -> None: ...
def __init__(self, start_time: Incomplete | None = ..., resumable: bool = ...) -> None: ...
def __enter__(self): ...
def __exit__(
self,
+8 -7
View File
@@ -1,5 +1,6 @@
from _typeshed import Incomplete
from collections import OrderedDict
from typing import Any, Generic, TypeVar
from typing import Generic, TypeVar
from humanfriendly.compat import unicode
@@ -7,14 +8,14 @@ _KT = TypeVar("_KT")
_VT = TypeVar("_VT")
class CaseInsensitiveDict(OrderedDict[_KT, _VT], Generic[_KT, _VT]):
def __init__(self, other: Any | None = ..., **kw) -> None: ...
def __init__(self, other: Incomplete | None = ..., **kw) -> None: ...
def coerce_key(self, key): ...
@classmethod
def fromkeys(cls, iterable, value: Any | None = ...): ...
def get(self, key, default: Any | None = ...): ...
def pop(self, key, default: Any | None = ...): ...
def setdefault(self, key, default: Any | None = ...): ...
def update(self, other: Any | None = ..., **kw) -> None: ... # type: ignore[override]
def fromkeys(cls, iterable, value: Incomplete | None = ...): ...
def get(self, key, default: Incomplete | None = ...): ...
def pop(self, key, default: Incomplete | None = ...): ...
def setdefault(self, key, default: Incomplete | None = ...): ...
def update(self, other: Incomplete | None = ..., **kw) -> None: ... # type: ignore[override]
def __contains__(self, key): ...
def __delitem__(self, key) -> None: ...
def __getitem__(self, key): ...
+2 -2
View File
@@ -1,4 +1,4 @@
from typing import Any
from _typeshed import Incomplete
def main() -> None: ...
def run_command(command_line) -> None: ...
@@ -10,4 +10,4 @@ def print_formatted_timespan(value) -> None: ...
def print_parsed_length(value) -> None: ...
def print_parsed_size(value) -> None: ...
def demonstrate_ansi_formatting() -> None: ...
def demonstrate_256_colors(i, j, group: Any | None = ...) -> None: ...
def demonstrate_256_colors(i, j, group: Incomplete | None = ...) -> None: ...
@@ -1,11 +1,12 @@
from _typeshed import Incomplete
from typing import Any
MAX_ATTEMPTS: int
logger: Any
def prompt_for_confirmation(question, default: Any | None = ..., padding: bool = ...): ...
def prompt_for_choice(choices, default: Any | None = ..., padding: bool = ...): ...
def prompt_for_input(question, default: Any | None = ..., padding: bool = ..., strip: bool = ...): ...
def prompt_for_confirmation(question, default: Incomplete | None = ..., padding: bool = ...): ...
def prompt_for_choice(choices, default: Incomplete | None = ..., padding: bool = ...): ...
def prompt_for_input(question, default: Incomplete | None = ..., padding: bool = ..., strip: bool = ...): ...
def prepare_prompt_text(prompt_text, **options): ...
def prepare_friendly_prompts() -> None: ...
def retry_limit(limit=...) -> None: ...
+3 -3
View File
@@ -1,6 +1,6 @@
from typing import Any
from _typeshed import Incomplete
def format_smart_table(data, column_names): ...
def format_pretty_table(data, column_names: Any | None = ..., horizontal_bar: str = ..., vertical_bar: str = ...): ...
def format_pretty_table(data, column_names: Incomplete | None = ..., horizontal_bar: str = ..., vertical_bar: str = ...): ...
def format_robust_table(data, column_names): ...
def format_rst_table(data, column_names: Any | None = ...): ...
def format_rst_table(data, column_names: Incomplete | None = ...): ...
@@ -1,3 +1,4 @@
from _typeshed import Incomplete
from typing import Any
ANSI_CSI: str
@@ -20,18 +21,18 @@ def ansi_width(text): ...
def ansi_wrap(text, **kw): ...
def auto_encode(stream, text, *args, **kw) -> None: ...
def clean_terminal_output(text): ...
def connected_to_terminal(stream: Any | None = ...): ...
def connected_to_terminal(stream: Incomplete | None = ...): ...
def enable_ansi_support(): ...
def find_terminal_size(): ...
def find_terminal_size_using_ioctl(stream): ...
def find_terminal_size_using_stty(): ...
def get_pager_command(text: Any | None = ...): ...
def get_pager_command(text: Incomplete | None = ...): ...
def have_windows_native_ansi_support(): ...
def message(text, *args, **kw) -> None: ...
def output(text, *args, **kw) -> None: ...
def readline_strip(expr): ...
def readline_wrap(expr): ...
def show_pager(formatted_text, encoding=...) -> None: ...
def terminal_supports_colors(stream: Any | None = ...): ...
def terminal_supports_colors(stream: Incomplete | None = ...): ...
def usage(usage_text) -> None: ...
def warning(text, *args, **kw) -> None: ...
@@ -1,8 +1,9 @@
from _typeshed import Incomplete
from typing import Any
from humanfriendly.compat import HTMLParser
def html_to_ansi(data, callback: Any | None = ...): ...
def html_to_ansi(data, callback: Incomplete | None = ...): ...
class HTMLConverter(HTMLParser):
BLOCK_TAGS: Any
@@ -14,7 +15,7 @@ class HTMLConverter(HTMLParser):
def current_style(self): ...
stack: Any
def close(self) -> None: ...
def emit_style(self, style: Any | None = ...) -> None: ...
def emit_style(self, style: Incomplete | None = ...) -> None: ...
def handle_charref(self, value) -> None: ...
link_text: Any
def handle_data(self, data) -> None: ...
@@ -1,3 +1,4 @@
from _typeshed import Incomplete
from types import TracebackType
from typing import Any
@@ -15,7 +16,7 @@ class Spinner:
counter: int
last_update: int
def __init__(self, **options) -> None: ...
def step(self, progress: int = ..., label: Any | None = ...) -> None: ...
def step(self, progress: int = ..., label: Incomplete | None = ...) -> None: ...
def sleep(self) -> None: ...
def clear(self) -> None: ...
def __enter__(self): ...
@@ -1,4 +1,5 @@
import unittest
from _typeshed import Incomplete
from types import TracebackType
from typing import Any
@@ -62,7 +63,7 @@ class MockedProgram(CustomSearchPath):
program_returncode: Any
program_script: Any
program_signal_file: Any
def __init__(self, name, returncode: int = ..., script: Any | None = ...) -> None: ...
def __init__(self, name, returncode: int = ..., script: Incomplete | None = ...) -> None: ...
def __enter__(self): ...
def __exit__(self, *args, **kw): ...
+3 -3
View File
@@ -1,4 +1,4 @@
from typing import Any
from _typeshed import Incomplete
def compact(text, *args, **kw): ...
def compact_empty_lines(text): ...
@@ -8,8 +8,8 @@ def format(text, *args, **kw): ...
def generate_slug(text, delimiter: str = ...): ...
def is_empty_line(text): ...
def join_lines(text): ...
def pluralize(count, singular, plural: Any | None = ...): ...
def pluralize_raw(count, singular, plural: Any | None = ...): ...
def pluralize(count, singular, plural: Incomplete | None = ...): ...
def pluralize_raw(count, singular, plural: Incomplete | None = ...): ...
def random_string(length=..., characters=...): ...
def split(text, delimiter: str = ...): ...
def split_paragraphs(text): ...