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/2006-October/069230.html below:

[Python-Dev] PATCH submitted: Speed up + for string concatenation, now as fast as "".join(x) idiom

[Python-Dev] PATCH submitted: Speed up + for string concatenation, now as fast as "".join(x) idiomFredrik Lundh fredrik at pythonware.com
Fri Oct 6 08:38:24 CEST 2006
Steve Holden wrote:

> instance.method(*args) <==> type.method(instance, *args)
> 
> You can nowadays spell this as str.join("", lst) - no need to import a 
> whole module!

except that str.join isn't polymorphic:

 >>> str.join(u",", ["1", "2", "3"])
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
TypeError: descriptor 'join' requires a 'str' object but received a 
'unicode'
 >>> string.join(["1", "2", "3"], u",")
u'1,2,3'

</F>

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