iterable terminology (for language lawyers)

Raymond Hettinger vze4rx4y at verizon.net
Wed Mar 16 16:24:25 EST 2005


[R. Hettinger]
> > You're best bet is to quote the tutorial's glossary,
> > http://docs.python.org/tut/node18.html :

[Michele Simionato]
> Aha! That glossary looks like a nice new addition to the tutorial.
> Maybe the standard library and the language
> reference should link to it somewhere? (maybe
> there already such links but I missed them).

You know where to submit a patch ;-)


> Would you agree with Leif's definition that iterable is
> any x such that iter(x) does not raise an error?

Sure, that is an accurate but not especially informative tautology.

A person can memorize that definition and still know nothing useful like what
they do (return their elements one at a time), what they look like (__iter__ or
__getitem__ methods), or how they work.

You might also mention that monglable is defined as any x such that mongle(x)
does not fail.  Knowing that fact is the key to a complete and deep
understanding of monglation ;-)



Raymond Hettinger





More information about the Python-list mailing list