Fair enough. Thank you for your time in considering this.
For context, I imagined a scenario where the instructor would ask students to run a script to make sure their environment is properly configured (e.g. in a venv with the right name, with the right Python version, with the right directories to put code on etc.) and whether PyREPL is enabled could be one of those checks, but I agree it’d be easier to just print “is your prompt (‘>>>’) colored?”.
Do you consider that detecting it programmatically could improve the detection of dumb terminals in site.py? Or that whether setting PYTHON_BASIC_REPL works or not is valuable? If not, then I’m really out of examples of advantages of adding a way to detect which REPL is in use.
It could be easy to implement, I have a PoC that just adds checks to pymain_run_stdin and pymain_repl, and sets sys.repl="basic" in sys__baserepl_impl, and it results in:
> git diff main --stat
Lib/_pyrepl/__main__.py | 1 +
Lib/_pyrepl/simple_interact.py | 1 +
Modules/main.c | 32 ++++++++++++++++++++++++++++++++
Python/sysmodule.c | 6 ++++++
4 files changed, 40 insertions(+)
But I can totally understand if YAGNI applies here.