
@Chris Angelico <rosuav@gmail.com> If you are more application focused, or trying to get a scientific result, and you don't care too much about the reusability of your scripts, then I can see the validity of this use case. But I would not want to install a module on pypi that made use of this. From a software perspective this is 100% bad practice, but from a practitioner perspective --- and there are a lot of practitioners that only use Python as a tool (like a DSL) --- I can see wanting it. So, that's the question: does the Python stdlib want to let you do this? Will the number of software engineers who use this incorrectly outweigh the number of people who seem to want this for a valid reason? I'm not sure what the answer is. FWIW executing `print('\x1b[H\x1b[2J\x1b[3J')` in my IPython terminal cleared the screen. On Fri, Oct 16, 2020 at 2:45 PM Chris Angelico <rosuav@gmail.com> wrote:
On Sat, Oct 17, 2020 at 5:40 AM Jonathan Crall <erotemic@gmail.com> wrote:
I just want to point out that I can think of a valid use case for `clf`.
I'm not sure if it was mentioned.
In the case where you have a script that produces a lot of output, a
common task might be scrolling to the beginning to check an output. If your screen was not fresh, and you had a lot of previous output (say from running the script multiple times), then it is hard to find the beginning unless you have previously cleared the screen.
This is exactly why I think this should NOT be made too easy. That's a perfect example of an attractive nuisance: instead of creating a divider (say, a half a dozen blank lines, or a row of hyphens with a blank or two each side), you're throwing away all information from the previous output, making it impossible to compare the two. Once your script has a clear-screen at the start of it, you lose the option to examine history, whereas a simple few blank lines would have a similar effect without losing anything.
If it is added to the stdlib, I hope that it's buried away where people find it only if they're actually looking for it. There ARE valid use-cases, but there are far far more cases where it shouldn't be used.
ChrisA _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-leave@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/7BZX6G... Code of Conduct: http://python.org/psf/codeofconduct/
-- -Dr. Jon Crall (him)