
Aug. 28, 2008
6:40 p.m.
On Thu, Aug 28, 2008 at 1:41 PM, Ron Adam <rrr@ronadam.com> wrote:
Josiah Carlson wrote:
The split/strip stuff is simple on purpose; it's fast. Tossing in regular expressions handling is a great way to slow down the general case, never mind if you actually want to split on the passed literal string.
That's easy to remedy without making it overly complex.
text.split_pattern(' *\n+ *')
We're well off the original subject now, but what you propose can today be written re.split(' *\n+ *', text) which I'd argue is just as easy to remember as your proposed new method, and in fact reads better, as it's much easier to guess that regex matching is going on. Greg F