[Python-ideas] reduce(func, seq, initial=0)

Stefan Behnel stefan_ml at behnel.de
Fri Oct 10 13:29:51 CEST 2014


Florian Bruhin schrieb am 10.10.2014 um 13:05:
> FWIW, I'd also really like to see keyword arguments for these
> builtins. I always have to keep myself from doing things like
> 
>     "foo bar	baz".split(count=1)
> 
> But as said, I suspect there is *some* reason this is not possible.

You only have to use the right argument name (and Py3.4):

    >>> "abc def".split(maxsplit=1)
    ['abc', 'def']

Stefan




More information about the Python-ideas mailing list