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/048314.html below:

[Python-Dev] Re: PEP 292 - Simpler String Substitutions

[Python-Dev] Re: PEP 292 - Simpler String Substitutions [Python-Dev] Re: PEP 292 - Simpler String SubstitutionsTim Peters tim.peters at gmail.com
Tue Aug 24 18:43:11 CEST 2004
[M.-A. Lemburg]
> ...
> Aside: ''.join() currently only works for true sequences - not iterators.

>>> def gen():
...     for s in "sure", "it", "does":
...         yield s
...
>>> ' '.join(gen())
'sure it does'
>>> u' '.join(gen())
u'sure it does'
>>>

Every function implemented with PySequence_Fast() works with any
iterable, although it's fastest if the input argument is a builtin
list or tuple.  For anything else (including list or tuple subclasses,
and other "true sequences"), it materializes a temp tuple, via the
iterator protocol.
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