FAQ
This does what I expected:
In [6]: list(iter([1,2,3,4,5]))
Out[6]: [1, 2, 3, 4, 5]

But this appears to be doing a __repr__ rather than making me a nice
string:
In [7]: str(iter("four score and seven years ago"))
Out[7]: '<iterator object at 0x0139F190>'

What's the correct way to turn an iterator over bytes into a string?
This works, but, ewww:
In [8]: "".join(iter("four score and seven years ago"))
Out[8]: 'four score and seven years ago'

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 8 | next ›
Discussion Overview
grouppython-list @
categoriespython
postedAug 18, '09 at 10:24p
activeAug 20, '09 at 4:20a
posts8
users7
websitepython.org

People

Translate

site design / logo © 2022 Grokbase