<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body style="" bgcolor="#ffffff" text="#000000">
Jeremy Hylton wrote:<br>
<blockquote cite="mide8bf7a53040827093017faaec8@mail.gmail.com"
type="cite">
<pre wrap="">On Thu, 26 Aug 2004 19:12:30 -0400, David Abrahams
<a class="moz-txt-link-rfc2396E" href="mailto:dave@boost-consulting.com"><dave@boost-consulting.com></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Report from the field: I just discovered a bug that's been hiding in
my code for a few months. The code was being exercised, but the
result was the same as if the code had been correct until I threw
some new examples at it. The problem was:
self.body[e[0]:e[1]] = s
self.body is a list of strings, and s is a string. Later
''.join(self.body) gets called, so for many cases the bug was hidden.
No offense intended (okay, maybe a tiny little offense), but the
experience here is a bit Perl-like.
</pre>
</blockquote>
<pre wrap=""><!---->
It's a fair complaint. I've made the mistake myself, and it usually
takes a few head scratching and investigation before I realize that
I'm passing a string instead of some other sequence. On the other
hand, I like slicing lists and occasionally I iterate over their
characters. What's the alternative? A typecheck seems like it would
be handy, but I'm not sure what type I would want "all sequences
except strings"?
</pre>
</blockquote>
<br>
Maybe this is the time to thow out the idea that strings arent
sequences. Not backwards comaptable, but strings might grow a
string.chars property that _is_ a sequence, but strings themselves
arent sequences.<br>
</body>
</html>