Skip to content

Commit 5be0dfa

Browse files
Correct vobject child and serialization interfaces
1 parent 39bd2d6 commit 5be0dfa

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎stubs/vobject/vobject/base.pyi‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import logging
22
import re
33
from _typeshed import Incomplete, MaybeNone, SupportsWrite
4-
from collections.abc import Generator, Iterator
4+
from collections.abc import Generator, Iterable, Iterator, Sequence
55
from typing import Any, AnyStr, Final, Literal, TypeVar, overload
66
from typing_extensions import Self
77

88
_V = TypeVar("_V", bound=VBase)
9-
_W = TypeVar("_W", bound=SupportsWrite[bytes])
9+
_W = TypeVar("_W", bound=SupportsWrite[str] | SupportsWrite[bytes])
1010

1111
VERSION: Final[str]
1212

@@ -30,7 +30,7 @@ class VBase:
3030
def __init__(self, group=None) -> None: ...
3131
def copy(self, copyit: VBase) -> None: ...
3232
def validate(self, *args, **kwds) -> bool: ...
33-
def getChildren(self) -> list[Incomplete]: ...
33+
def getChildren(self) -> Iterable[VBase]: ...
3434
def clearBehavior(self, cascade: bool = True) -> None: ...
3535
def autoBehavior(self, cascade: bool = False) -> None: ...
3636
def setBehavior(self, behavior, cascade: bool = True) -> None: ...
@@ -60,7 +60,7 @@ class ContentLine(VBase):
6060
def __init__(
6161
self,
6262
name: str,
63-
params: dict[Incomplete, list[Incomplete]],
63+
params: Iterable[Sequence[str]],
6464
value: str,
6565
group=None,
6666
encoded: bool = False,
@@ -107,7 +107,7 @@ class Component(VBase):
107107
def add(self, objOrName: str, group: str | None = None) -> Any: ... # returns VBase sub-class
108108

109109
def remove(self, obj) -> None: ...
110-
def getChildren(self) -> list[Incomplete]: ...
110+
def getChildren(self) -> Generator[VBase]: ...
111111
def components(self) -> Generator[Component]: ...
112112
def lines(self) -> Generator[ContentLine]: ...
113113
def sortChildKeys(self) -> list[Incomplete]: ...

0 commit comments

Comments
 (0)