<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Jan 5, 2014 at 9:48 AM, Andrew Barnert <span dir="ltr"><<a href="mailto:abarnert@yahoo.com" target="_blank">abarnert@yahoo.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">> Reading this thread made me start to think about why a string is a sequence, and I can't actually see any obvious reason, other than historical ones.<br>
<br>
</div>You've seriously never indexed or sliced a string? Those are the two core operations in sequences, and they're obviously useful on strings.<br>
<div class="im"></div></blockquote></div><br>I am doing most coding in two languages right now: Python and Javascript. I have never wished that Python had <font face="courier new, monospace">string.charAt(i)</font> but I have often wished that Javascript had <font face="courier new, monospace">string[i]</font>. When I've iterated over the characters in a string in Javascript, it has never occurred to me to write it using <font face="courier new, monospace">str.split('')</font>.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">By irrelevant analogy, I have never used complex numbers in Python or Javascript and I can't see any obvious reason to support them. It just confuses people who inadvertently write <font face="courier new, monospace">cmath.sqrt</font> instead of <font face="courier new, monospace">math.sqrt</font>. For the few people that use complex numbers, they would be better served by a tuple of real and imaginary parts. As someone who doesn't use them, my opinion is clearly more important that that of those that use them.<br>
<br clear="all"><div><font face="arial, helvetica, sans-serif">--- Bruce<br></font><div><div><font face="arial, helvetica, sans-serif">Learn how hackers think: <a href="http://j.mp/gruyere-security" target="_blank">http://j.mp/gruyere-security</a></font></div>
</div></div><div><br></div><div>(Not serious about removing complex numbers from Python. If you didn't see the sarcasm, sorry.)</div>
</div></div>