Message46352
This patch addresses bug #852532. The underlying
problem is that re.split ignores any match it makes
that has length zero, which blocks a number of useful
possibilities. The attached patch implements a flag
'emptyok', which if set to True, causes re.split to
allow zero length matches.
My preference would be to just change the behavior of
re.split, rather than adding this flag. The old
behavior isn't documented (though a couple of cases in
test_re.py do depend on it). As a practical matter,
though, I realize that there may be some code out there
relying on this undocumented behavior. And I'm hoping
that this useful feature can be added quickly. Perhaps
this new behavior could be made the default in a future
version of Python.
(Linux 2.6.3 i686) |
|
Date |
User |
Action |
Args |
2007-08-23 15:38:35 | admin | link | issue988761 messages |
2007-08-23 15:38:35 | admin | create | |
|