A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/1999-June/095382.html below:

[Python-Dev] String methods... finally

[Python-Dev] String methods... finally [Python-Dev] String methods... finallyFredrik Lundh fredrik at pythonware.com
Fri Jun 11 09:06:58 CEST 1999
Guido wrote: 
> Note that this is not as powerful as string.join(); the latter works
> on any sequence, not just on lists and tuples.  (Though that may not
> be a big deal.)
> 
> I also find it slightly objectionable that this is a general list
> method but only works if the list contains only strings; Dave Ascher's
> generalization to reduce() is cute but strikes me are more general
> than useful, and the name will forever present a mystery to most
> newcomers.
> 
> Perhaps join() ought to be a built-in function?

come to think of it, the last design I came up with (inspired
by a mail from you which I cannot find right now), was this:

def join(sequence, sep=None):
    # built-in
    if not sequence:
        return ""
    sequence[0].__join__(sequence, sep)

string.join => join

and __join__ methods in the unicode and string classes.

Guido?

</F>



More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4