[issue29791] print documentation: flush is also a keyword argument
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@python components: Documentation messages: 289411 nosy: Lucio Ricardo Montero Valenzuela, docs@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@bugs.python.org> <http://bugs.python.org/issue29791> _______________________________________
Changes by Berker Peksag <berker.peksag@gmail.com>: ---------- pull_requests: +1235 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue29791> _______________________________________
Changes by Berker Peksag <berker.peksag@gmail.com>: ---------- nosy: +berker.peksag stage: -> patch review type: enhancement -> behavior versions: +Python 3.5, Python 3.7 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue29791> _______________________________________
Berker Peksag added the comment: New changeset 61b9ac93712df8092a25223cd56fa6528359792b by Berker Peksag in branch 'master': bpo-29791: Clarify that flush is keyword-only argument (#1093) https://github.com/python/cpython/commit/61b9ac93712df8092a25223cd56fa652835... ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue29791> _______________________________________
Changes by Berker Peksag <berker.peksag@gmail.com>: ---------- pull_requests: +1252 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue29791> _______________________________________
Changes by Berker Peksag <berker.peksag@gmail.com>: ---------- pull_requests: +1253 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue29791> _______________________________________
Berker Peksag added the comment: New changeset df9783720e40773e7854d2f4e4cfc93f0a2c08b8 by Berker Peksag in branch '3.5': bpo-29791: Clarify that flush is keyword-only argument (GH-1093) https://github.com/python/cpython/commit/df9783720e40773e7854d2f4e4cfc93f0a2... ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue29791> _______________________________________
Berker Peksag added the comment: New changeset 119d94ad37a99ecb0b8329467d04cd9d909e310e by Berker Peksag in branch '3.6': bpo-29791: Clarify that flush is keyword-only argument (GH-1093) https://github.com/python/cpython/commit/119d94ad37a99ecb0b8329467d04cd9d909... ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue29791> _______________________________________
Berker Peksag added the comment: Thanks for the report! ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue29791> _______________________________________
participants (2)
-
Berker Peksag -
Lucio Ricardo Montero Valenzuela