A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-August/048412.html below:

[Python-checkins] python/dist/src/Lib/test test_string.py, 1.25, 1.26

[Python-Dev] Re: [Python-checkins] python/dist/src/Lib/test test_string.py, 1.25, 1.26 [Python-Dev] Re: [Python-checkins] python/dist/src/Lib/test test_string.py, 1.25, 1.26Nick Coghlan ncoghlan at iinet.net.au
Fri Aug 27 01:20:15 CEST 2004
Walter Dörwald wrote:
> I'm working on it, however I discovered that unicode.join()
> doesn't optimize this special case:

I noticed that during the implementation of the patch. I think it's 
because unicode join doesn't use a multi-pass approach, so there's no 
opportunity to notice that the optimisation is possible.

> 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.

Fine by me - I was uncertain about that when I posted the patch to SF 
(there's a question about it in the patch tracker item). The main reason 
I had that test there was to make sure that the second version of the 
patch didn't break this optimisation the way the first version did.

Regards,
Nick.
More information about the Python-Dev mailing list

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