pprint stream type (#178)

* Use less strict IO[str] instead of TextIO

* IO[Any] should be IO[str]

See also discussion in #17.
This commit is contained in:
FichteFoll
2016-05-03 20:48:38 +02:00
committed by Guido van Rossum
parent 6537649fda
commit d492c5360d
2 changed files with 5 additions and 5 deletions

View File

@@ -4,7 +4,7 @@
from typing import IO, Any
def pprint(object: Any, stream: IO[Any] = ..., indent: int = ..., width: int = ...,
def pprint(object: Any, stream: IO[str] = ..., indent: int = ..., width: int = ...,
depth: int = ...) -> None: ...
def pformat(object, indent=..., width=..., depth=...): ...
def saferepr(object): ...
@@ -13,7 +13,7 @@ def isrecursive(object): ...
class PrettyPrinter:
def __init__(self, indent: int = ..., width: int = ..., depth: int = ...,
stream: IO[Any] = ...) -> None: ...
stream: IO[str] = ...) -> None: ...
def pprint(self, object): ...
def pformat(self, object): ...
def isrecursive(self, object): ...

View File

@@ -2,11 +2,11 @@
# Based on http://docs.python.org/3.2/library/pprint.html
from typing import Any, Dict, Tuple, TextIO
from typing import Any, Dict, Tuple, IO
def pformat(o: object, indent: int = ..., width: int = ...,
depth: int = ...) -> str: ...
def pprint(o: object, stream: TextIO = ..., indent: int = ..., width: int = ...,
def pprint(o: object, stream: IO[str] = ..., indent: int = ..., width: int = ...,
depth: int = ...) -> None: ...
def isreadable(o: object) -> bool: ...
def isrecursive(o: object) -> bool: ...
@@ -14,7 +14,7 @@ def saferepr(o: object) -> str: ...
class PrettyPrinter:
def __init__(self, indent: int = ..., width: int = ..., depth: int = ...,
stream: TextIO = ...) -> None: ...
stream: IO[str] = ...) -> None: ...
def pformat(self, o: object) -> str: ...
def pprint(self, o: object) -> None: ...
def isreadable(self, o: object) -> bool: ...