"F. Petitjean" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
>I want to know if iter(iterator) returns always its argument (when
> argument is an iterator)

By the strict definition of iterator (versus iterable) that requires that 
as a condition to be an iterator, then yes.  If you use a looser definition 
of iterator, then perhaps not.

>>>> iterable = range(10)
>>>> it = iter(iterable)
>>>> that = iter(it)
>>>> that is it
> True    # Good!
>>>> that is it is not it

This is equivalent to '(that is it) and (it is not it)' which is clearly 
false.

> False   # What ?

Reread the ref manual on chained comparison operators.

Terry J. Reedy



-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to