liveBook · Manning

Iterable

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

How 8 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 process items in loops and create containers from existing data.
How deep it goes
Explains iterator creation, item retrieval, exhaustion, and practical iterability checks.
Examples
Uses task lists, ID-title mappings, string conversion, and an iterability test.
What you can do after
Apply it using Python’s iteration and container-construction tools to inspect and process existing data.

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 →

Secrets of the JavaScript Ninja, Third Edition

An iterable is an object that exposes an iteration protocol allowing its values to be traversed sequentially.

How it is used
Uses iterables to traverse values with for...of, destructuring, and spread, and as the return type of generator functions.
How deep it goes
Explains Symbol.iterator, next(), iterator results, custom iterables, lazy values, and generator behavior.
Examples
Uses array iteration, a custom random-number iterable, destructuring, spread, and an infinite generator.
What you can do after
Build it from scratch by implementing Symbol.iterator and next(), then consume values with JavaScript iteration syntax.

Read how Secrets of the JavaScript Ninja, Third Edition 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 →

Also covered in

What to know first

Related concepts

Questions about iterable

What is iterable?

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

Which Manning books explain iterable?

Python Workout, Second Edition, Python How-To, Python Workout: 50 ten-minute exercises, Get Programming with JavaScript Next: New features of ECMAScript 2015, 2016, and beyond, Secrets of the JavaScript Ninja, Third Edition, Practices of the Python Pro, The Joy of JavaScript and 100 Java Mistakes and How to Avoid Them.

What should I know before learning iterable?

Manning books that teach iterable usually introduce loop, Map, iterator and class first.

What kinds of iterable are there?

Kinds of iterable include generator.

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.