Description
When filing #22955, I was reminded that there is no way to stop prompt()
from printing a space when collecting user input. You can see that in the leading spaces in the final command-line example in that issue, as compared against the first example.
In general, I like the implicit newline that prompt()
appends to the provided prompt (and the implicit [y/N]
in the case of confirm()
). I think it provides a better programmer experience than Python's input()
in most cases.
However, the inability to easily collect input without polluting stdout is annoying, and will become more problematic if the aforementioned feature request gains traction.
Perhaps a compromise would be to make prompt()
print nothing but still wait for newline-terminated input when called with no arguments? One downside is that this would be inconsistent with confirm()
and alert()
's behavior in this case.
I'm curious to hear others' thoughts and ideas!