[New-bugs-announce] [issue29791] print documentation: flush is also a keyword argument

Lucio Ricardo Montero Valenzuela report at bugs.python.org
Fri Mar 10 16:06:33 EST 2017


New submission from Lucio Ricardo Montero Valenzuela:

In the print() function documentation (https://docs.python.org/3/library/functions.html#print), the first line says "Print objects to the text stream file, separated by sep and followed by end. sep, end and file, if present, must be given as keyword arguments.", but the function definition is said to be "print(*objects, sep=' ', end='\n', file=sys.stdout, flush=False)". Based on the Python user function definition grammar, the only way of passing an value to a non-star parameters that appear after a star-parameter is with the keyword (so the interpreter knows not to push the value into the star-parameter list/mapping). So the flush parameter can be set only naming explicitly the keyword 'flush' ¿Isn't it?. So the first line of the print() function documentation should say "Print objects to the text stream file, separated by sep and followed by end. sep, end, file and flush, if present, must be given as keyword arguments.". Flush is a new parameter, so maybe you forgot to update this line of the documentation to include it.
Best regards.

----------
assignee: docs at python
components: Documentation
messages: 289411
nosy: Lucio Ricardo Montero Valenzuela, docs at python
priority: normal
severity: normal
status: open
title: print documentation: flush is also a keyword argument
type: enhancement
versions: Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29791>
_______________________________________


More information about the New-bugs-announce mailing list