On Thu, 2006-04-27 at 10:18 -0700, Alex Martelli wrote:
> > ''.join(seq) == join('', seq)
>
> I think I would prefer a signature of:
> join(seq, joiner='')Except that I think it would be a mistake to have that and keep the .join() method on strings because that would increase the confusion in the argument order. For example, Guido pointed out a while ago that a handy way to remember the argument order in re.search() and friends is to think about pattern.search(string). That's a useful symmetry to keep. > Rationale: an emptystring joiner is the most frequent cases, but > several others (space, newline, space-comma, ...) occur often enough > to be worth allowing the joiner to be optionally specified. If I look at the ones I write a lot it's emptystring, space, newline, comma-space and the Unicode versions of them occasionally. There are others, but those are probably the majority of them. I'm not sure what that tells us, except that I don't think there's an obvious default. You could probably argue for the emptystring just as well as for the space. -Barry
signature.asc
Description: This is a digitally signed message part
_______________________________________________ Python-3000 mailing list [email protected] http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com
