[issue38495] print built-in function docs bug

New submission from Alex Mashianov <mashianov@gmail.com>: Python docs says print() function default sep='': http://joxi.ru/EA44JnfonNwLAb.png While in reality sep=' ': http://joxi.ru/n2YXyRsbw6oYm6.png Probably it's a bug with space not being escaped in html to prevent trimming. ---------- assignee: docs@python components: Documentation messages: 354778 nosy: Alex Mashianov, docs@python priority: normal severity: normal status: open title: print built-in function docs bug type: enhancement versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue38495> _______________________________________

Karthikeyan Singaravelan <tir.karthi@gmail.com> added the comment: In the sphinx source it's ' ' so maybe it's a problem with the rendering part. https://raw.githubusercontent.com/python/cpython/master/Doc/library/function... .. function:: print(*objects, sep=' ', end='\\n', file=sys.stdout, flush=False) ---------- nosy: +xtreak _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue38495> _______________________________________

Inada Naoki <songofacandy@gmail.com> added the comment: Space is not trimmed. You can confirm there is a space by copy&paste it from rendered HTML. print(*objects, sep=' ', end='\n', file=sys.stdout, flush=False)¶ So this is caused by rendering <em>sep=' '</em>. I don't like <em>, but I'm not sure this can be customized by theme. ---------- nosy: +inada.naoki _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue38495> _______________________________________

Inada Naoki <songofacandy@gmail.com> added the comment: https://github.com/sphinx-doc/sphinx/pull/6401/files Recent Sphinx uses <em class="sig-paren">. So we can add style like this: .sig-paren { font-family: monospace, sans-serif; font-style: normal; } ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue38495> _______________________________________

Serhiy Storchaka <storchaka+cpython@gmail.com> added the comment: Maybe just explain defaults in the text? Print *objects* to the text stream *file* (the standard output by default), separated by *sep* (a space by default) and followed by *end* (a newline by default). ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue38495> _______________________________________

Change by Roundup Robot <devnull@psf.upfronthosting.co.za>: ---------- keywords: +patch pull_requests: +16570 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17062 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue38495> _______________________________________

Julien Palard <julien+python@palard.fr> added the comment: PR 17062 about stating it's a space by default has been rejected. I also feel we should just enhance the space width in the prototype. I personally see the space, but as it's in italic, I can understand it's very easy to miss it. I like the `font-family: monospace, sans-serif; font-style: normal;` a lot, it make it clear, see screenshot, but it's an issue for python-docs-theme, opening it there: https://github.com/python/python-docs-theme/issues/42 ---------- keywords: +easy -patch nosy: +mdk Added file: https://bugs.python.org/file48859/Screenshot_2020-01-22 Fonctions natives — Documentation Python 3 8 1.png _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue38495> _______________________________________

Julien Palard <julien+python@palard.fr> added the comment: Hi! Thanks Alex for reporting, and everyone involved. This has been fixed in python-docs-theme, so it's fixed for >=3.8. As 3.7 is in security-only (and embeds python-docs-theme), better not touch it. Bests. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue38495> _______________________________________
participants (6)
-
Alex Mashianov
-
Inada Naoki
-
Julien Palard
-
Karthikeyan Singaravelan
-
Roundup Robot
-
Serhiy Storchaka