>>>>> "AK" == Andrew Koenig <ark@research.att.com> writes: AK> Back in February, there was a thread in comp.lang.python (and, AK> I think, also on Python-Dev) that asked whether the following AK> behavior: >> 'abcde'.split('') | Traceback (most recent call last): | File "<stdin>", line 1, in ? | ValueError: empty separator AK> was a bug or a feature. The prevailing opinion at the time AK> seemed to be that there was not a sensible, unique way of AK> defining this operation, so rejecting it was a feature. AK> That answer didn't bother me particularly at the time, but AK> since then I have learned a new fact (or perhaps an old fact AK> that I didn't notice at the time) that has changed my mind: AK> Section 4.2.4 of the library reference says that the 'split' AK> method of a regular expression object is defined as AK> Identical to the split() function, using the compiled AK> pattern. AK> This claim does not appear to be correct: Actually, I believe what it's saying is that re.compile('').split('abcde') is the same as re.split('', 'abcde') not that re...split() has anything to do with the split() string method. -Barry
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4