On 2020-12-22 14:01, Steven D'Aprano wrote:
> It seems to me that the primary use for this will be in the interactive
> interpreter. People are used to something like "cls" or "clear" from
> various shells. Using it in scripting is, I think, a secondary use-case.
I disagree. yes, I want to clear the screen a lot during interactive use, but I'd rather do that with a keystroke (cmd+K on the Mac) -- and indeed, do that with iPython all the time, even though iPython has the command built in.

So I think the reason to have it in the std lib is for scripting, and I think putting it in os or sys is just fine.


> Given that, I think that like other conveniences for interactive use
> like `help`, it should be available without an import.

Agreed in general, however Ctrl+L is mostly available for this purpose.  There
are two major exceptions unfortunately.

One is when using cmd.exe.  However, every other combination of shell and
console/terminal on Windows does support it.  Not to mention everywhere Unix has
an influence.

Second is the Python REPL console on Windows.  I'm guessing it wouldn't be too
hard to add Ctrl+L handling to it.  Would be useful I think, regardless of some
of the other decisions that need to be made.

Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-leave@python.org
Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/FU7MZEY6NPUN54W7QMFNABUQB6LSPP2Z/
Code of Conduct: http://python.org/psf/codeofconduct/

Christopher Barker, PhD

Python Language Consulting
  - Teaching
  - Scientific Software Development
  - Desktop GUI and Web Development
  - wxPython, numpy, scipy, Cython