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

Stephen J. Turnbull stephen at xemacs.org
Sun Dec 14 01:24:33 CET 2008


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."




More information about the Python-ideas mailing list