textFromMap(seq , map=None , sep='' , ldelim='', rdelim='')

The downside of flipping the object and parameter of split is that there's no clear thing to translate "blah\tblah\nblah".split() ==> ['blah', 'blah', 'blah'] into. None.split(string) is crazy talk. Then again, the case can be made that split() doesn't behave like the other splits (it drops empty segments; it treats all whitespace the same), so maybe it shouldn't have the same name as the normal kind of split. I do think that it might be convenient to be able to do this: commasplit = ', '.divide #If we're going to imagine this, we should probably use a different name than "split" list1 = commasplit(string1) list2 = commasplit(string2) … The same way that one can do: commajoin = ', '.join string1 = commajoin(list1) string2 = commajoin(list2) … But the convention is too old and the advantage is too slight to bother with sort of bikeshedding now. Save it for when you design a new language to replace Python. :-) -- Carl

Carl M. Johnson wrote:
''.join(seqofstr) is deemed better-looking than sum(seqofstr), isn't it? Imo, this entails an aesthetic canon in favor of ''.split in the above context. Note that currently s.split('') bombs, so there would be no functional behavior to save.
Yeah, that's a concrete rendition of my earlier point on bound methods.
Thanks :) But if I was to redesign the snake, I guess I might contemplate pieces = string/separator to mean pieces = string.split(separator) :) Cheers, BB

Carl M. Johnson wrote:
''.join(seqofstr) is deemed better-looking than sum(seqofstr), isn't it? Imo, this entails an aesthetic canon in favor of ''.split in the above context. Note that currently s.split('') bombs, so there would be no functional behavior to save.
Yeah, that's a concrete rendition of my earlier point on bound methods.
Thanks :) But if I was to redesign the snake, I guess I might contemplate pieces = string/separator to mean pieces = string.split(separator) :) Cheers, BB
participants (2)
-
Boris Borcic
-
Carl M. Johnson