Roger Serwy added the comment:

The only reason that the IDLE shell is slow is due to the shell's text widget 
being configured to have wrap="char". If we manually wrapped the output then 
the shell responds very quickly to rendering really long strings.

The attached proof-of-concept patch (against 2.7 tip) implements manual 
wrapping. You can type "print('a' * 10**6)" and the shell responds almost 
instantly when using no-subprocess mode. (The RPC overhead becomes readily 
apparent when using a subprocess, introducing a large uninteruptable delay. 
That's another issue.)

I left text wrapping enabled in the shell since the user may be using a 
variable-spaced font. A possible compromise would be to increase the wrap_index 
to a large number, like 32768, before IDLE inserts a '\n' into the output. This 
would mimic the wrapping behavior of the original shell, but keep the shell 
responsive when you write a very long string to the output.

----------
keywords: +patch
versions:  -Python 3.2
Added file: http://bugs.python.org/file29675/manual_wrap.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue1442493>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to