Re: [Python-Dev] Terminology of "Iterable" and "Iterator"

2007-07-25 Thread Greg Ewing
Raymond Hettinger wrote: > In the case of iter(collection), I prefer the current wording because the > target object need not support __iter__, it is sufficient > to supply a sequential __getitem__ method. Seems to me that should be included in the definition of an iterable -- i.e. anything for

Re: [Python-Dev] Terminology of "Iterable" and "Iterator"

2007-07-25 Thread Georg Brandl
Raymond Hettinger schrieb: > The docs do make a distinction and generally follow the definitions given in > the glossary for the tuturial. > > In the case of iter(collection), I prefer the current wording because the > target object need not support __iter__, it is sufficient to supply a > sequent

Re: [Python-Dev] Terminology of "Iterable" and "Iterator"

2007-07-25 Thread Raymond Hettinger
- Original Message - From: "Calvin Spealman" <[EMAIL PROTECTED]> To: "Python Mailing List" Sent: Wednesday, July 25, 2007 5:18 AM Subject: [Python-Dev] Terminology of "Iterable" and "Iterator" >I got into a discussion about this, which

Re: [Python-Dev] Terminology of "Iterable" and "Iterator"

2007-07-25 Thread Nick Coghlan
Calvin Spealman wrote: > This might indicate that it is using "collection" where I would say > "iterable". Also, the same docstring makes mention of something being > an iterator _or_ a sequence, so I also should bring up that it may be > antiquated, yes? http://docs.python.org/dev/lib/typeiter.ht

[Python-Dev] Terminology of "Iterable" and "Iterator"

2007-07-25 Thread Calvin Spealman
I got into a discussion about this, which made me think it would make sense to formalize a distinction between "iterable" and "iterator". To nearly any python developer I talk with, we can define them as: iterable - An object which can be passed to the built-in iter() function, which returns an it