builtins.print: make sep and end Optional (#3468) (#3511)

The docs for Python 2 and Python 3 both explicitly mentions that None is a
valid value for sep and end.
https://docs.python.org/3/library/functions.html#print
This commit is contained in:
hauntsaninja
2019-11-29 06:02:30 -08:00
committed by Jelle Zijlstra
parent a9a4fd0d42
commit 5fdd6ad1a5
2 changed files with 12 additions and 4 deletions

View File

@@ -1351,12 +1351,16 @@ def ord(__c: Union[Text, bytes]) -> int: ...
if sys.version_info >= (3,):
class _Writer(Protocol):
def write(self, __s: str) -> Any: ...
def print(*values: object, sep: Text = ..., end: Text = ..., file: Optional[_Writer] = ..., flush: bool = ...) -> None: ...
def print(
*values: object, sep: Optional[Text] = ..., end: Optional[Text] = ..., file: Optional[_Writer] = ..., flush: bool = ...
) -> None: ...
else:
class _Writer(Protocol):
def write(self, __s: Any) -> Any: ...
# This is only available after from __future__ import print_function.
def print(*values: object, sep: Text = ..., end: Text = ..., file: Optional[_Writer] = ...) -> None: ...
def print(*values: object, sep: Optional[Text] = ..., end: Optional[Text] = ..., file: Optional[_Writer] = ...) -> None: ...
@overload
def pow(__x: int, __y: int) -> Any: ... # The return type can be int or float, depending on y
@overload