On Sun, Sep 2, 2012 at 3:09 AM, Ray Jones <crawlz...@gmail.com> wrote:
>
> But didn't I read somewhere that you can reset an iterator to go through
> the whole process again?

You could implement that ability in your own objects, but it's not
part of the protocol.

I forgot to mention generator expressions. This is an expression
(typically requiring parentheses) that evaluates to a generator
object. You can omit the parentheses if it's the only argument in a
call. For example:

    >>> g = (chr(i) for i in range(65, 69))
    >>> ", ".join(g)
    'A, B, C, D'

    >>> ", ".join(chr(i) for i in range(65, 69))
    'A, B, C, D'

http://docs.python.org/glossary.html#generator%20expression
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to