If someone really wants 'abc'.replace('', '-') to return '-a-b-c-', please submit patches for both 8-bit and Unicode strings to SourceForge and assign to me. I looked into this and it's non-trivial: the implementation used for 8-bit strings goes into an infinite loop when the pattern is empty, and the Unicode implementation tacks '----' onto the end. Please supply doc and unittest patches too. At least re does the right thing already: >>> import re >>> re.sub('', '-', 'abc') '-a-b-c-' >>> --Guido van Rossum (home page: http://www.python.org/~guido/)
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