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

Adam Olsen rhamph at gmail.com
Fri Dec 12 10:23:46 CET 2008


On Fri, Dec 12, 2008 at 1:43 AM, Stephen J. Turnbull <stephen at xemacs.org> wrote:
> Carl Johnson writes:
>
>  > the famed saying of Jamie Zawinski ("Some people, when confronted with
>  > a problem, think 'I know, I'll use regular expressions.'  Now they
>  > have two problems.") is not highly motivating. :-D
>
> Jamie was talking about the "to a man with a hammer, all problems look
> like thumbs" phenomenon.  I've never heard anybody complain that shell
> globs are complex.  But regexps will take you a lot farther with just
> character classes [] (which most modern shells implement), the
> wildcard character . (usually ? in shells), and the repetition
> operators * and/or + (available only as a variable-length wildcard *
> in shell globs).
>
>  > > In fact, I personally would like to deprecate the with-argument
>  > > implementation of string.split(), ....
>  > >
>  > > Would that work for you?
>  >
>  > Wouldn't that subtly break the code of everyone who has written
>  > something like:
>
> Indeed it would.  That was not a serious proposal.  At this point, I'm
> trying to understand the resistence to regexps, not propose an
> improvement for .split().

I'd say the lack of diagnostics when they "fail" is the biggest issue.
 I could easily spend half an hour trying random permutations of a
pattern before I figure out why the original didn't work... and I've
had a moderate amount of experience.


-- 
Adam Olsen, aka Rhamphoryncus



More information about the Python-ideas mailing list