From 1cd3ae8e302a9177bae5a2c22a4ed94a293ae28b Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Mon, 27 Mar 2023 17:09:01 +0100 Subject: [PATCH] Add defaults for third-party stubs E-H (#9954) --- stubs/ExifRead/exifread/__init__.pyi | 12 +- stubs/ExifRead/exifread/classes.pyi | 10 +- stubs/ExifRead/exifread/exif_log.pyi | 4 +- stubs/ExifRead/exifread/utils.pyi | 2 +- stubs/Flask-Cors/flask_cors/core.pyi | 4 +- stubs/Flask-Cors/flask_cors/extension.pyi | 2 +- .../Flask-Migrate/flask_migrate/__init__.pyi | 106 ++++---- .../flask_sqlalchemy/__init__.pyi | 52 ++-- stubs/emoji/emoji/core.pyi | 22 +- .../flake8_plugin_utils/plugin.pyi | 2 +- .../flake8_plugin_utils/utils/assertions.pyi | 4 +- stubs/fpdf2/fpdf/actions.pyi | 12 +- stubs/fpdf2/fpdf/annotations.pyi | 36 +-- stubs/fpdf2/fpdf/drawing.pyi | 50 ++-- stubs/fpdf2/fpdf/errors.pyi | 2 +- stubs/fpdf2/fpdf/fpdf.pyi | 250 +++++++++--------- stubs/fpdf2/fpdf/html.pyi | 10 +- stubs/fpdf2/fpdf/image_parsing.pyi | 2 +- stubs/fpdf2/fpdf/line_break.pyi | 12 +- stubs/fpdf2/fpdf/outline.pyi | 2 +- stubs/fpdf2/fpdf/output.pyi | 21 +- stubs/fpdf2/fpdf/prefs.pyi | 12 +- stubs/fpdf2/fpdf/recorder.pyi | 2 +- stubs/fpdf2/fpdf/sign.pyi | 8 +- stubs/fpdf2/fpdf/structure_tree.pyi | 8 +- stubs/fpdf2/fpdf/svg.pyi | 16 +- stubs/fpdf2/fpdf/syntax.pyi | 16 +- stubs/fpdf2/fpdf/template.pyi | 28 +- stubs/fpdf2/fpdf/transitions.pyi | 2 +- stubs/fpdf2/fpdf/util.pyi | 2 +- stubs/html5lib/html5lib/_ihatexml.pyi | 14 +- stubs/html5lib/html5lib/_inputstream.pyi | 18 +- stubs/html5lib/html5lib/_tokenizer.pyi | 4 +- stubs/html5lib/html5lib/_trie/_base.pyi | 2 +- stubs/html5lib/html5lib/_trie/py.pyi | 2 +- stubs/html5lib/html5lib/_utils.pyi | 4 +- stubs/html5lib/html5lib/filters/lint.pyi | 2 +- stubs/html5lib/html5lib/html5parser.pyi | 14 +- stubs/html5lib/html5lib/serializer.pyi | 8 +- .../html5lib/treebuilders/__init__.pyi | 2 +- stubs/html5lib/html5lib/treebuilders/base.pyi | 10 +- .../html5lib/html5lib/treebuilders/etree.pyi | 2 +- .../html5lib/treebuilders/etree_lxml.pyi | 6 +- .../html5lib/treewalkers/__init__.pyi | 2 +- stubs/html5lib/html5lib/treewalkers/base.pyi | 4 +- stubs/httplib2/httplib2/__init__.pyi | 60 ++--- stubs/httplib2/httplib2/socks.pyi | 28 +- .../humanfriendly/humanfriendly/__init__.pyi | 22 +- stubs/humanfriendly/humanfriendly/case.pyi | 12 +- stubs/humanfriendly/humanfriendly/cli.pyi | 2 +- stubs/humanfriendly/humanfriendly/prompts.pyi | 8 +- stubs/humanfriendly/humanfriendly/sphinx.pyi | 4 +- stubs/humanfriendly/humanfriendly/tables.pyi | 4 +- .../humanfriendly/terminal/__init__.pyi | 10 +- .../humanfriendly/terminal/html.pyi | 4 +- .../humanfriendly/terminal/spinners.pyi | 16 +- stubs/humanfriendly/humanfriendly/testing.pyi | 18 +- stubs/humanfriendly/humanfriendly/text.pyi | 12 +- 58 files changed, 509 insertions(+), 496 deletions(-) diff --git a/stubs/ExifRead/exifread/__init__.pyi b/stubs/ExifRead/exifread/__init__.pyi index c8b41bc1a..eede72dcd 100644 --- a/stubs/ExifRead/exifread/__init__.pyi +++ b/stubs/ExifRead/exifread/__init__.pyi @@ -8,10 +8,10 @@ logger: Logger def process_file( fh: Reader, - stop_tag: str = ..., - details: bool = ..., - strict: bool = ..., - debug: bool = ..., - truncate_tags: bool = ..., - auto_seek: bool = ..., + stop_tag: str = "UNDEF", + details: bool = True, + strict: bool = False, + debug: bool = False, + truncate_tags: bool = True, + auto_seek: bool = True, ) -> dict[str, Any]: ... diff --git a/stubs/ExifRead/exifread/classes.pyi b/stubs/ExifRead/exifread/classes.pyi index 669fb7414..4e62179ed 100644 --- a/stubs/ExifRead/exifread/classes.pyi +++ b/stubs/ExifRead/exifread/classes.pyi @@ -32,15 +32,15 @@ class ExifHeader: offset: int, fake_exif: bool, strict: bool, - debug: bool = ..., - detailed: bool = ..., - truncate_tags: bool = ..., + debug: bool = False, + detailed: bool = True, + truncate_tags: bool = True, ) -> None: ... - def s2n(self, offset: int, length: int, signed: bool = ...) -> int: ... + def s2n(self, offset: int, length: int, signed: bool = False) -> int: ... def n2b(self, offset: int, length: int) -> bytes: ... def list_ifd(self) -> list[int]: ... def dump_ifd( - self, ifd: int, ifd_name: str, tag_dict: TagDict | None = ..., relative: int = ..., stop_tag: str = ... + self, ifd: int, ifd_name: str, tag_dict: TagDict | None = None, relative: int = 0, stop_tag: str = "UNDEF" ) -> None: ... def extract_tiff_thumbnail(self, thumb_ifd: int) -> None: ... def extract_jpeg_thumbnail(self) -> None: ... diff --git a/stubs/ExifRead/exifread/exif_log.pyi b/stubs/ExifRead/exifread/exif_log.pyi index 15899f4da..f7cbc2521 100644 --- a/stubs/ExifRead/exifread/exif_log.pyi +++ b/stubs/ExifRead/exifread/exif_log.pyi @@ -16,9 +16,9 @@ def setup_logger(debug: bool, color: bool) -> None: ... class Formatter(logging.Formatter): color: bool debug: bool - def __init__(self, debug: bool = ..., color: bool = ...) -> None: ... + def __init__(self, debug: bool = False, color: bool = False) -> None: ... class Handler(logging.StreamHandler[TextIO]): color: bool debug: bool - def __init__(self, log_level: logging._Level, debug: bool = ..., color: bool = ...) -> None: ... + def __init__(self, log_level: logging._Level, debug: bool = False, color: bool = False) -> None: ... diff --git a/stubs/ExifRead/exifread/utils.pyi b/stubs/ExifRead/exifread/utils.pyi index d534019c3..0f8c58219 100644 --- a/stubs/ExifRead/exifread/utils.pyi +++ b/stubs/ExifRead/exifread/utils.pyi @@ -14,7 +14,7 @@ def make_string_uc(seq: str | list[int]) -> str: ... def get_gps_coords(tags: Mapping[str, Any]) -> tuple[float, float]: ... class Ratio(Fraction): - def __new__(cls, numerator: int = ..., denominator: int | None = ...) -> Self: ... + def __new__(cls, numerator: int = 0, denominator: int | None = None) -> Self: ... @property def num(self) -> int: ... @property diff --git a/stubs/Flask-Cors/flask_cors/core.pyi b/stubs/Flask-Cors/flask_cors/core.pyi index 475a0a2f9..c69cfe507 100644 --- a/stubs/Flask-Cors/flask_cors/core.pyi +++ b/stubs/Flask-Cors/flask_cors/core.pyi @@ -51,9 +51,9 @@ def re_fix(reg: str) -> str: ... def try_match_any(inst: str, patterns: Iterable[str | Pattern[str]]) -> bool: ... def try_match(request_origin: str, maybe_regex: str | Pattern[str]) -> bool: ... def get_cors_options(appInstance: flask.Flask | None, *dicts: _Options) -> _Options: ... -def get_app_kwarg_dict(appInstance: flask.Flask | None = ...) -> _Options: ... +def get_app_kwarg_dict(appInstance: flask.Flask | None = None) -> _Options: ... def flexible_str(obj: object) -> str | None: ... -def serialize_option(options_dict: _Options, key: str, upper: bool = ...) -> None: ... +def serialize_option(options_dict: _Options, key: str, upper: bool = False) -> None: ... @overload def ensure_iterable(inst: str) -> list[str]: ... # type: ignore[misc] @overload diff --git a/stubs/Flask-Cors/flask_cors/extension.pyi b/stubs/Flask-Cors/flask_cors/extension.pyi index aef6c137c..28f2d1f1f 100644 --- a/stubs/Flask-Cors/flask_cors/extension.pyi +++ b/stubs/Flask-Cors/flask_cors/extension.pyi @@ -11,7 +11,7 @@ LOG: Logger class CORS: def __init__( self, - app: Incomplete | None = ..., + app: Incomplete | None = None, *, resources: dict[str, dict[str, Any]] | list[str] | str | None = ..., origins: str | list[str] | None = ..., diff --git a/stubs/Flask-Migrate/flask_migrate/__init__.pyi b/stubs/Flask-Migrate/flask_migrate/__init__.pyi index 6a68c7c6f..5f60a5080 100644 --- a/stubs/Flask-Migrate/flask_migrate/__init__.pyi +++ b/stubs/Flask-Migrate/flask_migrate/__init__.pyi @@ -25,82 +25,82 @@ class Migrate: alembic_ctx_kwargs: dict[str, Any] def __init__( self, - app: flask.Flask | None = ..., - db: SQLAlchemy | None = ..., - directory: str = ..., - command: str = ..., - compare_type: bool = ..., - render_as_batch: bool = ..., + app: flask.Flask | None = None, + db: SQLAlchemy | None = None, + directory: str = "migrations", + command: str = "db", + compare_type: bool = True, + render_as_batch: bool = True, **kwargs, ) -> None: ... def init_app( self, app: flask.Flask, - db: SQLAlchemy | None = ..., - directory: str | None = ..., - command: str | None = ..., - compare_type: bool | None = ..., - render_as_batch: bool | None = ..., + db: SQLAlchemy | None = None, + directory: str | None = None, + command: str | None = None, + compare_type: bool | None = None, + render_as_batch: bool | None = None, **kwargs, ) -> None: ... def configure(self, f: _ConfigureCallback) -> _ConfigureCallback: ... def call_configure_callbacks(self, config: Config): ... def get_config( - self, directory: str | None = ..., x_arg: str | Sequence[str] | None = ..., opts: Iterable[str] | None = ... + self, directory: str | None = None, x_arg: str | Sequence[str] | None = None, opts: Iterable[str] | None = None ): ... def catch_errors(f: Callable[_P, _T]) -> Callable[_P, _T]: ... def list_templates() -> None: ... -def init(directory: str | None = ..., multidb: bool = ..., template: str | None = ..., package: bool = ...) -> None: ... +def init(directory: str | None = None, multidb: bool = False, template: str | None = None, package: bool = False) -> None: ... def revision( - directory: str | None = ..., - message: str | None = ..., - autogenerate: bool = ..., - sql: bool = ..., - head: str = ..., - splice: bool = ..., - branch_label: str | None = ..., - version_path: str | None = ..., - rev_id: str | None = ..., + directory: str | None = None, + message: str | None = None, + autogenerate: bool = False, + sql: bool = False, + head: str = "head", + splice: bool = False, + branch_label: str | None = None, + version_path: str | None = None, + rev_id: str | None = None, ) -> None: ... def migrate( - directory: str | None = ..., - message: str | None = ..., - sql: bool = ..., - head: str = ..., - splice: bool = ..., - branch_label: str | None = ..., - version_path: str | None = ..., - rev_id: str | None = ..., - x_arg: str | Sequence[str] | None = ..., + directory: str | None = None, + message: str | None = None, + sql: bool = False, + head: str = "head", + splice: bool = False, + branch_label: str | None = None, + version_path: str | None = None, + rev_id: str | None = None, + x_arg: str | Sequence[str] | None = None, ) -> None: ... -def edit(directory: str | None = ..., revision: str = ...) -> None: ... +def edit(directory: str | None = None, revision: str = "current") -> None: ... def merge( - directory: str | None = ..., - revisions: str = ..., - message: str | None = ..., - branch_label: str | None = ..., - rev_id: str | None = ..., + directory: str | None = None, + revisions: str = "", + message: str | None = None, + branch_label: str | None = None, + rev_id: str | None = None, ) -> None: ... def upgrade( - directory: str | None = ..., - revision: str = ..., - sql: bool = ..., - tag: str | None = ..., - x_arg: str | Sequence[str] | None = ..., + directory: str | None = None, + revision: str = "head", + sql: bool = False, + tag: str | None = None, + x_arg: str | Sequence[str] | None = None, ) -> None: ... def downgrade( - directory: str | None = ..., - revision: str = ..., - sql: bool = ..., - tag: str | None = ..., - x_arg: str | Sequence[str] | None = ..., + directory: str | None = None, + revision: str = "-1", + sql: bool = False, + tag: str | None = None, + x_arg: str | Sequence[str] | None = None, ) -> None: ... -def show(directory: str | None = ..., revision: str = ...) -> None: ... +def show(directory: str | None = None, revision: str = "head") -> None: ... def history( - directory: str | None = ..., rev_range: str | None = ..., verbose: bool = ..., indicate_current: bool = ... + directory: str | None = None, rev_range: str | None = None, verbose: bool = False, indicate_current: bool = False ) -> None: ... -def heads(directory: str | None = ..., verbose: bool = ..., resolve_dependencies: bool = ...) -> None: ... -def branches(directory: str | None = ..., verbose: bool = ...) -> None: ... -def current(directory: str | None = ..., verbose: bool = ...) -> None: ... -def stamp(directory: str | None = ..., revision: str = ..., sql: bool = ..., tag: str | None = ...) -> None: ... +def heads(directory: str | None = None, verbose: bool = False, resolve_dependencies: bool = False) -> None: ... +def branches(directory: str | None = None, verbose: bool = False) -> None: ... +def current(directory: str | None = None, verbose: bool = False) -> None: ... +def stamp(directory: str | None = None, revision: str = "head", sql: bool = False, tag: str | None = None) -> None: ... diff --git a/stubs/Flask-SQLAlchemy/flask_sqlalchemy/__init__.pyi b/stubs/Flask-SQLAlchemy/flask_sqlalchemy/__init__.pyi index e2fadfce8..3b92518bd 100644 --- a/stubs/Flask-SQLAlchemy/flask_sqlalchemy/__init__.pyi +++ b/stubs/Flask-SQLAlchemy/flask_sqlalchemy/__init__.pyi @@ -14,22 +14,22 @@ before_models_committed: Any class SignallingSession(Session): app: Any - def __init__(self, db, autocommit: bool = ..., autoflush: bool = ..., **options) -> None: ... - def get_bind(self, mapper: Incomplete | None = ..., clause: Incomplete | None = ...): ... # type: ignore[override] + def __init__(self, db, autocommit: bool = False, autoflush: bool = True, **options) -> None: ... + def get_bind(self, mapper: Incomplete | None = None, clause: Incomplete | None = None): ... # type: ignore[override] def get_debug_queries(): ... _T = TypeVar("_T") class BaseQuery(Query[_T]): - def get_or_404(self, ident, description: Incomplete | None = ...): ... - def first_or_404(self, description: Incomplete | None = ...): ... + def get_or_404(self, ident, description: Incomplete | None = None): ... + def first_or_404(self, description: Incomplete | None = None): ... def paginate( self, - page: Incomplete | None = ..., - per_page: Incomplete | None = ..., - error_out: bool = ..., - max_per_page: Incomplete | None = ..., + page: Incomplete | None = None, + per_page: Incomplete | None = None, + error_out: bool = True, + max_per_page: Incomplete | None = None, ) -> Pagination[_T]: ... class Pagination(Generic[_T]): @@ -41,18 +41,18 @@ class Pagination(Generic[_T]): def __init__(self, query: BaseQuery[_T] | None, page: int, per_page: int, total: int | None, items) -> None: ... @property def pages(self) -> int: ... - def prev(self, error_out: bool = ...) -> Pagination[_T]: ... + def prev(self, error_out: bool = False) -> Pagination[_T]: ... @property def prev_num(self) -> int | None: ... @property def has_prev(self) -> bool: ... - def next(self, error_out: bool = ...) -> Pagination[_T]: ... + def next(self, error_out: bool = False) -> Pagination[_T]: ... @property def has_next(self) -> bool: ... @property def next_num(self) -> int | None: ... def iter_pages( - self, left_edge: int = ..., left_current: int = ..., right_current: int = ..., right_edge: int = ... + self, left_edge: int = 2, left_current: int = 2, right_current: int = 5, right_edge: int = 2 ) -> Generator[int | None, None, None]: ... def get_state(app): ... @@ -65,33 +65,33 @@ class SQLAlchemy: app: Any def __init__( self, - app: Incomplete | None = ..., - use_native_unicode: bool = ..., - session_options: Incomplete | None = ..., - metadata: Incomplete | None = ..., + app: Incomplete | None = None, + use_native_unicode: bool = True, + session_options: Incomplete | None = None, + metadata: Incomplete | None = None, query_class=..., model_class=..., - engine_options: Incomplete | None = ..., + engine_options: Incomplete | None = None, ) -> None: ... @property def metadata(self): ... - def create_scoped_session(self, options: Incomplete | None = ...): ... + def create_scoped_session(self, options: Incomplete | None = None): ... def create_session(self, options): ... - def make_declarative_base(self, model, metadata: Incomplete | None = ...): ... + def make_declarative_base(self, model, metadata: Incomplete | None = None): ... def init_app(self, app): ... def apply_pool_defaults(self, app, options): ... def apply_driver_hacks(self, app, sa_url, options): ... @property def engine(self): ... - def make_connector(self, app: Incomplete | None = ..., bind: Incomplete | None = ...): ... - def get_engine(self, app: Incomplete | None = ..., bind: Incomplete | None = ...): ... + def make_connector(self, app: Incomplete | None = None, bind: Incomplete | None = None): ... + def get_engine(self, app: Incomplete | None = None, bind: Incomplete | None = None): ... def create_engine(self, sa_url, engine_opts): ... - def get_app(self, reference_app: Incomplete | None = ...): ... - def get_tables_for_bind(self, bind: Incomplete | None = ...): ... - def get_binds(self, app: Incomplete | None = ...): ... - def create_all(self, bind: str = ..., app: Incomplete | None = ...) -> None: ... - def drop_all(self, bind: str = ..., app: Incomplete | None = ...) -> None: ... - def reflect(self, bind: str = ..., app: Incomplete | None = ...) -> None: ... + def get_app(self, reference_app: Incomplete | None = None): ... + def get_tables_for_bind(self, bind: Incomplete | None = None): ... + def get_binds(self, app: Incomplete | None = None): ... + def create_all(self, bind: str = "__all__", app: Incomplete | None = None) -> None: ... + def drop_all(self, bind: str = "__all__", app: Incomplete | None = None) -> None: ... + def reflect(self, bind: str = "__all__", app: Incomplete | None = None) -> None: ... def __getattr__(self, name: str) -> Any: ... # exposes dynamically classes of SQLAlchemy class FSADeprecationWarning(DeprecationWarning): ... diff --git a/stubs/emoji/emoji/core.pyi b/stubs/emoji/emoji/core.pyi index 498586dee..5dfdfc171 100644 --- a/stubs/emoji/emoji/core.pyi +++ b/stubs/emoji/emoji/core.pyi @@ -10,22 +10,22 @@ class _EmojiListReturn(TypedDict): def emojize( string: str, - delimiters: tuple[str, str] = ..., - variant: Literal["text_type", "emoji_type", None] = ..., - language: str = ..., - version: float | None = ..., - handle_version: str | Callable[[str, dict[str, str]], str] | None = ..., + delimiters: tuple[str, str] = (":", ":"), + variant: Literal["text_type", "emoji_type", None] = None, + language: str = "en", + version: float | None = None, + handle_version: str | Callable[[str, dict[str, str]], str] | None = None, ) -> str: ... def demojize( string: str, - delimiters: tuple[str, str] = ..., - language: str = ..., - version: float | None = ..., - handle_version: str | Callable[[str, dict[str, str]], str] | None = ..., + delimiters: tuple[str, str] = (":", ":"), + language: str = "en", + version: float | None = None, + handle_version: str | Callable[[str, dict[str, str]], str] | None = None, ) -> str: ... -def replace_emoji(string: str, replace: str | Callable[[str, dict[str, str]], str] = ..., version: float = ...) -> str: ... +def replace_emoji(string: str, replace: str | Callable[[str, dict[str, str]], str] = "", version: float = -1) -> str: ... def emoji_list(string: str) -> list[_EmojiListReturn]: ... def distinct_emoji_list(string: str) -> list[str]: ... -def emoji_count(string: str, unique: bool = ...) -> int: ... +def emoji_count(string: str, unique: bool = False) -> int: ... def version(string: str) -> float: ... def is_emoji(string: str) -> bool: ... diff --git a/stubs/flake8-plugin-utils/flake8_plugin_utils/plugin.pyi b/stubs/flake8-plugin-utils/flake8_plugin_utils/plugin.pyi index 6949ec275..b2f4267cb 100644 --- a/stubs/flake8-plugin-utils/flake8_plugin_utils/plugin.pyi +++ b/stubs/flake8-plugin-utils/flake8_plugin_utils/plugin.pyi @@ -19,7 +19,7 @@ class Error: class Visitor(ast.NodeVisitor, Generic[TConfig]): errors: list[Error] @overload - def __init__(self, config: None = ...) -> None: ... + def __init__(self, config: None = None) -> None: ... @overload def __init__(self, config: TConfig) -> None: ... @property diff --git a/stubs/flake8-plugin-utils/flake8_plugin_utils/utils/assertions.pyi b/stubs/flake8-plugin-utils/flake8_plugin_utils/utils/assertions.pyi index d030a527f..2071ea301 100644 --- a/stubs/flake8-plugin-utils/flake8_plugin_utils/utils/assertions.pyi +++ b/stubs/flake8-plugin-utils/flake8_plugin_utils/utils/assertions.pyi @@ -3,6 +3,6 @@ from typing import Any from ..plugin import Error as Error, TConfig as TConfig, Visitor as Visitor def assert_error( - visitor_cls: type[Visitor[TConfig]], src: str, expected: type[Error], config: TConfig | None = ..., **kwargs: Any + visitor_cls: type[Visitor[TConfig]], src: str, expected: type[Error], config: TConfig | None = None, **kwargs: Any ) -> None: ... -def assert_not_error(visitor_cls: type[Visitor[TConfig]], src: str, config: TConfig | None = ...) -> None: ... +def assert_not_error(visitor_cls: type[Visitor[TConfig]], src: str, config: TConfig | None = None) -> None: ... diff --git a/stubs/fpdf2/fpdf/actions.pyi b/stubs/fpdf2/fpdf/actions.pyi index 128155fab..98c9dc82b 100644 --- a/stubs/fpdf2/fpdf/actions.pyi +++ b/stubs/fpdf2/fpdf/actions.pyi @@ -5,32 +5,32 @@ from .syntax import PDFObject class Action(ABC): next: PDFObject | str | None - def __init__(self, next_action: PDFObject | str | None = ...) -> None: ... + def __init__(self, next_action: PDFObject | str | None = None) -> None: ... @abstractmethod def serialize(self) -> str: ... class URIAction(Action): uri: str - def __init__(self, uri: str, next_action: PDFObject | str | None = ...) -> None: ... + def __init__(self, uri: str, next_action: PDFObject | str | None = None) -> None: ... def serialize(self) -> str: ... class NamedAction(Action): action_name: str - def __init__(self, action_name: str, next_action: PDFObject | str | None = ...) -> None: ... + def __init__(self, action_name: str, next_action: PDFObject | str | None = None) -> None: ... def serialize(self) -> str: ... class GoToAction(Action): dest: Incomplete - def __init__(self, dest, next_action: PDFObject | str | None = ...) -> None: ... + def __init__(self, dest, next_action: PDFObject | str | None = None) -> None: ... def serialize(self) -> str: ... class GoToRemoteAction(Action): file: str dest: Incomplete - def __init__(self, file: str, dest, next_action: PDFObject | str | None = ...) -> None: ... + def __init__(self, file: str, dest, next_action: PDFObject | str | None = None) -> None: ... def serialize(self) -> str: ... class LaunchAction(Action): file: str - def __init__(self, file: str, next_action: PDFObject | str | None = ...) -> None: ... + def __init__(self, file: str, next_action: PDFObject | str | None = None) -> None: ... def serialize(self) -> str: ... diff --git a/stubs/fpdf2/fpdf/annotations.pyi b/stubs/fpdf2/fpdf/annotations.pyi index acf715b1d..fc0b76521 100644 --- a/stubs/fpdf2/fpdf/annotations.pyi +++ b/stubs/fpdf2/fpdf/annotations.pyi @@ -35,19 +35,19 @@ class AnnotationMixin: width: int, height: int, flags: tuple[AnnotationFlag, ...] = ..., - contents: str | None = ..., - dest: Destination | None = ..., - action: Action | None = ..., - color: tuple[int, int, int] | None = ..., - modification_time: datetime | None = ..., - title: str | None = ..., - quad_points: tuple[float, ...] | None = ..., # multiple of 8 floats - border_width: int = ..., - name: AnnotationName | FileAttachmentAnnotationName | None = ..., - ink_list: tuple[int, ...] = ..., - file_spec: str | None = ..., - field_type: str | None = ..., - value: Incomplete | None = ..., + contents: str | None = None, + dest: Destination | None = None, + action: Action | None = None, + color: tuple[int, int, int] | None = None, + modification_time: datetime | None = None, + title: str | None = None, + quad_points: tuple[float, ...] | None = None, # multiple of 8 floats + border_width: int = 0, + name: AnnotationName | FileAttachmentAnnotationName | None = None, + ink_list: tuple[int, ...] = (), + file_spec: str | None = None, + field_type: str | None = None, + value: Incomplete | None = None, ) -> None: ... class PDFAnnotation(AnnotationMixin, PDFObject): ... @@ -62,11 +62,11 @@ class PDFEmbeddedFile(PDFContentStream): self, basename: str, contents: bytes, - desc: str = ..., - creation_date: datetime | None = ..., - modification_date: datetime | None = ..., - compress: bool = ..., - checksum: bool = ..., + desc: str = "", + creation_date: datetime | None = None, + modification_date: datetime | None = None, + compress: bool = False, + checksum: bool = False, ) -> None: ... def globally_enclosed(self) -> bool: ... def set_globally_enclosed(self, value: bool) -> None: ... diff --git a/stubs/fpdf2/fpdf/drawing.pyi b/stubs/fpdf2/fpdf/drawing.pyi index 24a1b543c..ed2aa272c 100644 --- a/stubs/fpdf2/fpdf/drawing.pyi +++ b/stubs/fpdf2/fpdf/drawing.pyi @@ -38,7 +38,7 @@ class _DeviceRGBBase(NamedTuple): class DeviceRGB(_DeviceRGBBase): OPERATOR: ClassVar[str] - def __new__(cls, r: Number, g: Number, b: Number, a: Number | None = ...) -> Self: ... + def __new__(cls, r: Number, g: Number, b: Number, a: Number | None = None) -> Self: ... @property def colors(self) -> tuple[Number, Number, Number]: ... def serialize(self) -> str: ... @@ -49,7 +49,7 @@ class _DeviceGrayBase(NamedTuple): class DeviceGray(_DeviceGrayBase): OPERATOR: ClassVar[str] - def __new__(cls, g: Number, a: Number | None = ...) -> Self: ... + def __new__(cls, g: Number, a: Number | None = None) -> Self: ... @property def colors(self) -> tuple[Number]: ... def serialize(self) -> str: ... @@ -63,14 +63,14 @@ class _DeviceCMYKBase(NamedTuple): class DeviceCMYK(_DeviceCMYKBase): OPERATOR: ClassVar[str] - def __new__(cls, c: Number, m: Number, y: Number, k: Number, a: Number | None = ...) -> Self: ... + def __new__(cls, c: Number, m: Number, y: Number, k: Number, a: Number | None = None) -> Self: ... @property def colors(self) -> tuple[Number, Number, Number, Number]: ... def serialize(self) -> str: ... -def rgb8(r, g, b, a: Incomplete | None = ...) -> DeviceRGB: ... -def gray8(g, a: Incomplete | None = ...) -> DeviceGray: ... -def cmyk8(c, m, y, k, a: Incomplete | None = ...) -> DeviceCMYK: ... +def rgb8(r, g, b, a: Incomplete | None = None) -> DeviceRGB: ... +def gray8(g, a: Incomplete | None = None) -> DeviceGray: ... +def cmyk8(c, m, y, k, a: Incomplete | None = None) -> DeviceCMYK: ... def color_from_hex_string(hexstr) -> DeviceRGB: ... def color_from_rgb_string(rgbstr) -> DeviceRGB: ... @@ -102,18 +102,18 @@ class Transform(NamedTuple): @classmethod def translation(cls, x, y): ... @classmethod - def scaling(cls, x, y: Incomplete | None = ...): ... + def scaling(cls, x, y: Incomplete | None = None): ... @classmethod def rotation(cls, theta): ... @classmethod def rotation_d(cls, theta_d): ... @classmethod - def shearing(cls, x, y: Incomplete | None = ...): ... + def shearing(cls, x, y: Incomplete | None = None): ... def translate(self, x, y): ... - def scale(self, x, y: Incomplete | None = ...): ... + def scale(self, x, y: Incomplete | None = None): ... def rotate(self, theta): ... def rotate_d(self, theta_d): ... - def shear(self, x, y: Incomplete | None = ...): ... + def shear(self, x, y: Incomplete | None = None): ... def about(self, x, y): ... def __mul__(self, other): ... def __rmul__(self, other): ... @@ -316,12 +316,12 @@ class Close(NamedTuple): class DrawingContext: def __init__(self) -> None: ... - def add_item(self, item, _copy: bool = ...) -> None: ... + def add_item(self, item, _copy: bool = True) -> None: ... def render(self, gsd_registry, first_point, scale, height, starting_style): ... def render_debug(self, gsd_registry, first_point, scale, height, starting_style, debug_stream): ... class PaintedPath: - def __init__(self, x: int = ..., y: int = ...) -> None: ... + def __init__(self, x: int = 0, y: int = 0) -> None: ... def __deepcopy__(self, memo) -> Self: ... @property def style(self): ... @@ -343,9 +343,9 @@ class PaintedPath: def clipping_path(self, new_clipath) -> None: ... @contextmanager def transform_group(self, transform) -> Iterator[Self]: ... - def add_path_element(self, item, _copy: bool = ...) -> None: ... + def add_path_element(self, item, _copy: bool = True) -> None: ... def remove_last_path_element(self) -> None: ... - def rectangle(self, x, y, w, h, rx: int = ..., ry: int = ...) -> Self: ... + def rectangle(self, x, y, w, h, rx: int = 0, ry: int = 0) -> Self: ... def circle(self, cx, cy, r) -> Self: ... def ellipse(self, cx, cy, rx, ry) -> Self: ... def move_to(self, x, y) -> Self: ... @@ -364,15 +364,15 @@ class PaintedPath: def arc_relative(self, rx, ry, rotation, large_arc, positive_sweep, dx, dy) -> Self: ... def close(self) -> None: ... def render( - self, gsd_registry, style, last_item, initial_point, debug_stream: Incomplete | None = ..., pfx: Incomplete | None = ... + self, gsd_registry, style, last_item, initial_point, debug_stream: Incomplete | None = None, pfx: Incomplete | None = None ): ... def render_debug(self, gsd_registry, style, last_item, initial_point, debug_stream, pfx): ... class ClippingPath(PaintedPath): paint_rule: Incomplete - def __init__(self, x: int = ..., y: int = ...) -> None: ... + def __init__(self, x: int = 0, y: int = 0) -> None: ... def render( - self, gsd_registry, style, last_item, initial_point, debug_stream: Incomplete | None = ..., pfx: Incomplete | None = ... + self, gsd_registry, style, last_item, initial_point, debug_stream: Incomplete | None = None, pfx: Incomplete | None = None ): ... def render_debug(self, gsd_registry, style, last_item, initial_point, debug_stream, pfx): ... @@ -389,7 +389,7 @@ class GraphicsContext: def clipping_path(self) -> ClippingPath | None: ... @clipping_path.setter def clipping_path(self, new_clipath) -> None: ... - def add_item(self, item, _copy: bool = ...) -> None: ... + def add_item(self, item, _copy: bool = True) -> None: ... def remove_last_item(self) -> None: ... def merge(self, other_context) -> None: ... def build_render_list( @@ -398,9 +398,9 @@ class GraphicsContext: style, last_item, initial_point, - debug_stream: Incomplete | None = ..., - pfx: Incomplete | None = ..., - _push_stack: bool = ..., + debug_stream: Incomplete | None = None, + pfx: Incomplete | None = None, + _push_stack: bool = True, ): ... def render( self, @@ -408,10 +408,10 @@ class GraphicsContext: style: DrawingContext, last_item, initial_point, - debug_stream: Incomplete | None = ..., - pfx: Incomplete | None = ..., - _push_stack: bool = ..., + debug_stream: Incomplete | None = None, + pfx: Incomplete | None = None, + _push_stack: bool = True, ): ... def render_debug( - self, gsd_registry, style: DrawingContext, last_item, initial_point, debug_stream, pfx, _push_stack: bool = ... + self, gsd_registry, style: DrawingContext, last_item, initial_point, debug_stream, pfx, _push_stack: bool = True ): ... diff --git a/stubs/fpdf2/fpdf/errors.pyi b/stubs/fpdf2/fpdf/errors.pyi index c417166e0..a2aff7bb1 100644 --- a/stubs/fpdf2/fpdf/errors.pyi +++ b/stubs/fpdf2/fpdf/errors.pyi @@ -6,7 +6,7 @@ class FPDFPageFormatException(FPDFException): argument: Any unknown: Any one: Any - def __init__(self, argument, unknown: bool = ..., one: bool = ...) -> None: ... + def __init__(self, argument, unknown: bool = False, one: bool = False) -> None: ... class FPDFUnicodeEncodingException(FPDFException): def __init__(self, text_index, character, font_name) -> None: ... diff --git a/stubs/fpdf2/fpdf/fpdf.pyi b/stubs/fpdf2/fpdf/fpdf.pyi index 0c6b86b34..1c65fb915 100644 --- a/stubs/fpdf2/fpdf/fpdf.pyi +++ b/stubs/fpdf2/fpdf/fpdf.pyi @@ -64,7 +64,7 @@ class SubsetMap: def pick(self, unicode: int) -> int: ... def dict(self) -> dict[int, int]: ... -def get_page_format(format: _Format | tuple[float, float], k: float | None = ...) -> tuple[float, float]: ... +def get_page_format(format: _Format | tuple[float, float], k: float | None = None) -> tuple[float, float]: ... # TODO: TypedDicts _Font: TypeAlias = dict[str, Any] @@ -143,10 +143,10 @@ class FPDF: def __init__( self, - orientation: _Orientation = ..., - unit: _Unit | float = ..., - format: _Format | tuple[float, float] = ..., - font_cache_dir: Literal["DEPRECATED"] = ..., + orientation: _Orientation = "portrait", + unit: _Unit | float = "mm", + format: _Format | tuple[float, float] = "A4", + font_cache_dir: Literal["DEPRECATED"] = "DEPRECATED", ) -> None: ... # The following definition crashes stubtest 0.991, but seems to be fixed # in later versions. @@ -171,7 +171,7 @@ class FPDF: @property def pages_count(self) -> int: ... def set_margin(self, margin: float) -> None: ... - def set_margins(self, left: float, top: float, right: float = ...) -> None: ... + def set_margins(self, left: float, top: float, right: float = -1) -> None: ... def set_left_margin(self, margin: float) -> None: ... def set_top_margin(self, margin: float) -> None: ... r_margin: float @@ -179,7 +179,7 @@ class FPDF: auto_page_break: bool b_margin: float page_break_trigger: float - def set_auto_page_break(self, auto: bool, margin: float = ...) -> None: ... + def set_auto_page_break(self, auto: bool, margin: float = 0) -> None: ... @property def default_page_dimensions(self) -> tuple[float, float]: ... zoom_mode: Literal["fullpage", "fullwidth", "real", "default"] | float @@ -187,7 +187,7 @@ class FPDF: def set_display_mode( self, zoom: Literal["fullpage", "fullwidth", "real", "default"] | float, - layout: Literal["single", "continuous", "two", "default"] = ..., + layout: Literal["single", "continuous", "two", "default"] = "continuous", ) -> None: ... def set_compression(self, compress: bool) -> None: ... title: str @@ -208,56 +208,62 @@ class FPDF: def set_xmp_metadata(self, xmp_metadata: str) -> None: ... def set_doc_option(self, opt: str, value: str) -> None: ... def set_image_filter(self, image_filter: str) -> None: ... - def alias_nb_pages(self, alias: str = ...) -> None: ... + def alias_nb_pages(self, alias: str = "{nb}") -> None: ... def add_page( self, - orientation: _Orientation = ..., - format: _Format | tuple[float, float] = ..., - same: bool = ..., - duration: int = ..., - transition: Incomplete | None = ..., + orientation: _Orientation = "", + format: _Format | tuple[float, float] = "", + same: bool = False, + duration: int = 0, + transition: Incomplete | None = None, ) -> None: ... def header(self) -> None: ... def footer(self) -> None: ... def page_no(self) -> int: ... - def set_draw_color(self, r: int, g: int = ..., b: int = ...) -> None: ... - def set_fill_color(self, r: int, g: int = ..., b: int = ...) -> None: ... - def set_text_color(self, r: int, g: int = ..., b: int = ...) -> None: ... - def get_string_width(self, s: str, normalized: bool = ..., markdown: bool = ...) -> float: ... + def set_draw_color(self, r: int, g: int = -1, b: int = -1) -> None: ... + def set_fill_color(self, r: int, g: int = -1, b: int = -1) -> None: ... + def set_text_color(self, r: int, g: int = -1, b: int = -1) -> None: ... + def get_string_width(self, s: str, normalized: bool = False, markdown: bool = False) -> float: ... def set_line_width(self, width: float) -> None: ... def set_page_background(self, background) -> None: ... - def drawing_context(self, debug_stream: Incomplete | None = ...) -> _GeneratorContextManager[DrawingContext]: ... + def drawing_context(self, debug_stream: Incomplete | None = None) -> _GeneratorContextManager[DrawingContext]: ... def new_path( - self, x: float = ..., y: float = ..., paint_rule: PathPaintRule = ..., debug_stream: Incomplete | None = ... + self, x: float = 0, y: float = 0, paint_rule: PathPaintRule = ..., debug_stream: Incomplete | None = None ) -> _GeneratorContextManager[PaintedPath]: ... - def draw_path(self, path: PaintedPath, debug_stream: Incomplete | None = ...) -> None: ... - def set_dash_pattern(self, dash: float = ..., gap: float = ..., phase: float = ...) -> None: ... + def draw_path(self, path: PaintedPath, debug_stream: Incomplete | None = None) -> None: ... + def set_dash_pattern(self, dash: float = 0, gap: float = 0, phase: float = 0) -> None: ... def line(self, x1: float, y1: float, x2: float, y2: float) -> None: ... def polyline( - self, point_list: list[tuple[float, float]], fill: bool = ..., polygon: bool = ..., style: RenderStyle | str | None = ... + self, + point_list: list[tuple[float, float]], + fill: bool = False, + polygon: bool = False, + style: RenderStyle | str | None = None, ) -> None: ... - def polygon(self, point_list: list[tuple[float, float]], fill: bool = ..., style: RenderStyle | str | None = ...) -> None: ... - def dashed_line(self, x1, y1, x2, y2, dash_length: int = ..., space_length: int = ...) -> None: ... + def polygon( + self, point_list: list[tuple[float, float]], fill: bool = False, style: RenderStyle | str | None = None + ) -> None: ... + def dashed_line(self, x1, y1, x2, y2, dash_length: int = 1, space_length: int = 1) -> None: ... def rect( self, x: float, y: float, w: float, h: float, - style: RenderStyle | str | None = ..., - round_corners: tuple[str, ...] | tuple[Corner, ...] | bool = ..., - corner_radius: float = ..., + style: RenderStyle | str | None = None, + round_corners: tuple[str, ...] | tuple[Corner, ...] | bool = False, + corner_radius: float = 0, ) -> None: ... - def ellipse(self, x: float, y: float, w: float, h: float, style: RenderStyle | str | None = ...) -> None: ... - def circle(self, x: float, y: float, r, style: RenderStyle | str | None = ...) -> None: ... + def ellipse(self, x: float, y: float, w: float, h: float, style: RenderStyle | str | None = None) -> None: ... + def circle(self, x: float, y: float, r, style: RenderStyle | str | None = None) -> None: ... def regular_polygon( self, x: float, y: float, numSides: int, polyWidth: float, - rotateDegrees: float = ..., - style: RenderStyle | str | None = ..., + rotateDegrees: float = 0, + style: RenderStyle | str | None = None, ): ... def star( self, @@ -266,8 +272,8 @@ class FPDF: r_in: float, r_out: float, corners: int, - rotate_degrees: float = ..., - style: RenderStyle | str | None = ..., + rotate_degrees: float = 0, + style: RenderStyle | str | None = None, ): ... def arc( self, @@ -276,12 +282,12 @@ class FPDF: a: float, start_angle: float, end_angle: float, - b: float | None = ..., - inclination: float = ..., - clockwise: bool = ..., - start_from_center: bool = ..., - end_at_center: bool = ..., - style: RenderStyle | str | None = ..., + b: float | None = None, + inclination: float = 0, + clockwise: bool = False, + start_from_center: bool = False, + end_at_center: bool = False, + style: RenderStyle | str | None = None, ) -> None: ... def solid_arc( self, @@ -290,10 +296,10 @@ class FPDF: a: float, start_angle: float, end_angle: float, - b: float | None = ..., - inclination: float = ..., - clockwise: bool = ..., - style: RenderStyle | str | None = ..., + b: float | None = None, + inclination: float = 0, + clockwise: bool = False, + style: RenderStyle | str | None = None, ) -> None: ... def add_font( self, @@ -302,21 +308,21 @@ class FPDF: fname: str | PurePath | None = None, uni: bool | Literal["DEPRECATED"] = "DEPRECATED", ) -> None: ... - def set_font(self, family: str | None = ..., style: _FontStyles = ..., size: int = ...) -> None: ... + def set_font(self, family: str | None = None, style: _FontStyles = "", size: int = 0) -> None: ... def set_font_size(self, size: float) -> None: ... def set_char_spacing(self, spacing: float) -> None: ... def set_stretching(self, stretching: float) -> None: ... def add_link(self, y: float = 0, x: float = 0, page: int = -1, zoom: float | Literal["null"] = "null") -> int: ... def set_link(self, link, y: float = 0, x: float = 0, page: int = -1, zoom: float | Literal["null"] = "null") -> None: ... def link( - self, x: float, y: float, w: float, h: float, link: str | int, alt_text: str | None = ..., border_width: int = ... + self, x: float, y: float, w: float, h: float, link: str | int, alt_text: str | None = None, border_width: int = 0 ) -> AnnotationDict: ... def embed_file( self, - file_path: StrPath | None = ..., - bytes: bytes | None = ..., - basename: str | None = ..., - modification_date: datetime.datetime | None = ..., + file_path: StrPath | None = None, + bytes: bytes | None = None, + basename: str | None = None, + modification_date: datetime.datetime | None = None, *, creation_date: datetime.datetime | None = ..., desc: str = ..., @@ -328,9 +334,9 @@ class FPDF: file_path: StrPath, x: float, y: float, - w: float = ..., - h: float = ..., - name: FileAttachmentAnnotationName | str | None = ..., + w: float = 1, + h: float = 1, + name: FileAttachmentAnnotationName | str | None = None, flags: Iterable[AnnotationFlag | str] = ..., *, bytes: bytes | None = ..., @@ -346,19 +352,19 @@ class FPDF: x: float, y: float, text: str, - w: float = ..., - h: float = ..., - name: AnnotationName | str | None = ..., + w: float = 1, + h: float = 1, + name: AnnotationName | str | None = None, flags: tuple[AnnotationFlag, ...] | tuple[str, ...] = ..., ) -> None: ... def add_action(self, action, x: float, y: float, w: float, h: float) -> None: ... def highlight( self, text: str, - title: str = ..., - type: TextMarkupType | str = ..., - color: tuple[float, float, float] = ..., - modification_time: datetime.datetime | None = ..., + title: str = "", + type: TextMarkupType | str = "Highlight", + color: tuple[float, float, float] = (1, 1, 0), + modification_time: datetime.datetime | None = None, ) -> _GeneratorContextManager[None]: ... add_highlight = highlight def add_text_markup_annotation( @@ -366,51 +372,51 @@ class FPDF: type: str, text: str, quad_points: Sequence[int], - title: str = ..., - color: tuple[float, float, float] = ..., - modification_time: datetime.datetime | None = ..., - page: int | None = ..., + title: str = "", + color: tuple[float, float, float] = (1, 1, 0), + modification_time: datetime.datetime | None = None, + page: int | None = None, ) -> AnnotationDict: ... def ink_annotation( self, coords: Iterable[Incomplete], - contents: str = ..., - title: str = ..., - color: Sequence[float] = ..., - border_width: int = ..., + contents: str = "", + title: str = "", + color: Sequence[float] = (1, 1, 0), + border_width: int = 1, ) -> AnnotationDict: ... - def text(self, x: float, y: float, txt: str = ...) -> None: ... - def rotate(self, angle: float, x: float | None = ..., y: float | None = ...) -> None: ... - def rotation(self, angle: float, x: float | None = ..., y: float | None = ...) -> _GeneratorContextManager[None]: ... + def text(self, x: float, y: float, txt: str = "") -> None: ... + def rotate(self, angle: float, x: float | None = None, y: float | None = None) -> None: ... + def rotation(self, angle: float, x: float | None = None, y: float | None = None) -> _GeneratorContextManager[None]: ... def skew( self, ax: float = 0, ay: float = 0, x: float | None = None, y: float | None = None ) -> _GeneratorContextManager[None]: ... def local_context( self, - font_family: Incomplete | None = ..., - font_style: Incomplete | None = ..., - font_size: Incomplete | None = ..., - line_width: Incomplete | None = ..., - draw_color: Incomplete | None = ..., - fill_color: Incomplete | None = ..., - text_color: Incomplete | None = ..., - dash_pattern: Incomplete | None = ..., + font_family: Incomplete | None = None, + font_style: Incomplete | None = None, + font_size: Incomplete | None = None, + line_width: Incomplete | None = None, + draw_color: Incomplete | None = None, + fill_color: Incomplete | None = None, + text_color: Incomplete | None = None, + dash_pattern: Incomplete | None = None, **kwargs, ) -> _GeneratorContextManager[None]: ... @property def accept_page_break(self) -> bool: ... def cell( self, - w: float | None = ..., - h: float | None = ..., - txt: str = ..., - border: bool | Literal[0, 1] | str = ..., - ln: int | Literal["DEPRECATED"] = ..., + w: float | None = None, + h: float | None = None, + txt: str = "", + border: bool | Literal[0, 1] | str = 0, + ln: int | Literal["DEPRECATED"] = "DEPRECATED", align: str | Align = ..., - fill: bool = ..., - link: str = ..., - center: bool | Literal["DEPRECATED"] = ..., - markdown: bool = ..., + fill: bool = False, + link: str = "", + center: bool | Literal["DEPRECATED"] = "DEPRECATED", + markdown: bool = False, new_x: XPos | str = ..., new_y: YPos | str = ..., ) -> bool: ... @@ -418,21 +424,21 @@ class FPDF: def multi_cell( self, w: float, - h: float | None = ..., - txt: str = ..., - border: bool | Literal[0, 1] | str = ..., + h: float | None = None, + txt: str = "", + border: bool | Literal[0, 1] | str = 0, align: str | Align = ..., - fill: bool = ..., - split_only: bool = ..., - link: str | int = ..., - ln: int | Literal["DEPRECATED"] = ..., - max_line_height: float | None = ..., - markdown: bool = ..., - print_sh: bool = ..., + fill: bool = False, + split_only: bool = False, + link: str | int = "", + ln: int | Literal["DEPRECATED"] = "DEPRECATED", + max_line_height: float | None = None, + markdown: bool = False, + print_sh: bool = False, new_x: XPos | str = ..., new_y: YPos | str = ..., ): ... - def write(self, h: float | None = ..., txt: str = ..., link: str = ..., print_sh: bool = ...) -> None: ... + def write(self, h: float | None = None, txt: str = "", link: str = "", print_sh: bool = False) -> None: ... def image( self, name: str | Image.Image | BytesIO | StrPath, @@ -446,57 +452,57 @@ class FPDF: alt_text: str | None = None, dims: tuple[float, float] | None = None, ) -> _Image: ... - def ln(self, h: float | None = ...) -> None: ... + def ln(self, h: float | None = None) -> None: ... def get_x(self) -> float: ... def set_x(self, x: float) -> None: ... def get_y(self) -> float: ... def set_y(self, y: float) -> None: ... def set_xy(self, x: float, y: float) -> None: ... @overload - def output(self, name: Literal[""] = ...) -> bytearray: ... # type: ignore[misc] + def output(self, name: Literal[""] = "") -> bytearray: ... # type: ignore[misc] @overload def output(self, name: str) -> None: ... def normalize_text(self, txt: str) -> str: ... def sign_pkcs12( self, pkcs_filepath: str, - password: bytes | None = ..., - hashalgo: str = ..., - contact_info: str | None = ..., - location: str | None = ..., - signing_time: datetime.datetime | None = ..., - reason: str | None = ..., + password: bytes | None = None, + hashalgo: str = "sha256", + contact_info: str | None = None, + location: str | None = None, + signing_time: datetime.datetime | None = None, + reason: str | None = None, flags: tuple[AnnotationFlag, ...] = ..., ) -> None: ... def sign( self, key, cert, - extra_certs: Sequence[Incomplete] = ..., - hashalgo: str = ..., - contact_info: str | None = ..., - location: str | None = ..., - signing_time: datetime.datetime | None = ..., - reason: str | None = ..., + extra_certs: Sequence[Incomplete] = (), + hashalgo: str = "sha256", + contact_info: str | None = None, + location: str | None = None, + signing_time: datetime.datetime | None = None, + reason: str | None = None, flags: tuple[AnnotationFlag, ...] = ..., ) -> None: ... def file_id(self) -> str: ... - def interleaved2of5(self, txt, x: float, y: float, w: float = ..., h: float = ...) -> None: ... - def code39(self, txt, x: float, y: float, w: float = ..., h: float = ...) -> None: ... + def interleaved2of5(self, txt, x: float, y: float, w: float = 1, h: float = 10) -> None: ... + def code39(self, txt, x: float, y: float, w: float = 1.5, h: float = 5) -> None: ... def rect_clip(self, x: float, y: float, w: float, h: float) -> _GeneratorContextManager[None]: ... def elliptic_clip(self, x: float, y: float, w: float, h: float) -> _GeneratorContextManager[None]: ... def round_clip(self, x: float, y: float, r: float) -> _GeneratorContextManager[None]: ... def unbreakable(self) -> _GeneratorContextManager[FPDFRecorder]: ... def offset_rendering(self) -> _GeneratorContextManager[FPDFRecorder]: ... - def insert_toc_placeholder(self, render_toc_function, pages: int = ...) -> None: ... + def insert_toc_placeholder(self, render_toc_function, pages: int = 1) -> None: ... def set_section_title_styles( self, level0: TitleStyle, - level1: TitleStyle | None = ..., - level2: TitleStyle | None = ..., - level3: TitleStyle | None = ..., - level4: TitleStyle | None = ..., - level5: TitleStyle | None = ..., - level6: TitleStyle | None = ..., + level1: TitleStyle | None = None, + level2: TitleStyle | None = None, + level3: TitleStyle | None = None, + level4: TitleStyle | None = None, + level5: TitleStyle | None = None, + level6: TitleStyle | None = None, ) -> None: ... def start_section(self, name: str, level: int = 0, strict: bool = True) -> None: ... diff --git a/stubs/fpdf2/fpdf/html.pyi b/stubs/fpdf2/fpdf/html.pyi index 34ae19685..1cd38573f 100644 --- a/stubs/fpdf2/fpdf/html.pyi +++ b/stubs/fpdf2/fpdf/html.pyi @@ -22,7 +22,7 @@ TRAILING_SPACE: Pattern[str] COLOR_DICT: Final[dict[str, str]] def px2mm(px: float) -> float: ... -def color_as_decimal(color: str | None = ...) -> tuple[int, int, int] | None: ... +def color_as_decimal(color: str | None = "#000000") -> tuple[int, int, int] | None: ... class HTML2FPDF(HTMLParser): HTML_UNCLOSED_TAGS: ClassVar[tuple[str, ...]] @@ -65,7 +65,7 @@ class HTML2FPDF(HTMLParser): li_tag_indent: int = 5, dd_tag_indent: int = 10, table_line_separators: bool = False, - ul_bullet_char: str = ..., + ul_bullet_char: str = "\x95", heading_sizes: Incomplete | None = None, warn_on_tags_not_matching: bool = True, **_: Unused, @@ -83,9 +83,9 @@ class HTML2FPDF(HTMLParser): tbody: Incomplete def handle_endtag(self, tag) -> None: ... h: Incomplete - def set_font(self, face: Incomplete | None = ..., size: Incomplete | None = ...) -> None: ... - def set_style(self, tag: Incomplete | None = ..., enable: bool = ...) -> None: ... - def set_text_color(self, r: Incomplete | None = ..., g: int = ..., b: int = ...) -> None: ... + def set_font(self, face: Incomplete | None = None, size: Incomplete | None = None) -> None: ... + def set_style(self, tag: Incomplete | None = None, enable: bool = False) -> None: ... + def set_text_color(self, r: Incomplete | None = None, g: int = 0, b: int = 0) -> None: ... def put_link(self, txt) -> None: ... def render_toc(self, pdf, outline) -> None: ... def error(self, message: str) -> None: ... diff --git a/stubs/fpdf2/fpdf/image_parsing.pyi b/stubs/fpdf2/fpdf/image_parsing.pyi index 24060e554..352086bf7 100644 --- a/stubs/fpdf2/fpdf/image_parsing.pyi +++ b/stubs/fpdf2/fpdf/image_parsing.pyi @@ -12,4 +12,4 @@ SUPPORTED_IMAGE_FILTERS: tuple[_ImageFilter, ...] def load_image(filename): ... # Returned dict could be typed as a TypedDict. -def get_img_info(img, image_filter: _ImageFilter = ..., dims: Incomplete | None = ...) -> dict[str, Any]: ... +def get_img_info(img, image_filter: _ImageFilter = "AUTO", dims: Incomplete | None = None) -> dict[str, Any]: ... diff --git a/stubs/fpdf2/fpdf/line_break.pyi b/stubs/fpdf2/fpdf/line_break.pyi index 01d3a3518..27888c13d 100644 --- a/stubs/fpdf2/fpdf/line_break.pyi +++ b/stubs/fpdf2/fpdf/line_break.pyi @@ -53,8 +53,8 @@ class Fragment: def string(self): ... def trim(self, index: int): ... def __eq__(self, other: Fragment) -> bool: ... # type: ignore[override] - def get_width(self, start: int = ..., end: int | None = ..., chars: str | None = ..., initial_cs: bool = ...): ... - def get_character_width(self, character: str, print_sh: bool = ..., initial_cs: bool = ...): ... + def get_width(self, start: int = 0, end: int | None = None, chars: str | None = None, initial_cs: bool = True): ... + def get_character_width(self, character: str, print_sh: bool = False, initial_cs: bool = True): ... class TextLine(NamedTuple): fragments: tuple[Incomplete, ...] @@ -90,7 +90,7 @@ class CurrentLine: number_of_spaces: int space_break_hint: Incomplete hyphen_break_hint: Incomplete - def __init__(self, print_sh: bool = ...) -> None: ... + def __init__(self, print_sh: bool = False) -> None: ... def add_character( self, character: str, @@ -101,7 +101,7 @@ class CurrentLine: original_character_index: int, url: str | None = None, ): ... - def manual_break(self, justify: bool = ..., trailing_nl: bool = ...): ... + def manual_break(self, justify: bool = False, trailing_nl: bool = False): ... def automatic_break_possible(self): ... def automatic_break(self, justify: bool): ... @@ -112,5 +112,5 @@ class MultiLineBreak: fragment_index: int character_index: int idx_last_forced_break: Incomplete - def __init__(self, styled_text_fragments: Sequence[Fragment], justify: bool = ..., print_sh: bool = ...) -> None: ... - def get_line_of_given_width(self, maximum_width: float, wordsplit: bool = ...): ... + def __init__(self, styled_text_fragments: Sequence[Fragment], justify: bool = False, print_sh: bool = False) -> None: ... + def get_line_of_given_width(self, maximum_width: float, wordsplit: bool = True): ... diff --git a/stubs/fpdf2/fpdf/outline.pyi b/stubs/fpdf2/fpdf/outline.pyi index 4e57c1d8e..963d2728a 100644 --- a/stubs/fpdf2/fpdf/outline.pyi +++ b/stubs/fpdf2/fpdf/outline.pyi @@ -22,7 +22,7 @@ class OutlineItemDictionary(PDFObject): count: int dest: Destination | None struct_elem: StructElem | None - def __init__(self, title: str, dest: Destination | None = ..., struct_elem: StructElem | None = ...) -> None: ... + def __init__(self, title: str, dest: Destination | None = None, struct_elem: StructElem | None = None) -> None: ... class OutlineDictionary(PDFObject): type: str diff --git a/stubs/fpdf2/fpdf/output.pyi b/stubs/fpdf2/fpdf/output.pyi index 686abcbb4..7dc1776ec 100644 --- a/stubs/fpdf2/fpdf/output.pyi +++ b/stubs/fpdf2/fpdf/output.pyi @@ -31,7 +31,12 @@ class PDFFont(PDFObject): font_descriptor: Incomplete | None c_i_d_to_g_i_d_map: Incomplete | None def __init__( - self, subtype: str, base_font: str, encoding: str | None = ..., d_w: Incomplete | None = ..., w: Incomplete | None = ... + self, + subtype: str, + base_font: str, + encoding: str | None = None, + d_w: Incomplete | None = None, + w: Incomplete | None = None, ) -> None: ... class PDFFontDescriptor(PDFObject): @@ -94,10 +99,10 @@ class PDFCatalog(PDFObject): struct_tree_root: Incomplete | None def __init__( self, - lang: str | None = ..., - page_layout: Incomplete | None = ..., - page_mode: Incomplete | None = ..., - viewer_preferences: Incomplete | None = ..., + lang: str | None = None, + page_layout: Incomplete | None = None, + page_mode: Incomplete | None = None, + viewer_preferences: Incomplete | None = None, ) -> None: ... class PDFResources(PDFObject): @@ -135,9 +140,9 @@ class PDFXObject(PDFContentStream): height, color_space, bits_per_component, - img_filter: str | None = ..., - decode: Incomplete | None = ..., - decode_parms: Incomplete | None = ..., + img_filter: str | None = None, + decode: Incomplete | None = None, + decode_parms: Incomplete | None = None, ) -> None: ... class PDFPage(PDFObject): diff --git a/stubs/fpdf2/fpdf/prefs.pyi b/stubs/fpdf2/fpdf/prefs.pyi index 2ec95cd79..8317b3434 100644 --- a/stubs/fpdf2/fpdf/prefs.pyi +++ b/stubs/fpdf2/fpdf/prefs.pyi @@ -9,12 +9,12 @@ class ViewerPreferences: display_doc_title: bool def __init__( self, - hide_toolbar: bool = ..., - hide_menubar: bool = ..., - hide_window_u_i: bool = ..., - fit_window: bool = ..., - center_window: bool = ..., - display_doc_title: bool = ..., + hide_toolbar: bool = False, + hide_menubar: bool = False, + hide_window_u_i: bool = False, + fit_window: bool = False, + center_window: bool = False, + display_doc_title: bool = False, non_full_screen_page_mode: PageMode | str = ..., ) -> None: ... @property diff --git a/stubs/fpdf2/fpdf/recorder.pyi b/stubs/fpdf2/fpdf/recorder.pyi index 9d73e9fc0..2588eef8e 100644 --- a/stubs/fpdf2/fpdf/recorder.pyi +++ b/stubs/fpdf2/fpdf/recorder.pyi @@ -3,7 +3,7 @@ from typing import Any class FPDFRecorder: pdf: Any accept_page_break: bool - def __init__(self, pdf, accept_page_break: bool = ...) -> None: ... + def __init__(self, pdf, accept_page_break: bool = True) -> None: ... def __getattr__(self, name: str): ... def rewind(self) -> None: ... def replay(self) -> None: ... diff --git a/stubs/fpdf2/fpdf/sign.pyi b/stubs/fpdf2/fpdf/sign.pyi index e6878ea81..8130207e0 100644 --- a/stubs/fpdf2/fpdf/sign.pyi +++ b/stubs/fpdf2/fpdf/sign.pyi @@ -12,10 +12,10 @@ class Signature: contents: str def __init__( self, - contact_info: Incomplete | None = ..., - location: Incomplete | None = ..., - m: Incomplete | None = ..., - reason: Incomplete | None = ..., + contact_info: Incomplete | None = None, + location: Incomplete | None = None, + m: Incomplete | None = None, + reason: Incomplete | None = None, ) -> None: ... def serialize(self): ... diff --git a/stubs/fpdf2/fpdf/structure_tree.pyi b/stubs/fpdf2/fpdf/structure_tree.pyi index 2aec226f5..039e91771 100644 --- a/stubs/fpdf2/fpdf/structure_tree.pyi +++ b/stubs/fpdf2/fpdf/structure_tree.pyi @@ -29,9 +29,9 @@ class StructElem(PDFObject): struct_type: str, parent: PDFObject, kids: Iterable[int] | Iterable[StructElem], - page_number: int | None = ..., - title: str | None = ..., - alt: str | None = ..., + page_number: int | None = None, + title: str | None = None, + alt: str | None = None, ) -> None: ... def page_number(self) -> int | None: ... @@ -41,7 +41,7 @@ class StructureTreeBuilder: struct_elem_per_mc: Incomplete def __init__(self) -> None: ... def add_marked_content( - self, page_number: int, struct_type: str, mcid: int | None = ..., title: str | None = ..., alt_text: str | None = ... + self, page_number: int, struct_type: str, mcid: int | None = None, title: str | None = None, alt_text: str | None = None ) -> tuple[Incomplete, Incomplete]: ... def next_mcid_for_page(self, page_number: int) -> int: ... def empty(self) -> bool: ... diff --git a/stubs/fpdf2/fpdf/svg.pyi b/stubs/fpdf2/fpdf/svg.pyi index 0d4c9cb43..82f18d4a9 100644 --- a/stubs/fpdf2/fpdf/svg.pyi +++ b/stubs/fpdf2/fpdf/svg.pyi @@ -20,8 +20,8 @@ relative_length_units: set[str] absolute_length_units: dict[str, int] angle_units: dict[str, float] -def resolve_length(length_str, default_unit: str = ...): ... -def resolve_angle(angle_str, default_unit: str = ...): ... +def resolve_length(length_str, default_unit: str = "pt"): ... +def resolve_angle(angle_str, default_unit: str = "deg"): ... def xmlns(space, name): ... def xmlns_lookup(space, *names): ... @@ -68,7 +68,7 @@ def svg_path_converter(pdf_path: PaintedPath, svg_path: str) -> None: ... class SVGObject: @classmethod - def from_file(cls, filename, *args, encoding: str = ..., **kwargs): ... + def from_file(cls, filename, *args, encoding: str = "utf-8", **kwargs): ... cross_references: Incomplete def __init__(self, svg_text) -> None: ... preserve_ar: Incomplete @@ -78,12 +78,14 @@ class SVGObject: def extract_shape_info(self, root_tag) -> None: ... base_group: Incomplete def convert_graphics(self, root_tag) -> None: ... - def transform_to_page_viewport(self, pdf, align_viewbox: bool = ...): ... - def transform_to_rect_viewport(self, scale, width, height, align_viewbox: bool = ..., ignore_svg_top_attrs: bool = ...): ... + def transform_to_page_viewport(self, pdf, align_viewbox: bool = True): ... + def transform_to_rect_viewport( + self, scale, width, height, align_viewbox: bool = True, ignore_svg_top_attrs: bool = False + ): ... def draw_to_page( - self, pdf, x: Incomplete | None = ..., y: Incomplete | None = ..., debug_stream: Incomplete | None = ... + self, pdf, x: Incomplete | None = None, y: Incomplete | None = None, debug_stream: Incomplete | None = None ) -> None: ... def handle_defs(self, defs) -> None: ... def build_xref(self, xref): ... - def build_group(self, group, pdf_group: Incomplete | None = ...): ... + def build_group(self, group, pdf_group: Incomplete | None = None): ... def build_path(self, path): ... diff --git a/stubs/fpdf2/fpdf/syntax.pyi b/stubs/fpdf2/fpdf/syntax.pyi index bff2ec0f0..7e65e3b7c 100644 --- a/stubs/fpdf2/fpdf/syntax.pyi +++ b/stubs/fpdf2/fpdf/syntax.pyi @@ -11,11 +11,11 @@ _T = TypeVar("_T") def clear_empty_fields(d): ... def create_dictionary_string( dict_, - open_dict: str = ..., - close_dict: str = ..., - field_join: str = ..., - key_value_join: str = ..., - has_empty_fields: bool = ..., + open_dict: str = "<<", + close_dict: str = ">>", + field_join: str = "\n", + key_value_join: str = " ", + has_empty_fields: bool = False, ): ... def create_list_string(list_): ... def iobj_ref(n): ... @@ -37,13 +37,13 @@ class PDFObject: def id(self, n: int) -> None: ... @property def ref(self) -> str: ... - def serialize(self, obj_dict: Incomplete | None = ..., _security_handler: StandardSecurityHandler | None = None) -> str: ... + def serialize(self, obj_dict: Incomplete | None = None, _security_handler: StandardSecurityHandler | None = None) -> str: ... def content_stream(self) -> bytes: ... class PDFContentStream(PDFObject): filter: Name | None length: int - def __init__(self, contents: bytes, compress: bool = ...) -> None: ... + def __init__(self, contents: bytes, compress: bool = False) -> None: ... def encrypt(self, security_handler: StandardSecurityHandler) -> None: ... def build_obj_dict(key_values: SupportsItems[str, Incomplete]) -> dict[str, str]: ... @@ -66,5 +66,5 @@ class DestinationXYZ(Destination): left: float zoom: float | Literal["null"] page_ref: Incomplete | None - def __init__(self, page: int, top: float, left: float = ..., zoom: float | Literal["null"] = ...) -> None: ... + def __init__(self, page: int, top: float, left: float = 0, zoom: float | Literal["null"] = "null") -> None: ... def serialize(self) -> str: ... diff --git a/stubs/fpdf2/fpdf/template.pyi b/stubs/fpdf2/fpdf/template.pyi index c0546012e..12addfb78 100644 --- a/stubs/fpdf2/fpdf/template.pyi +++ b/stubs/fpdf2/fpdf/template.pyi @@ -10,31 +10,31 @@ class FlexTemplate: splitting_pdf: Any handlers: Any texts: Any - def __init__(self, pdf, elements: Incomplete | None = ...) -> None: ... + def __init__(self, pdf, elements: Incomplete | None = None) -> None: ... elements: Any keys: Any def load_elements(self, elements) -> None: ... - def parse_csv(self, infile, delimiter: str = ..., decimal_sep: str = ..., encoding: Incomplete | None = ...): ... + def parse_csv(self, infile, delimiter: str = ",", decimal_sep: str = ".", encoding: Incomplete | None = None): ... def __setitem__(self, name, value) -> None: ... set: Any def __contains__(self, name): ... def __getitem__(self, name): ... def split_multicell(self, text, element_name): ... - def render(self, offsetx: float = ..., offsety: float = ..., rotate: float = ..., scale: float = ...): ... + def render(self, offsetx: float = 0.0, offsety: float = 0.0, rotate: float = 0.0, scale: float = 1.0): ... class Template(FlexTemplate): def __init__( self, - infile: Incomplete | None = ..., - elements: Incomplete | None = ..., - format: str = ..., - orientation: str = ..., - unit: str = ..., - title: str = ..., - author: str = ..., - subject: str = ..., - creator: str = ..., - keywords: str = ..., + infile: Incomplete | None = None, + elements: Incomplete | None = None, + format: str = "A4", + orientation: str = "portrait", + unit: str = "mm", + title: str = "", + author: str = "", + subject: str = "", + creator: str = "", + keywords: str = "", ) -> None: ... def add_page(self) -> None: ... - def render(self, outfile: Incomplete | None = ..., dest: Incomplete | None = ...) -> None: ... # type: ignore[override] + def render(self, outfile: Incomplete | None = None, dest: Incomplete | None = None) -> None: ... # type: ignore[override] diff --git a/stubs/fpdf2/fpdf/transitions.pyi b/stubs/fpdf2/fpdf/transitions.pyi index 5180d148a..b10df4bd6 100644 --- a/stubs/fpdf2/fpdf/transitions.pyi +++ b/stubs/fpdf2/fpdf/transitions.pyi @@ -37,7 +37,7 @@ class GlitterTransition(Transition): class FlyTransition(Transition): dimension: Literal["H", "V"] direction: Literal[0, 270] | None - def __init__(self, dimension: Literal["H", "V"], direction: Literal[0, 270] | None = ...) -> None: ... + def __init__(self, dimension: Literal["H", "V"], direction: Literal[0, 270] | None = None) -> None: ... def serialize(self) -> str: ... class PushTransition(Transition): diff --git a/stubs/fpdf2/fpdf/util.pyi b/stubs/fpdf2/fpdf/util.pyi index 805a44c63..7b33a2bce 100644 --- a/stubs/fpdf2/fpdf/util.pyi +++ b/stubs/fpdf2/fpdf/util.pyi @@ -6,7 +6,7 @@ from typing_extensions import Literal, TypeAlias _Unit: TypeAlias = Literal["pt", "mm", "cm", "in"] def buffer_subst(buffer: bytearray, placeholder: str, value: str) -> bytearray: ... -def format_date(date: datetime.datetime, with_tz: bool = ...) -> str: ... +def format_date(date: datetime.datetime, with_tz: bool = False) -> str: ... def enclose_in_parens(s: str) -> str: ... def escape_parens(s): ... def b(s): ... diff --git a/stubs/html5lib/html5lib/_ihatexml.pyi b/stubs/html5lib/html5lib/_ihatexml.pyi index 60edb7028..ea95b52c8 100644 --- a/stubs/html5lib/html5lib/_ihatexml.pyi +++ b/stubs/html5lib/html5lib/_ihatexml.pyi @@ -37,14 +37,14 @@ class InfosetFilter: replaceCache: Any def __init__( self, - dropXmlnsLocalName: bool = ..., - dropXmlnsAttrNs: bool = ..., - preventDoubleDashComments: bool = ..., - preventDashAtCommentEnd: bool = ..., - replaceFormFeedCharacters: bool = ..., - preventSingleQuotePubid: bool = ..., + dropXmlnsLocalName: bool = False, + dropXmlnsAttrNs: bool = False, + preventDoubleDashComments: bool = False, + preventDashAtCommentEnd: bool = False, + replaceFormFeedCharacters: bool = True, + preventSingleQuotePubid: bool = False, ) -> None: ... - def coerceAttribute(self, name, namespace: Incomplete | None = ...): ... + def coerceAttribute(self, name, namespace: Incomplete | None = None): ... def coerceElement(self, name): ... def coerceComment(self, data): ... def coerceCharacters(self, data): ... diff --git a/stubs/html5lib/html5lib/_inputstream.pyi b/stubs/html5lib/html5lib/_inputstream.pyi index 000193386..cb3b9c7f6 100644 --- a/stubs/html5lib/html5lib/_inputstream.pyi +++ b/stubs/html5lib/html5lib/_inputstream.pyi @@ -38,10 +38,10 @@ class HTMLUnicodeInputStream: def openStream(self, source): ... def position(self): ... def char(self): ... - def readChunk(self, chunkSize: Incomplete | None = ...): ... + def readChunk(self, chunkSize: Incomplete | None = None): ... def characterErrorsUCS4(self, data) -> None: ... def characterErrorsUCS2(self, data) -> None: ... - def charsUntil(self, characters, opposite: bool = ...): ... + def charsUntil(self, characters, opposite: bool = False): ... def unget(self, char) -> None: ... class HTMLBinaryInputStream(HTMLUnicodeInputStream): @@ -57,17 +57,17 @@ class HTMLBinaryInputStream(HTMLUnicodeInputStream): def __init__( self, source, - override_encoding: Incomplete | None = ..., - transport_encoding: Incomplete | None = ..., - same_origin_parent_encoding: Incomplete | None = ..., - likely_encoding: Incomplete | None = ..., - default_encoding: str = ..., - useChardet: bool = ..., + override_encoding: Incomplete | None = None, + transport_encoding: Incomplete | None = None, + same_origin_parent_encoding: Incomplete | None = None, + likely_encoding: Incomplete | None = None, + default_encoding: str = "windows-1252", + useChardet: bool = True, ) -> None: ... dataStream: Any def reset(self) -> None: ... def openStream(self, source): ... - def determineEncoding(self, chardet: bool = ...): ... + def determineEncoding(self, chardet: bool = True): ... def changeEncoding(self, newEncoding) -> None: ... def detectBOM(self): ... def detectEncodingMeta(self): ... diff --git a/stubs/html5lib/html5lib/_tokenizer.pyi b/stubs/html5lib/html5lib/_tokenizer.pyi index 639a4ca9a..f9685a0dd 100644 --- a/stubs/html5lib/html5lib/_tokenizer.pyi +++ b/stubs/html5lib/html5lib/_tokenizer.pyi @@ -12,11 +12,11 @@ class HTMLTokenizer: state: Any escape: bool currentToken: Any - def __init__(self, stream, parser: Incomplete | None = ..., **kwargs) -> None: ... + def __init__(self, stream, parser: Incomplete | None = None, **kwargs) -> None: ... tokenQueue: Any def __iter__(self): ... def consumeNumberEntity(self, isHex): ... - def consumeEntity(self, allowedChar: Incomplete | None = ..., fromAttribute: bool = ...) -> None: ... + def consumeEntity(self, allowedChar: Incomplete | None = None, fromAttribute: bool = False) -> None: ... def processEntityInAttribute(self, allowedChar) -> None: ... def emitCurrentToken(self) -> None: ... def dataState(self): ... diff --git a/stubs/html5lib/html5lib/_trie/_base.pyi b/stubs/html5lib/html5lib/_trie/_base.pyi index 3b0773a7d..1d88b9a60 100644 --- a/stubs/html5lib/html5lib/_trie/_base.pyi +++ b/stubs/html5lib/html5lib/_trie/_base.pyi @@ -4,7 +4,7 @@ from collections.abc import Mapping from typing import Any class Trie(Mapping[Any, Any], metaclass=ABCMeta): - def keys(self, prefix: Incomplete | None = ...): ... + def keys(self, prefix: Incomplete | None = None): ... def has_keys_with_prefix(self, prefix): ... def longest_prefix(self, prefix): ... def longest_prefix_item(self, prefix): ... diff --git a/stubs/html5lib/html5lib/_trie/py.pyi b/stubs/html5lib/html5lib/_trie/py.pyi index ec50ef0d5..03d9a4687 100644 --- a/stubs/html5lib/html5lib/_trie/py.pyi +++ b/stubs/html5lib/html5lib/_trie/py.pyi @@ -8,5 +8,5 @@ class Trie(ABCTrie): def __len__(self) -> int: ... def __iter__(self): ... def __getitem__(self, key): ... - def keys(self, prefix: Incomplete | None = ...): ... + def keys(self, prefix: Incomplete | None = None): ... def has_keys_with_prefix(self, prefix): ... diff --git a/stubs/html5lib/html5lib/_utils.pyi b/stubs/html5lib/html5lib/_utils.pyi index cfd97de7e..50ee4e5d0 100644 --- a/stubs/html5lib/html5lib/_utils.pyi +++ b/stubs/html5lib/html5lib/_utils.pyi @@ -6,9 +6,9 @@ supports_lone_surrogates: bool class MethodDispatcher(dict[Any, Any]): default: Any - def __init__(self, items=...) -> None: ... + def __init__(self, items=()) -> None: ... def __getitem__(self, key): ... - def __get__(self, instance, owner: Incomplete | None = ...): ... + def __get__(self, instance, owner: Incomplete | None = None): ... class BoundMethodDispatcher(Mapping[Any, Any]): instance: Any diff --git a/stubs/html5lib/html5lib/filters/lint.pyi b/stubs/html5lib/html5lib/filters/lint.pyi index 5803963a1..9aba9592a 100644 --- a/stubs/html5lib/html5lib/filters/lint.pyi +++ b/stubs/html5lib/html5lib/filters/lint.pyi @@ -4,5 +4,5 @@ from . import base class Filter(base.Filter): require_matching_tags: Any - def __init__(self, source, require_matching_tags: bool = ...) -> None: ... + def __init__(self, source, require_matching_tags: bool = True) -> None: ... def __iter__(self): ... diff --git a/stubs/html5lib/html5lib/html5parser.pyi b/stubs/html5lib/html5lib/html5parser.pyi index 79dc56c0d..4f08a2e2c 100644 --- a/stubs/html5lib/html5lib/html5parser.pyi +++ b/stubs/html5lib/html5lib/html5parser.pyi @@ -6,15 +6,15 @@ from xml.etree.ElementTree import Element @overload def parse( doc: str | bytes | SupportsRead[str] | SupportsRead[bytes], - treebuilder: Literal["etree"] = ..., - namespaceHTMLElements: bool = ..., + treebuilder: Literal["etree"] = "etree", + namespaceHTMLElements: bool = True, **kwargs, ) -> Element: ... @overload def parse( - doc: str | bytes | SupportsRead[str] | SupportsRead[bytes], treebuilder: str, namespaceHTMLElements: bool = ..., **kwargs + doc: str | bytes | SupportsRead[str] | SupportsRead[bytes], treebuilder: str, namespaceHTMLElements: bool = True, **kwargs ): ... -def parseFragment(doc, container: str = ..., treebuilder: str = ..., namespaceHTMLElements: bool = ..., **kwargs): ... +def parseFragment(doc, container: str = "div", treebuilder: str = "etree", namespaceHTMLElements: bool = True, **kwargs): ... def method_decorator_metaclass(function): ... class HTMLParser: @@ -23,7 +23,7 @@ class HTMLParser: errors: Any phases: Any def __init__( - self, tree: Incomplete | None = ..., strict: bool = ..., namespaceHTMLElements: bool = ..., debug: bool = ... + self, tree: Incomplete | None = None, strict: bool = False, namespaceHTMLElements: bool = True, debug: bool = False ) -> None: ... firstStartTag: bool log: Any @@ -41,7 +41,7 @@ class HTMLParser: def mainLoop(self) -> None: ... def parse(self, stream, scripting: bool = ..., **kwargs): ... def parseFragment(self, stream, *args, **kwargs): ... - def parseError(self, errorcode: str = ..., datavars: Incomplete | None = ...) -> None: ... + def parseError(self, errorcode: str = "XXX-undefined-error", datavars: Incomplete | None = None) -> None: ... def adjustMathMLAttributes(self, token) -> None: ... def adjustSVGAttributes(self, token) -> None: ... def adjustForeignAttributes(self, token) -> None: ... @@ -52,6 +52,6 @@ class HTMLParser: def getPhases(debug): ... def adjust_attributes(token, replacements) -> None: ... -def impliedTagToken(name, type: str = ..., attributes: Incomplete | None = ..., selfClosing: bool = ...): ... +def impliedTagToken(name, type: str = "EndTag", attributes: Incomplete | None = None, selfClosing: bool = False): ... class ParseError(Exception): ... diff --git a/stubs/html5lib/html5lib/serializer.pyi b/stubs/html5lib/html5lib/serializer.pyi index dc505f247..5e230a05c 100644 --- a/stubs/html5lib/html5lib/serializer.pyi +++ b/stubs/html5lib/html5lib/serializer.pyi @@ -3,7 +3,7 @@ from typing import Any, overload def htmlentityreplace_errors(exc: Exception) -> tuple[str | bytes, int]: ... @overload -def serialize(input, tree: str = ..., encoding: None = ..., **serializer_opts) -> str: ... +def serialize(input, tree: str = "etree", encoding: None = None, **serializer_opts) -> str: ... @overload def serialize(input, tree: str, encoding: str, **serializer_opts) -> bytes: ... @overload @@ -31,8 +31,8 @@ class HTMLSerializer: def encode(self, string): ... def encodeStrict(self, string): ... encoding: Any - def serialize(self, treewalker, encoding: Incomplete | None = ...) -> None: ... - def render(self, treewalker, encoding: Incomplete | None = ...): ... - def serializeError(self, data: str = ...) -> None: ... + def serialize(self, treewalker, encoding: Incomplete | None = None) -> None: ... + def render(self, treewalker, encoding: Incomplete | None = None): ... + def serializeError(self, data: str = "XXX ERROR MESSAGE NEEDED") -> None: ... class SerializeError(Exception): ... diff --git a/stubs/html5lib/html5lib/treebuilders/__init__.pyi b/stubs/html5lib/html5lib/treebuilders/__init__.pyi index f577600b4..b8bc40a63 100644 --- a/stubs/html5lib/html5lib/treebuilders/__init__.pyi +++ b/stubs/html5lib/html5lib/treebuilders/__init__.pyi @@ -3,4 +3,4 @@ from typing import Any treeBuilderCache: Any -def getTreeBuilder(treeType, implementation: Incomplete | None = ..., **kwargs): ... +def getTreeBuilder(treeType, implementation: Incomplete | None = None, **kwargs): ... diff --git a/stubs/html5lib/html5lib/treebuilders/base.pyi b/stubs/html5lib/html5lib/treebuilders/base.pyi index b1623bae6..eae192172 100644 --- a/stubs/html5lib/html5lib/treebuilders/base.pyi +++ b/stubs/html5lib/html5lib/treebuilders/base.pyi @@ -12,7 +12,7 @@ class Node: childNodes: Any def __init__(self, name) -> None: ... def appendChild(self, node) -> None: ... - def insertText(self, data, insertBefore: Incomplete | None = ...) -> None: ... + def insertText(self, data, insertBefore: Incomplete | None = None) -> None: ... def insertBefore(self, node, refNode) -> None: ... def removeChild(self, node) -> None: ... def reparentChildren(self, newParent) -> None: ... @@ -38,19 +38,19 @@ class TreeBuilder: insertFromTable: bool document: Any def reset(self) -> None: ... - def elementInScope(self, target, variant: Incomplete | None = ...): ... + def elementInScope(self, target, variant: Incomplete | None = None): ... def reconstructActiveFormattingElements(self) -> None: ... def clearActiveFormattingElements(self) -> None: ... def elementInActiveFormattingElements(self, name): ... def insertRoot(self, token) -> None: ... def insertDoctype(self, token) -> None: ... - def insertComment(self, token, parent: Incomplete | None = ...) -> None: ... + def insertComment(self, token, parent: Incomplete | None = None) -> None: ... def createElement(self, token): ... def insertElementNormal(self, token): ... def insertElementTable(self, token): ... - def insertText(self, data, parent: Incomplete | None = ...) -> None: ... + def insertText(self, data, parent: Incomplete | None = None) -> None: ... def getTableMisnestedNodePosition(self): ... - def generateImpliedEndTags(self, exclude: Incomplete | None = ...) -> None: ... + def generateImpliedEndTags(self, exclude: Incomplete | None = None) -> None: ... def getDocument(self): ... def getFragment(self): ... def testSerializer(self, node) -> None: ... diff --git a/stubs/html5lib/html5lib/treebuilders/etree.pyi b/stubs/html5lib/html5lib/treebuilders/etree.pyi index f4b8e54b5..948651dab 100644 --- a/stubs/html5lib/html5lib/treebuilders/etree.pyi +++ b/stubs/html5lib/html5lib/treebuilders/etree.pyi @@ -2,6 +2,6 @@ from typing import Any tag_regexp: Any -def getETreeBuilder(ElementTreeImplementation, fullTree: bool = ...): ... +def getETreeBuilder(ElementTreeImplementation, fullTree: bool = False): ... getETreeModule: Any diff --git a/stubs/html5lib/html5lib/treebuilders/etree_lxml.pyi b/stubs/html5lib/html5lib/treebuilders/etree_lxml.pyi index 1f76a6fa2..018bf60a6 100644 --- a/stubs/html5lib/html5lib/treebuilders/etree_lxml.pyi +++ b/stubs/html5lib/html5lib/treebuilders/etree_lxml.pyi @@ -30,7 +30,7 @@ class TreeBuilder(base.TreeBuilder): fragmentClass: Any implementation: Any namespaceHTMLElements: Any - def __init__(self, namespaceHTMLElements, fullTree: bool = ...): ... + def __init__(self, namespaceHTMLElements, fullTree: bool = False): ... insertComment: Any initial_comments: Any doctype: Any @@ -39,7 +39,7 @@ class TreeBuilder(base.TreeBuilder): def getDocument(self): ... def getFragment(self): ... def insertDoctype(self, token) -> None: ... - def insertCommentInitial(self, data, parent: Incomplete | None = ...) -> None: ... - def insertCommentMain(self, data, parent: Incomplete | None = ...) -> None: ... + def insertCommentInitial(self, data, parent: Incomplete | None = None) -> None: ... + def insertCommentMain(self, data, parent: Incomplete | None = None) -> None: ... document: Any def insertRoot(self, token) -> None: ... diff --git a/stubs/html5lib/html5lib/treewalkers/__init__.pyi b/stubs/html5lib/html5lib/treewalkers/__init__.pyi index 0eda70032..8246ff05a 100644 --- a/stubs/html5lib/html5lib/treewalkers/__init__.pyi +++ b/stubs/html5lib/html5lib/treewalkers/__init__.pyi @@ -1,4 +1,4 @@ from _typeshed import Incomplete -def getTreeWalker(treeType, implementation: Incomplete | None = ..., **kwargs): ... +def getTreeWalker(treeType, implementation: Incomplete | None = None, **kwargs): ... def pprint(walker): ... diff --git a/stubs/html5lib/html5lib/treewalkers/base.pyi b/stubs/html5lib/html5lib/treewalkers/base.pyi index 919b22011..87fdc9447 100644 --- a/stubs/html5lib/html5lib/treewalkers/base.pyi +++ b/stubs/html5lib/html5lib/treewalkers/base.pyi @@ -14,12 +14,12 @@ class TreeWalker: def __init__(self, tree) -> None: ... def __iter__(self): ... def error(self, msg): ... - def emptyTag(self, namespace, name, attrs, hasChildren: bool = ...) -> None: ... + def emptyTag(self, namespace, name, attrs, hasChildren: bool = False) -> None: ... def startTag(self, namespace, name, attrs): ... def endTag(self, namespace, name): ... def text(self, data) -> None: ... def comment(self, data): ... - def doctype(self, name, publicId: Incomplete | None = ..., systemId: Incomplete | None = ...): ... + def doctype(self, name, publicId: Incomplete | None = None, systemId: Incomplete | None = None): ... def entity(self, name): ... def unknown(self, nodeType): ... diff --git a/stubs/httplib2/httplib2/__init__.pyi b/stubs/httplib2/httplib2/__init__.pyi index 485c09178..a8cc8e90d 100644 --- a/stubs/httplib2/httplib2/__init__.pyi +++ b/stubs/httplib2/httplib2/__init__.pyi @@ -41,7 +41,7 @@ class DigestAuthentication(Authentication): challenge: Any A1: Any def __init__(self, credentials, host, request_uri, headers, response, content, http) -> None: ... - def request(self, method, request_uri, headers, content, cnonce: Incomplete | None = ...): ... + def request(self, method, request_uri, headers, content, cnonce: Incomplete | None = None): ... def response(self, response, content): ... class HmacDigestAuthentication(Authentication): @@ -74,7 +74,7 @@ class FileCache: class Credentials: credentials: Any def __init__(self) -> None: ... - def add(self, name, password, domain: str = ...) -> None: ... + def add(self, name, password, domain: str = "") -> None: ... def clear(self) -> None: ... def iter(self, domain) -> Generator[tuple[str, str], None, None]: ... @@ -91,10 +91,10 @@ class ProxyInfo: proxy_type, proxy_host, proxy_port, - proxy_rdns: bool = ..., - proxy_user: Incomplete | None = ..., - proxy_pass: Incomplete | None = ..., - proxy_headers: Incomplete | None = ..., + proxy_rdns: bool = True, + proxy_user: Incomplete | None = None, + proxy_pass: Incomplete | None = None, + proxy_headers: Incomplete | None = None, ) -> None: ... def astuple(self): ... def isgood(self): ... @@ -104,7 +104,7 @@ class ProxyInfo: class HTTPConnectionWithTimeout(http.client.HTTPConnection): proxy_info: Any def __init__( - self, host, port: Incomplete | None = ..., timeout: Incomplete | None = ..., proxy_info: Incomplete | None = ... + self, host, port: Incomplete | None = None, timeout: Incomplete | None = None, proxy_info: Incomplete | None = None ) -> None: ... sock: Any def connect(self) -> None: ... @@ -119,16 +119,16 @@ class HTTPSConnectionWithTimeout(http.client.HTTPSConnection): def __init__( self, host, - port: Incomplete | None = ..., - key_file: Incomplete | None = ..., - cert_file: Incomplete | None = ..., - timeout: Incomplete | None = ..., - proxy_info: Incomplete | None = ..., - ca_certs: Incomplete | None = ..., - disable_ssl_certificate_validation: bool = ..., - tls_maximum_version: Incomplete | None = ..., - tls_minimum_version: Incomplete | None = ..., - key_password: Incomplete | None = ..., + port: Incomplete | None = None, + key_file: Incomplete | None = None, + cert_file: Incomplete | None = None, + timeout: Incomplete | None = None, + proxy_info: Incomplete | None = None, + ca_certs: Incomplete | None = None, + disable_ssl_certificate_validation: bool = False, + tls_maximum_version: Incomplete | None = None, + tls_minimum_version: Incomplete | None = None, + key_password: Incomplete | None = None, ) -> None: ... sock: Any def connect(self) -> None: ... @@ -155,26 +155,26 @@ class Http: forward_authorization_headers: bool def __init__( self, - cache: Incomplete | None = ..., - timeout: Incomplete | None = ..., + cache: Incomplete | None = None, + timeout: Incomplete | None = None, proxy_info=..., - ca_certs: Incomplete | None = ..., - disable_ssl_certificate_validation: bool = ..., - tls_maximum_version: Incomplete | None = ..., - tls_minimum_version: Incomplete | None = ..., + ca_certs: Incomplete | None = None, + disable_ssl_certificate_validation: bool = False, + tls_maximum_version: Incomplete | None = None, + tls_minimum_version: Incomplete | None = None, ) -> None: ... def close(self) -> None: ... - def add_credentials(self, name, password, domain: str = ...) -> None: ... - def add_certificate(self, key, cert, domain, password: Incomplete | None = ...) -> None: ... + def add_credentials(self, name, password, domain: str = "") -> None: ... + def add_certificate(self, key, cert, domain, password: Incomplete | None = None) -> None: ... def clear_credentials(self) -> None: ... def request( self, uri, - method: str = ..., - body: Incomplete | None = ..., - headers: Incomplete | None = ..., - redirections=..., - connection_type: Incomplete | None = ..., + method: str = "GET", + body: Incomplete | None = None, + headers: Incomplete | None = None, + redirections=5, + connection_type: Incomplete | None = None, ): ... class Response(dict[str, Any]): diff --git a/stubs/httplib2/httplib2/socks.pyi b/stubs/httplib2/httplib2/socks.pyi index ab1cff460..25d9b60d5 100644 --- a/stubs/httplib2/httplib2/socks.pyi +++ b/stubs/httplib2/httplib2/socks.pyi @@ -14,27 +14,27 @@ class Socks4Error(ProxyError): ... class HTTPError(ProxyError): ... def setdefaultproxy( - proxytype: Incomplete | None = ..., - addr: Incomplete | None = ..., - port: Incomplete | None = ..., - rdns: bool = ..., - username: Incomplete | None = ..., - password: Incomplete | None = ..., + proxytype: Incomplete | None = None, + addr: Incomplete | None = None, + port: Incomplete | None = None, + rdns: bool = True, + username: Incomplete | None = None, + password: Incomplete | None = None, ) -> None: ... def wrapmodule(module) -> None: ... class socksocket(socket.socket): - def __init__(self, family=..., type=..., proto: int = ..., _sock: Incomplete | None = ...) -> None: ... + def __init__(self, family=..., type=..., proto: int = 0, _sock: Incomplete | None = None) -> None: ... def sendall(self, content, *args): ... def setproxy( self, - proxytype: Incomplete | None = ..., - addr: Incomplete | None = ..., - port: Incomplete | None = ..., - rdns: bool = ..., - username: Incomplete | None = ..., - password: Incomplete | None = ..., - headers: Incomplete | None = ..., + proxytype: Incomplete | None = None, + addr: Incomplete | None = None, + port: Incomplete | None = None, + rdns: bool = True, + username: Incomplete | None = None, + password: Incomplete | None = None, + headers: Incomplete | None = None, ) -> None: ... def getproxysockname(self): ... def getproxypeername(self): ... diff --git a/stubs/humanfriendly/humanfriendly/__init__.pyi b/stubs/humanfriendly/humanfriendly/__init__.pyi index 7e7761828..36b34922b 100644 --- a/stubs/humanfriendly/humanfriendly/__init__.pyi +++ b/stubs/humanfriendly/humanfriendly/__init__.pyi @@ -18,15 +18,15 @@ length_size_units: Any time_units: Any def coerce_boolean(value: object) -> bool: ... -def coerce_pattern(value: str | Pattern[str], flags: int = ...) -> Pattern[str]: ... +def coerce_pattern(value: str | Pattern[str], flags: int = 0) -> Pattern[str]: ... def coerce_seconds(value: float | datetime.timedelta) -> float: ... -def format_size(num_bytes: float, keep_width: bool = ..., binary: bool = ...) -> str: ... -def parse_size(size: str, binary: bool = ...) -> int: ... -def format_length(num_metres: float, keep_width: bool = ...) -> str: ... +def format_size(num_bytes: float, keep_width: bool = False, binary: bool = False) -> str: ... +def parse_size(size: str, binary: bool = False) -> int: ... +def format_length(num_metres: float, keep_width: bool = False) -> str: ... def parse_length(length: str) -> float: ... -def format_number(number: float, num_decimals: int = ...) -> str: ... -def round_number(count: float, keep_width: bool = ...) -> str: ... -def format_timespan(num_seconds: float | datetime.timedelta, detailed: bool = ..., max_units: int = ...) -> str: ... +def format_number(number: float, num_decimals: int = 2) -> str: ... +def round_number(count: float, keep_width: bool = False) -> str: ... +def format_timespan(num_seconds: float | datetime.timedelta, detailed: bool = False, max_units: int = 3) -> str: ... def parse_timespan(timespan: str) -> float: ... def parse_date(datestring: str) -> tuple[int, int, int, int, int, int]: ... def format_path(pathname: str) -> str: ... @@ -37,13 +37,13 @@ class Timer: resumable: bool start_time: float total_time: float - def __init__(self, start_time: Incomplete | None = ..., resumable: bool = ...) -> None: ... + def __init__(self, start_time: Incomplete | None = None, resumable: bool = False) -> None: ... def __enter__(self): ... def __exit__( self, - exc_type: type[BaseException] | None = ..., - exc_value: BaseException | None = ..., - traceback: TracebackType | None = ..., + exc_type: type[BaseException] | None = None, + exc_value: BaseException | None = None, + traceback: TracebackType | None = None, ) -> None: ... def sleep(self, seconds: float) -> None: ... @property diff --git a/stubs/humanfriendly/humanfriendly/case.pyi b/stubs/humanfriendly/humanfriendly/case.pyi index 1ab0b0173..4240cf2ab 100644 --- a/stubs/humanfriendly/humanfriendly/case.pyi +++ b/stubs/humanfriendly/humanfriendly/case.pyi @@ -8,14 +8,14 @@ _KT = TypeVar("_KT") _VT = TypeVar("_VT") class CaseInsensitiveDict(OrderedDict[_KT, _VT], Generic[_KT, _VT]): - def __init__(self, other: Incomplete | None = ..., **kw) -> None: ... + def __init__(self, other: Incomplete | None = None, **kw) -> None: ... def coerce_key(self, key): ... @classmethod - 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 fromkeys(cls, iterable, value: Incomplete | None = None): ... + def get(self, key, default: Incomplete | None = None): ... + def pop(self, key, default: Incomplete | None = None): ... + def setdefault(self, key, default: Incomplete | None = None): ... + def update(self, other: Incomplete | None = None, **kw) -> None: ... # type: ignore[override] def __contains__(self, key): ... def __delitem__(self, key) -> None: ... def __getitem__(self, key): ... diff --git a/stubs/humanfriendly/humanfriendly/cli.pyi b/stubs/humanfriendly/humanfriendly/cli.pyi index a97befdcb..9a3652dd9 100644 --- a/stubs/humanfriendly/humanfriendly/cli.pyi +++ b/stubs/humanfriendly/humanfriendly/cli.pyi @@ -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: Incomplete | None = ...) -> None: ... +def demonstrate_256_colors(i, j, group: Incomplete | None = None) -> None: ... diff --git a/stubs/humanfriendly/humanfriendly/prompts.pyi b/stubs/humanfriendly/humanfriendly/prompts.pyi index 909fa611b..738ac4d33 100644 --- a/stubs/humanfriendly/humanfriendly/prompts.pyi +++ b/stubs/humanfriendly/humanfriendly/prompts.pyi @@ -4,11 +4,11 @@ from typing import Any MAX_ATTEMPTS: int logger: Any -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 prompt_for_confirmation(question, default: Incomplete | None = None, padding: bool = True): ... +def prompt_for_choice(choices, default: Incomplete | None = None, padding: bool = True): ... +def prompt_for_input(question, default: Incomplete | None = None, padding: bool = True, strip: bool = True): ... def prepare_prompt_text(prompt_text, **options): ... def prepare_friendly_prompts() -> None: ... -def retry_limit(limit=...) -> None: ... +def retry_limit(limit=10) -> None: ... class TooManyInvalidReplies(Exception): ... diff --git a/stubs/humanfriendly/humanfriendly/sphinx.pyi b/stubs/humanfriendly/humanfriendly/sphinx.pyi index eb6a63543..a84ebe5c5 100644 --- a/stubs/humanfriendly/humanfriendly/sphinx.pyi +++ b/stubs/humanfriendly/humanfriendly/sphinx.pyi @@ -8,8 +8,8 @@ def enable_man_role(app) -> None: ... def enable_pypi_role(app) -> None: ... def enable_special_methods(app) -> None: ... def enable_usage_formatting(app) -> None: ... -def man_role(role, rawtext, text, lineno, inliner, options=..., content=...): ... -def pypi_role(role, rawtext, text, lineno, inliner, options=..., content=...): ... +def man_role(role, rawtext, text, lineno, inliner, options={}, content=[]): ... +def pypi_role(role, rawtext, text, lineno, inliner, options={}, content=[]): ... def setup(app): ... def special_methods_callback(app, what, name, obj, skip, options): ... def usage_message_callback(app, what, name, obj, options, lines) -> None: ... diff --git a/stubs/humanfriendly/humanfriendly/tables.pyi b/stubs/humanfriendly/humanfriendly/tables.pyi index 658a58327..b53900ef3 100644 --- a/stubs/humanfriendly/humanfriendly/tables.pyi +++ b/stubs/humanfriendly/humanfriendly/tables.pyi @@ -1,6 +1,6 @@ from _typeshed import Incomplete def format_smart_table(data, column_names): ... -def format_pretty_table(data, column_names: Incomplete | None = ..., horizontal_bar: str = ..., vertical_bar: str = ...): ... +def format_pretty_table(data, column_names: Incomplete | None = None, horizontal_bar: str = "-", vertical_bar: str = "|"): ... def format_robust_table(data, column_names): ... -def format_rst_table(data, column_names: Incomplete | None = ...): ... +def format_rst_table(data, column_names: Incomplete | None = None): ... diff --git a/stubs/humanfriendly/humanfriendly/terminal/__init__.pyi b/stubs/humanfriendly/humanfriendly/terminal/__init__.pyi index f7c26eaa4..67e76a28b 100644 --- a/stubs/humanfriendly/humanfriendly/terminal/__init__.pyi +++ b/stubs/humanfriendly/humanfriendly/terminal/__init__.pyi @@ -15,24 +15,24 @@ DEFAULT_COLUMNS: int DEFAULT_ENCODING: str HIGHLIGHT_COLOR: Any -def ansi_strip(text, readline_hints: bool = ...): ... +def ansi_strip(text, readline_hints: bool = True): ... def ansi_style(**kw): ... 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: Incomplete | None = ...): ... +def connected_to_terminal(stream: Incomplete | None = 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: Incomplete | None = ...): ... +def get_pager_command(text: Incomplete | None = 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: Incomplete | None = ...): ... +def show_pager(formatted_text, encoding="UTF-8") -> None: ... +def terminal_supports_colors(stream: Incomplete | None = None): ... def usage(usage_text) -> None: ... def warning(text, *args, **kw) -> None: ... diff --git a/stubs/humanfriendly/humanfriendly/terminal/html.pyi b/stubs/humanfriendly/humanfriendly/terminal/html.pyi index 2525fc4ff..79286ed00 100644 --- a/stubs/humanfriendly/humanfriendly/terminal/html.pyi +++ b/stubs/humanfriendly/humanfriendly/terminal/html.pyi @@ -3,7 +3,7 @@ from typing import Any from humanfriendly.compat import HTMLParser -def html_to_ansi(data, callback: Incomplete | None = ...): ... +def html_to_ansi(data, callback: Incomplete | None = None): ... class HTMLConverter(HTMLParser): BLOCK_TAGS: Any @@ -15,7 +15,7 @@ class HTMLConverter(HTMLParser): def current_style(self): ... stack: Any def close(self) -> None: ... - def emit_style(self, style: Incomplete | None = ...) -> None: ... + def emit_style(self, style: Incomplete | None = None) -> None: ... def handle_charref(self, value) -> None: ... link_text: Any def handle_data(self, data) -> None: ... diff --git a/stubs/humanfriendly/humanfriendly/terminal/spinners.pyi b/stubs/humanfriendly/humanfriendly/terminal/spinners.pyi index 307201e22..5c342416f 100644 --- a/stubs/humanfriendly/humanfriendly/terminal/spinners.pyi +++ b/stubs/humanfriendly/humanfriendly/terminal/spinners.pyi @@ -16,15 +16,15 @@ class Spinner: counter: int last_update: int def __init__(self, **options) -> None: ... - def step(self, progress: int = ..., label: Incomplete | None = ...) -> None: ... + def step(self, progress: int = 0, label: Incomplete | None = None) -> None: ... def sleep(self) -> None: ... def clear(self) -> None: ... def __enter__(self): ... def __exit__( self, - exc_type: type[BaseException] | None = ..., - exc_value: BaseException | None = ..., - traceback: TracebackType | None = ..., + exc_type: type[BaseException] | None = None, + exc_value: BaseException | None = None, + traceback: TracebackType | None = None, ) -> None: ... class AutomaticSpinner: @@ -32,11 +32,11 @@ class AutomaticSpinner: show_time: Any shutdown_event: Any subprocess: Any - def __init__(self, label, show_time: bool = ...) -> None: ... + def __init__(self, label, show_time: bool = True) -> None: ... def __enter__(self) -> None: ... def __exit__( self, - exc_type: type[BaseException] | None = ..., - exc_value: BaseException | None = ..., - traceback: TracebackType | None = ..., + exc_type: type[BaseException] | None = None, + exc_value: BaseException | None = None, + traceback: TracebackType | None = None, ) -> None: ... diff --git a/stubs/humanfriendly/humanfriendly/testing.pyi b/stubs/humanfriendly/humanfriendly/testing.pyi index aecfad7ea..8254e6c90 100644 --- a/stubs/humanfriendly/humanfriendly/testing.pyi +++ b/stubs/humanfriendly/humanfriendly/testing.pyi @@ -5,9 +5,9 @@ from typing import Any from humanfriendly.compat import StringIO -def configure_logging(log_level=...) -> None: ... +def configure_logging(log_level=10) -> None: ... def make_dirs(pathname) -> None: ... -def retry(func, timeout: int = ..., exc_type=...): ... +def retry(func, timeout: int = 60, exc_type=...): ... def run_cli(entry_point, *arguments, **options): ... def skip_on_raise(*exc_types): ... def touch(filename) -> None: ... @@ -18,9 +18,9 @@ class ContextManager: def __enter__(self): ... def __exit__( self, - exc_type: type[BaseException] | None = ..., - exc_value: BaseException | None = ..., - traceback: TracebackType | None = ..., + exc_type: type[BaseException] | None = None, + exc_value: BaseException | None = None, + traceback: TracebackType | None = None, ) -> None: ... class PatchedAttribute(ContextManager): @@ -52,7 +52,7 @@ class MockedHomeDirectory(PatchedItem, TemporaryDirectory): class CustomSearchPath(PatchedItem, TemporaryDirectory): isolated_search_path: Any - def __init__(self, isolated: bool = ...) -> None: ... + def __init__(self, isolated: bool = False) -> None: ... patched_value: Any def __enter__(self): ... @property @@ -63,7 +63,7 @@ class MockedProgram(CustomSearchPath): program_returncode: Any program_script: Any program_signal_file: Any - def __init__(self, name, returncode: int = ..., script: Incomplete | None = ...) -> None: ... + def __init__(self, name, returncode: int = 0, script: Incomplete | None = None) -> None: ... def __enter__(self): ... def __exit__(self, *args: object, **kw: object): ... @@ -72,7 +72,7 @@ class CaptureOutput(ContextManager): stdout: Any stderr: Any patched_attributes: Any - def __init__(self, merged: bool = ..., input: str = ..., enabled: bool = ...) -> None: ... + def __init__(self, merged: bool = False, input: str = "", enabled: bool = True) -> None: ... def __enter__(self): ... def get_lines(self): ... def get_text(self): ... @@ -84,4 +84,4 @@ class CaptureBuffer(StringIO): class TestCase(unittest.TestCase): def __init__(self, *args, **kw) -> None: ... - def setUp(self, log_level=...) -> None: ... + def setUp(self, log_level=10) -> None: ... diff --git a/stubs/humanfriendly/humanfriendly/text.pyi b/stubs/humanfriendly/humanfriendly/text.pyi index 98cf0588e..d368e5101 100644 --- a/stubs/humanfriendly/humanfriendly/text.pyi +++ b/stubs/humanfriendly/humanfriendly/text.pyi @@ -2,16 +2,16 @@ from _typeshed import Incomplete def compact(text, *args, **kw): ... def compact_empty_lines(text): ... -def concatenate(items, conjunction: str = ..., serial_comma: bool = ...): ... +def concatenate(items, conjunction: str = "and", serial_comma: bool = False): ... def dedent(text, *args, **kw): ... def format(text, *args, **kw): ... -def generate_slug(text, delimiter: str = ...): ... +def generate_slug(text, delimiter: str = "-"): ... def is_empty_line(text): ... def join_lines(text): ... -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 pluralize(count, singular, plural: Incomplete | None = None): ... +def pluralize_raw(count, singular, plural: Incomplete | None = None): ... +def random_string(length=(25, 100), characters=...): ... +def split(text, delimiter: str = ","): ... def split_paragraphs(text): ... def tokenize(text): ... def trim_empty_lines(text): ...