This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: ref. manual talks of 'sequence' instead of 'iterable'
Type: Stage:
Components: Documentation Versions: Python 2.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: fdrake Nosy List: brett.cannon, fdrake, gerrit, mcherm
Priority: normal Keywords: patch

Created on 2003-10-23 17:51 by gerrit, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
diff gerrit, 2003-10-23 17:51 patch created with 'cvs diff -u ref7.tex', see description for what it does
Messages (4)
msg44823 - (view) Author: Gerrit Holl (gerrit) Date: 2003-10-23 17:51
The language reference of Python 2.3 and the one of
Python 2.4a0 says the expression_list in a for
statement should yield a sequence. However, it may
yield any iterable, so this is not really true. It is
correct earlier in the text, since it does say "or
other iterable object" earlier. This patch changes the
mention of "sequence" to "iterable" in two more
occurences of the language reference of the for statement.
msg44824 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2003-10-24 00:44
Logged In: YES 
user_id=357491

This is slightly touchy wording.  It does accept an object that 
defines __getitem__ and not __iter__, and vice-versa.  And since 
iterables can be thought of as sequences it still basically works.

But I have no issue moving over to "iterable", personally.  I am 
going to let someone else weigh in on this.
msg44825 - (view) Author: Michael Chermside (mcherm) (Python triager) Date: 2004-08-07 15:09
Logged In: YES 
user_id=99874

I'm in favor of the change. Brett's point is valid (that it
*also* accepts an object that defines __getitem__ but isn't
a valid iterable). But (these days) the key thing is that it
should be an iterable.
msg44826 - (view) Author: Fred Drake (fdrake) (Python committer) Date: 2004-11-02 19:19
Logged In: YES 
user_id=3066

I've clarified this a bit; as long as we keep the
distinction between "iterable object" and "iterator" clear,
we're fine.  (An object that supports __getitem__() with
integer indexes but not __iter__() is perfectly valid as an
iterable; iter() is happy with it.)

Doc/ref/ref7.tex  1.42, 1.35.16.4
History
Date User Action Args
2022-04-11 14:56:00adminsetgithub: 39451
2003-10-23 17:51:01gerritcreate