mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
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:
committed by
Guido van Rossum
parent
6537649fda
commit
d492c5360d
@@ -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): ...
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user