Skip to content

Commit fdfa8ea

Browse files
committed
Widen fromstringlist sequence param to Iterable
The runtime only iterates over the argument, so a generator or any other iterable works. Fixes #16839.
1 parent 654aed1 commit fdfa8ea

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎stdlib/xml/etree/ElementTree.pyi‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import sys
22
from _collections_abc import dict_keys
33
from _typeshed import FileDescriptorOrPath, ReadableBuffer, SupportsRead, SupportsWrite
4-
from collections.abc import Callable, Generator, ItemsView, Iterable, Iterator, Mapping, Sequence
4+
from collections.abc import Callable, Generator, ItemsView, Iterable, Iterator, Mapping
55
from typing import Any, Final, Generic, Literal, Protocol, SupportsIndex, TypeAlias, TypeGuard, TypeVar, overload, type_check_only
66
from typing_extensions import deprecated, disjoint_base
77
from xml.parsers.expat import XMLParserType
@@ -310,7 +310,7 @@ def XMLID(text: str | ReadableBuffer, parser: XMLParser | None = None) -> tuple[
310310
# This is aliased to XML in the source.
311311
fromstring = XML
312312

313-
def fromstringlist(sequence: Sequence[str | ReadableBuffer], parser: XMLParser | None = None) -> Element: ...
313+
def fromstringlist(sequence: Iterable[str | ReadableBuffer], parser: XMLParser | None = None) -> Element: ...
314314

315315
# This type is both not precise enough and too precise. The TreeBuilder
316316
# requires the elementfactory to accept tag and attrs in its args and produce

0 commit comments

Comments
 (0)