[Python-checkins] CVS: python/dist/src/Lib string.py,1.46,1.47

Adrian Eyre a.eyre at optichrome.com
Wed Feb 23 13:13:00 EST 2000


>>     ['a', 'b', 'c'].join()

> You would put a method on sequence that only works if the 
> sequence contains certain types? That's a really nasty 
> precondition. Requiring the arg to string.join be a sequence 
> containing only strings is a much saner precondition.

How about a compromise. Keep the method on a string object,
but call it something else. After all, it's not 'join'ing
the object to which it is attached.

>>> " ".fill(["a", "b", "c"])
'a b c'

Not too sure about 'fill' though...

-----------------------------------------------------------------
Adrian Eyre <a.eyre at optichrome.com> - http://www.optichrome.com 





More information about the Python-list mailing list