python / python/cpython

Use new REPL for the "code" module

未關閉
#119,512 4 則留言 4 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

stdlib topic-repl type-feature
主要語言
Python
星號
77.2k
分支
35.9k
PR 合併指標
PR 指標待擷取

描述

Feature or enhancement

Proposal:

When installing Django in a Python 3.13 virtual environment and using Django's shell command, the old REPL is used.

It would be great if the code module supported the new REPL. From @ambv's reply in https://github.com/python/cpython/issues/119433#issuecomment-2130060062 it looks like this will be considered in Python 3.14.


I would also like to know what projects should do in the meantime. For example, I found a way to modify Django's shell command in one's own project to use the new REPL, by using this within a try-except block:

from _pyrepl.simple_interact import run_multiline_interactive_console
run_multiline_interactive_console()

Is this an acceptable workaround before Python 3.14 is released? Or should this function not be relied on, seeing as it's in an undocumented module?

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

https://github.com/python/cpython/pull/119433#pullrequestreview-2074755660

Linked PRs
  • gh-148261

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

先檢閱 Python 程式碼模組和所參照的 _pyrepl.simple_interact workaround,然後閱讀連結的 CPython 討論和 PR gh-148261。完成的判定標準是確定程式碼模組應如何使用新的 REPL,並釐清該 workaround 在 Python 3.14 之前是否適用。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
python
領域
cli
Issue 類型
功能
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。