Skip to content

Commit 8f77d7c

Browse files
authored
[et_xmlfile] Complete the writer_cm annotation (#16075)
1 parent 87fa01d commit 8f77d7c

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

stubs/et_xmlfile/et_xmlfile/xmlfile.pyi

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
import types
22
import xml.etree.ElementTree as ET
3-
from _typeshed import Incomplete
4-
from collections.abc import Generator
5-
from contextlib import contextmanager
3+
from collections.abc import Callable, Generator
4+
from contextlib import _GeneratorContextManager, contextmanager
65
from typing import Any
76

87
class LxmlSyntaxError(Exception): ...
98

109
class _IncrementalFileWriter:
1110
global_nsmap: dict[str, str]
1211
is_html: bool
13-
def __init__(self, output_file: ET._FileWrite) -> None: ...
12+
def __init__(self, output_file: Callable[[str], object]) -> None: ...
1413
@contextmanager
1514
def element(
1615
self,
@@ -27,7 +26,7 @@ class _IncrementalFileWriter:
2726

2827
class xmlfile:
2928
encoding: str
30-
writer_cm: Incomplete
29+
writer_cm: _GeneratorContextManager[tuple[Callable[[str], object], str]] | None
3130
def __init__(
3231
self, output_file: ET._FileWrite, buffered: bool = False, encoding: str = "utf-8", close: bool = False
3332
) -> None: ...

0 commit comments

Comments
 (0)