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.

Author terry.reedy
Recipients JayKrish, Todd.Rovito, philwebster, terry.reedy
Date 2013-07-02.06:27:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1372746429.24.0.302256663103.issue18226@psf.upfronthosting.co.za>
In-reply-to
Content
Phil (and Todd): I do not know what you mean by "behaves like more like an actual Text Widget" and whether you are talking about internal or external behavior. But I know that tk does not use an immutable string to hold the text. There is no such thing in C. Tk might use one array of 2-byte words with a gap at the cursor and an auxiliary line pointer array, or it might use an array of line structure similar to what I did (but again with arrays rather than immutable strings for each line), or possibly some other structure, However we could only imitate the internals of tk.Text by using (deprecated) PyUNICODE arrays (see the array doc) and doing much more programming effort.

Re-splitting a single line over and over is too inefficient to consider for a repository patch. I believe your particular indexToInt with getLine makes the conversion O(n*n) instead of 'just' O(n), whereas keeping the line in split form makes it O(1).

Side note, as far as I know, "re.split('\n', text)" (the r prefix is not needed here) does the same thing as text.split('\n'). But it is slower and harder to type. We don't use re when a string method does the same thing.
History
Date User Action Args
2013-07-02 06:27:09terry.reedysetrecipients: + terry.reedy, Todd.Rovito, JayKrish, philwebster
2013-07-02 06:27:09terry.reedysetmessageid: <1372746429.24.0.302256663103.issue18226@psf.upfronthosting.co.za>
2013-07-02 06:27:09terry.reedylinkissue18226 messages
2013-07-02 06:27:08terry.reedycreate