invert or reverse a string... warning this is a rant

Fredrik Lundh fredrik at pythonware.com
Fri Oct 20 16:17:09 CEST 2006


Tim N. van der Leeuw wrote:

> In practice, the short-term fix would be to add a __str__ method to the
> 'reversed' object

so what should

    str(reversed(range(10)))

do ?

> and perhaps to all iterators too (so that trying to build a string from an
> iterator would do the obvious thing).

all iterators?  who's going to do that?

</F> 






More information about the Python-list mailing list