[Python-Dev] Re: [Python-Dev] Re: [Python-Dev] Re: [Python-Dev] String methods... finally

Ka-Ping Yee ping at lfw.org
Tue Jun 15 18:05:40 CEST 1999


On Tue, 15 Jun 1999, Greg Ward wrote:
> Careful -- it actually works this way in Perl (well, except that join
> isn't a method of strings...):
> 
> $ perl -de 1
> [...]
>   DB<2> $sep = 0
> 
>   DB<3> @list = (1, 2)
> 
>   DB<4> p join ($sep, @list)
> 102
> 
> Cool!  Who needs type-checking anyways?

Cool!  So then

    >>> def f(x): return x ** 2
    ...
    >>> def g(x): return x - 5
    ...
    >>> h = join((f, g))
    ...
    >>> h(8)
    59

Right?  Right?

(Just kidding.)



-- ?!ng

"Any nitwit can understand computers.  Many do."
    -- Ted Nelson





More information about the Python-Dev mailing list