IDLE should check the size of lines in a result string before printing it. Perhaps it should have a "..." after some user settable limit is reached.
>>> '=' * 100000 # Destroys IDLE
>>> json.load(somebigfile) # Makes IDLE unusably sluggish
The problem only occurs when an individual line is long:
>>> s = 'some reasonable single line\n' * 1000)
>>> print(s) # Separate lines are no problem
>>> s # A big single line repr renders IDLE sluggish
Note, the sluggishness persists across sessions -- a "Restart Shell" doesn't help.
In my Python classes, this is a common and recurring problem that negatively impacts the learner's user experience.
|