[Python-ideas] This seems like a wart to me...

Guido van Rossum guido at python.org
Sun Dec 14 17:22:40 CET 2008

Whoa. I haven't wasted much time trying to follow this (IMO rather
silly) argument about consistency. We're not going to introduce
backwards incompatibilities or deprecate existing usage of str.split()
with or without arguments are we? A dropempty argument also seems
excessive -- we can't possibly add ad-hoc filtering options to every
function that returns a list or iterator, that would be madness. As
long as the discussion is just about giving regexps a bad name I don't
really care enough to comment; but I have to draw the line when actual
API changes are being considered seriously.

--Guido van Rossum (home page: http://www.python.org/~guido/)

On Sat, Dec 13, 2008 at 4:24 PM, Stephen J. Turnbull <stephen at xemacs.org> wrote:
> Carl Johnson writes:
>  > Bruce Leban wrote:
>  >
>  > > [i for i in s.split(x) if i] is simple enough if I don't know how to
>  > > write "(" + re.escape(x) + ")+".
>  >
>  > The point of the dropempty keyword would be less the dropempty=True
>  > case as the s.split(None, dropempty=False) case, which would otherwise
>  > require a regexp.
> -0.  Eliminating str.split()'s implementation in favor of using
> str.split() in the no argument case and re.split when an argument is
> present is backward incompatible, so I can't really object although I
> prefer a fix by documenting re.split() in appropriate places.
> I do file a technical objection and ask the judge to strike the
> wording "require a regexp" from the transcript as prejudicial to the
> accused.<wink>  Preferred phrasing is "would otherwise require an
> import of re."
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas

More information about the Python-ideas mailing list