[Python-Dev] Re: [Python-checkins] python/dist/src/Lib/test test_string.py, 1.25, 1.26 (original) (raw)
Walter Dörwald walter at livinglogic.de
Thu Aug 26 14:47:36 CEST 2004
- Previous message: [Python-Dev] Re: [Python-checkins] python/dist/src/Lib/test test_string.py, 1.25, 1.26
- Next message: [Python-Dev] Re: [Python-checkins] python/dist/src/Lib/test test_string.py, 1.25, 1.26
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Nick Coghlan wrote:
Walter Dörwald wrote:
teststring.py is supposed to test the string module. This new test should be moved to teststr.py (or even better to stringtest.py, so that it can be reused for doing the same test with unicode objects). Ah, I think I see where the tests should have gone (MixinStrUnicodeUserStringTest.testjoin in stringtest.py). I'll work up a patch to bring those tests in sync with the rest of the string tests (the structure of which I find harder to follow than the string code itself. . .). However, I probably won't get to it for a week or so.
I'm working on it, however I discovered that unicode.join() doesn't optimize this special case:
s = "foo" assert "".join([s]) is s
u = u"foo" assert u"".join([s]) is s
The second assertion fails.
I'd say that this test (joining a one item sequence returns the item itself) should be removed because it tests an implementation detail.
I'm not sure, whether the optimization should be added to unicode.find().
Bye, Walter Dörwald
- Previous message: [Python-Dev] Re: [Python-checkins] python/dist/src/Lib/test test_string.py, 1.25, 1.26
- Next message: [Python-Dev] Re: [Python-checkins] python/dist/src/Lib/test test_string.py, 1.25, 1.26
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]