diff --git a/stubs/vobject/vobject/base.pyi b/stubs/vobject/vobject/base.pyi index 3c48123e7fbc..ff3024163b5c 100644 --- a/stubs/vobject/vobject/base.pyi +++ b/stubs/vobject/vobject/base.pyi @@ -1,12 +1,12 @@ import logging import re from _typeshed import Incomplete, MaybeNone, SupportsWrite -from collections.abc import Generator, Iterator +from collections.abc import Generator, Iterable, Iterator, Sequence from typing import Any, AnyStr, Final, Literal, TypeVar, overload from typing_extensions import Self _V = TypeVar("_V", bound=VBase) -_W = TypeVar("_W", bound=SupportsWrite[bytes]) +_W = TypeVar("_W", bound=SupportsWrite[str] | SupportsWrite[bytes]) VERSION: Final[str] @@ -30,7 +30,7 @@ class VBase: def __init__(self, group=None) -> None: ... def copy(self, copyit: VBase) -> None: ... def validate(self, *args, **kwds) -> bool: ... - def getChildren(self) -> list[Incomplete]: ... + def getChildren(self) -> Iterable[VBase]: ... def clearBehavior(self, cascade: bool = True) -> None: ... def autoBehavior(self, cascade: bool = False) -> None: ... def setBehavior(self, behavior, cascade: bool = True) -> None: ... @@ -60,7 +60,7 @@ class ContentLine(VBase): def __init__( self, name: str, - params: dict[Incomplete, list[Incomplete]], + params: Iterable[Sequence[str]], value: str, group=None, encoded: bool = False, @@ -107,7 +107,7 @@ class Component(VBase): def add(self, objOrName: str, group: str | None = None) -> Any: ... # returns VBase sub-class def remove(self, obj) -> None: ... - def getChildren(self) -> list[Incomplete]: ... + def getChildren(self) -> Generator[VBase]: ... def components(self) -> Generator[Component]: ... def lines(self) -> Generator[ContentLine]: ... def sortChildKeys(self) -> list[Incomplete]: ...