1
1
# Stubs for cStringIO (Python 2.7)
2
2
# See https://docs.python.org/2/library/stringio.html
3
3
4
- from typing import overload , IO , List , Iterable , Iterator , Union
4
+ from typing import overload , IO , List , Iterable , Iterator , Optional , Union
5
5
from types import TracebackType
6
6
7
7
# TODO the typing.IO[] generics should be split into input and output.
@@ -18,7 +18,7 @@ class InputType(IO[str], Iterator[str]):
18
18
def readlines (self , hint : int = - 1 ) -> List [str ]: ...
19
19
def seek (self , offset : int , whence : int = ...) -> None : ...
20
20
def tell (self ) -> int : ...
21
- def truncate (self , size : int = ...) -> None : ...
21
+ def truncate (self , size : int = ...) -> Optional [ int ] : ...
22
22
def __iter__ (self ) -> 'InputType' : ...
23
23
def next (self ) -> str : ...
24
24
def reset (self ) -> None : ...
@@ -37,7 +37,7 @@ class OutputType(IO[str], Iterator[str]):
37
37
def readlines (self , hint : int = - 1 ) -> List [str ]: ...
38
38
def seek (self , offset : int , whence : int = ...) -> None : ...
39
39
def tell (self ) -> int : ...
40
- def truncate (self , size : int = ...) -> None : ...
40
+ def truncate (self , size : int = ...) -> Optional [ int ] : ...
41
41
def __iter__ (self ) -> 'OutputType' : ...
42
42
def next (self ) -> str : ...
43
43
def reset (self ) -> None : ...
0 commit comments