Skip to content

Commit f532198

Browse files
committed
Type FileOutput.write
1 parent df8de9e commit f532198

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

stubs/docutils/docutils/io.pyi

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ from _typeshed import (
88
Unused,
99
)
1010
from re import Pattern
11-
from typing import IO, Any, ClassVar, Final, Generic, Literal, TypeVar
11+
from typing import IO, Any, ClassVar, Final, Generic, Literal, TypeVar, overload
1212

1313
from docutils import TransformSpec, nodes
1414

@@ -104,7 +104,12 @@ class FileOutput(Output):
104104
mode=None,
105105
) -> None: ...
106106
def open(self) -> None: ...
107-
def write(self, data): ...
107+
@overload
108+
def write(self, data: str) -> str: ...
109+
110+
@overload
111+
def write(self, data: bytes) -> bytes: ...
112+
def write(self, data: str | bytes) -> str | bytes: ...
108113
def close(self) -> None: ...
109114

110115
class BinaryFileOutput(FileOutput): ...

0 commit comments

Comments
 (0)