python / python/cpython

Implement a clear() function directly into Python so that os doesn't have to be imported and become overkill for a project

Open
#95,785 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

interpreter-core type-feature
Dominant language
Python
Stars
77.2k
Forks
36k
PR merge metrics
PR metrics pending

Description

Feature or enhancement

OS shouldn't need to be imported whenever you need to clear the screen. Why not just make a built-in Python function to clear the screen

Pitch

It should be able to be executed using a simple function such as clear() or cls(). It can be done for any OS using os.system('cls||clear')

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No CPython source file or test is named. Start by investigating how built-in functions and cross-platform terminal behavior are handled, using the proposed os.system('cls||clear') approach as context. Done would require a settled clear() or cls() API and defined behavior across operating systems.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.