◐ Shell
clean mode source ↗

Message 370724 - Python tracker

I am not sure if 3 compiles are always needed.  At one time, compile required a final '\n' to not raise, but that is no longer true.  And as near as I can tell, 'code without final newline\n' and 'code without final newline\n\n' always compile the same.  Certainly, Shell does not need to compile without a final newline.  But we can look at this in a separate issue.  If IDLE's requirement is different from code.II's, I believe it could pass its own compile function.