computing with characters
Duncan Booth
duncan.booth at invalid.invalid
Wed Apr 30 07:56:03 EDT 2008
Torsten Bronger <bronger at physik.rwth-aachen.de> wrote:
> However, join() is really bizarre. The list rather than the
> separator should be the leading actor.
Do you mean the list, or do you mean the list/the tuple/the dict/the
generator/the file and anything else which just happens to be an iterable
sequence of strings?
join is a factory method for creating a string from a separator string and
a sequence of strings, any sequence of strings. It doesn't make sense to
either limit it to specific sequence types, or to require it as part of the
iterator protocol.
Having it as a function would make sense, but if it is going to be a method
then it should be a method on the string types not on the sequence types.
More information about the Python-list
mailing list