[i for i in s.split(x) if i] is simple enough if I don't know how to write "(" + re.escape(x) + ")+".

I would like to be able to drop "i for" in cases like this and just write [i in s.split(x) if i].

--- Bruce


On Sat, Dec 13, 2008 at 12:05 PM, Carl Johnson <carl@carlsensei.com> wrote:
I think this discussion is drifting from the point. We all agree that regexps are great and powerful and no professional programmer should fail to learn them. But at the same time, it's worth noting that they are a different language from Python proper, and it's very easy to get weird results without knowing why.

Anyway, apparently the proposal to allow splitting on a list is dead. What do people think of the proposal to add a dropitem keyword to allow the dropping (or retaining) of empty results?

-- Carl

_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
http://mail.python.org/mailman/listinfo/python-ideas