Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-92244 Added clear() to clear the interpreter shell in case it is a bit clunky #92232

Closed
wants to merge 1 commit into from
Closed

Conversation

ghost
Copy link

@ghost ghost commented May 3, 2022

this change added will clear the terminal in case it is a bit clunky and full of errors,
previously while trying to clear the terminal shell there would be an error as follows:

Python 3.10.4 (main, Apr  2 2022, 09:04:19) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> clear()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'clear' is not defined

with this change the clear() command will clear the terminal shell

#92244

@cpython-cla-bot
Copy link

cpython-cla-bot bot commented May 3, 2022

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-bot
Copy link

Every change to Python requires a NEWS entry.

Please, add it using the blurb_it Web app or the blurb command-line tool.

@BrandonTheBuilder
Copy link

As a simple workaround you can define a global function in your interactive startup file.
This will also avoid having to load the builtin for non-interactive sessions and needing to manage cross compatibility.

@ghost
Copy link
Author

ghost commented May 3, 2022

well i think of the python interactive shell should have it built in , because atleast for me when i switch to different workspaces its kinda tedious to set the pythonrc everytime

@AlexWaygood AlexWaygood added the type-feature A feature request or enhancement label May 3, 2022
@AlexWaygood
Copy link
Member

AlexWaygood commented May 3, 2022

Hi, welcome to CPython! An addition to builtins or sitebuiltins needs to meet quite a high bar to be accepted, and I'm not sure if this meets that bar. Regardless, a new feature like this is very unlikely to get accepted without being first discussed in an issue, so I'd definitely recommend opening one. If you do so, and update the title of this PR to gh-XXXXX: Added clear() to clear the interpreter shell, where XXXXX is the ID of the issue you've opened, then the relevant CI check will go green.

@ghost ghost changed the title Added clear() to clear the interpreter shell in case it is a bit clunky gh-92244 Added clear() to clear the interpreter shell in case it is a bit clunky May 3, 2022
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review type-feature A feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants