This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: IDLE: self.use_context_ps1 defined in editor, but always False
Type: Stage:
Components: IDLE Versions: Python 3.8, Python 3.7, Python 3.6
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: terry.reedy Nosy List: cheryl.sabella, terry.reedy
Priority: normal Keywords:

Created on 2018-02-24 15:52 by cheryl.sabella, last changed 2022-04-11 14:58 by admin.

Messages (2)
msg312727 - (view) Author: Cheryl Sabella (cheryl.sabella) * (Python committer) Date: 2018-02-24 15:52
In the EditorWindow in editor.py, there is an attribute called `self.context_use_ps1` that is only set to False.

Changed to an instance variable in:
https://github.com/python/cpython/commit/6af44986029c84c4c5df62a64c60a6ed978a3693 

Removed from pyshell in:
https://github.com/python/cpython/commit/e86172d63af5827a3c2b55b80351cb38a26190eb
msg312774 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2018-02-25 04:11
#31858 (second link) replaced one (?) use of "if use_context_ps1" ('in Shell') with "if self.last_prompt_line != ''" ("prompt before code on same line").  This can only happen in Shell, and only if the prompt ends with something other than '\n'.

I cannot remember whether intentionally removing use_context_ps1 = True, but I may have found that it improved behavior in some case and may have intended to followup but have not yet.  Part of the problem is that smart indents do not work right in the shell, and if they did, they would be wrong as soon as one copied code from shell to editor.

Before merging "I tested the patch manually in both shell and editor with both the default prompt and with sys.ps1 set before importing idlelib.idle."  But I did not write out what I did and what the results were.

The immediate issue is to decide whether to do nothing, revert the removal, or change the editor code, and document why.  Fresh knowledge of pyparse should help.
History
Date User Action Args
2022-04-11 14:58:58adminsetgithub: 77120
2018-02-25 04:11:11terry.reedysettype: enhancement ->
messages: + msg312774
2018-02-24 15:52:53cheryl.sabellacreate