Primary
''iterable'' ⚬|Definition|1st|20260605182851-00-⌔
Glossary — Python 3 documentation#term-iterable
iterable
An object capable of returning its members one at a time. Examples of iterables include all sequence types (such as
list,str, andtuple) and some non-sequence types likedict, file objects, and objects of any classes you define with an__iter__()method or with a__getitem__()method that implements sequence semantics.Iterables can be used in a
forloop and in many other places where a sequence is needed (zip(),map(), …). When an iterable object is passed as an argument to the built-in functioniter(), it returns an iterator for the object. This iterator is good for one pass over the set of values. When using iterables, it is usually not necessary to calliter()or deal with iterator objects yourself. Theforstatement does that automatically for you, creating a temporary unnamed variable to hold the iterator for the duration of the loop. See also iterator, sequence, and generator.Printed 2026-06-28.
(echo:: @ ᯤ)
Link to original
Secondary
• • •