liveBook · Manning

Iterable

An iterable is an object or value that provides or supports a protocol for producing its elements sequentially.

How 7 Manning books explain it

Python Workout, Second Edition

An iterable is a Python object that can provide its elements one at a time for iteration.

How it is used
Uses iterables to drive for loops, comprehensions, argument unpacking, and transformations across Python data structures.
How deep it goes
Defines the iterator protocol and distinguishes iterables from iterators, while deferring deeper protocol practice to custom iterators and generators.
Examples
Demonstrates strings, lists, dictionaries, files, ranges, numeric joining, hexadecimal conversion, comprehensions, and custom enumeration.
What you can do after
Build iterable classes and generator functions, then diagnose for-loop behavior through __iter__, __next__, and StopIteration.

Read how Python Workout, Second Edition explains iterable →

Python How-To

How it is used
Uses iterables to feed loops, container constructors, and string joining without requiring manual indexing.
How deep it goes
Explains iteration through iter(), next(), and StopIteration, then tests iterability and works through constructor-based uses.
Examples
Shows task ID–title pairs built with dict(zip()), numeric strings converted with map(), and lists created from ranges.
What you can do after
Apply it via Python built-ins to test iterability and create or process containers without unnecessary indexing loops.

Read how Python How-To explains iterable →

Python Workout: 50 ten-minute exercises

An iterable is a Python object that can provide its elements sequentially to an iteration process.

How it is used
Deploys iterables as common inputs for for loops, comprehensions, built-in functions, argument unpacking, and generator expressions.
How deep it goes
Descends from everyday loops to __iter__, __next__, StopIteration, custom iterator classes, generators, and generator expressions.
Examples
Demonstrates lists, strings, dictionaries, files, range, comprehensions, argument unpacking, custom iterators, and hexadecimal conversion.
What you can do after
Build iterable classes, apply comprehensions and generator expressions, unpack iterable arguments, and distinguish iterable from non-iterable objects.

Read how Python Workout: 50 ten-minute exercises explains iterable →

Get Programming with JavaScript Next: New features of ECMAScript 2015, 2016, and beyond

An object or value that can be traversed element by element by the iteration protocol.

How it is used
Uses iterables to visit values with `for..of` and collect them with spread across built-in and custom objects.
How deep it goes
Explains `Symbol.iterator`, iterator creation, `next()`, `value`, and `done`, then shows a generator as a shorter implementation.
Examples
Uses prime-number iterators, string-character spread, and an exercise that takes ten values from an infinite iterable.
What you can do after
Build it from scratch with `Symbol.iterator` and `next()`, or use a generator; customize iteration and consume infinite iterables selectively.

Read how Get Programming with JavaScript Next: New features of ECMAScript 2015, 2016, and beyond explains iterable →

Practices of the Python Pro

How it is used
Uses iterables to discuss Python data traversal, memory efficiency, and helper functions such as max.
How deep it goes
Defines iteration, compares collection storage with generators, and explains yield behavior without developing protocol internals.
Examples
Uses for loops, range-like generators, squared-number generators, and maximum-frequency lookup over dictionary data.
What you can do after
Apply it via Python loops, generators, and iterable-aware functions while reducing unnecessary memory use.

Read how Practices of the Python Pro explains iterable →

The Joy of JavaScript

An iterable is an object or value that can be consumed by an iteration protocol to produce a sequence of elements.

How it is used
Supports uniform consumption of domain objects, custom collections, generated sequences, and streams through standard JavaScript syntax.
How deep it goes
Explains Symbol.iterator, next, value, done, generators, async iteration, and early termination, but defers complete protocol details.
Examples
Uses blockchain models, transaction blocks, random-number iterators, strings, generated blocks, and Validation branches.
What you can do after
Build it from scratch by implementing Symbol.iterator or a generator, then consume custom sequences with for...of, spread, or destructuring.

Read how The Joy of JavaScript explains iterable →

100 Java Mistakes and How to Avoid Them

Iterable is a Java interface whose objects can provide an Iterator for traversing their elements.

How it is used
Uses Iterable to expose traversal through enhanced-for loops and general collection utilities.
How deep it goes
Explains enhanced-for mechanics and iterator contracts, then demonstrates stateful and buffered implementations.
Examples
Demonstrates numeric ranges, Collections.min(), BufferedReader lines, and IntStream.range().iterator().
What you can do after
Builds contract-compliant custom iterators and diagnose implementations that depend on enhanced-for-only call patterns.

Read how 100 Java Mistakes and How to Avoid Them explains iterable →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.