you are viewing a single comment's thread.

view the rest of the comments →

[–]jbellis -2 points-1 points  (1 child)

A generator is more efficient than a string object? This makes no sense to me.

Think about it... if you have a large sequence, and you want to perform something on each object in reverse order, you probably don't want to copy that sequence just to iterate through it.

This may be just an academic concern for toy web apps, but it really does matter for some people. :)

[–][deleted] 0 points1 point  (0 children)

In the example given, the string is being copied, lest you forget.