liveBook · Manning

Iterator

An iterator is an object or abstraction that provides successive values from a sequence or data source through a traversal protocol.

How 15 Manning books explain it

Learn Rust in a Month of Lunches

An iterator is a Rust value implementing the Iterator trait that produces a sequence of items, typically through repeated calls to next.

How it is used
Uses iterators to process collections one item at a time and compose transformations through method chains.
How deep it goes
Explains next(), collection iteration choices, lazy consumption, and a custom Iterator implementation; defers broader method coverage.
Examples
Demonstrates repeated next() calls on characters, mapped vectors, a compiler warning for unused map(), and a custom source of ones.
What you can do after
Build it from scratch by implementing Item and next(), or apply iterator methods to transform and collect items.

Read how Learn Rust in a Month of Lunches explains iterator →

Python How-To

An iterator is an object that produces successive items through Python's iteration protocol.

How it is used
Powers item-by-item for-loop processing and CSV row reading without requiring explicit iterator construction.
How deep it goes
Walks through iter, next, exhaustion, and StopIteration, then demonstrates automatic for-loop handling; stops short of implementing a custom iterator.
Examples
Traces a three-item list iterator and consumes a CSV header before processing the remaining rows.
What you can do after
Apply it via Python's iter, next, and csv.reader to consume elements or rows one at a time.

Read how Python How-To explains iterator →

Python Workout: 50 ten-minute exercises

An iterator is an object that provides successive elements of an iterable, typically one element at a time.

How it is used
Uses iterators to make objects work naturally with for loops and to process collections or computed sequences incrementally.
How deep it goes
Explains protocol methods, stored iteration state, exhaustion, reusable helper iterators, and generator alternatives.
Examples
Demonstrates custom classes, repeated iteration, circular data, enumerate, generator expressions, and lazy file transformation.
What you can do after
Builds custom iterables, writes generators, chooses reusable iterator designs, and processes data with less memory.

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

100 Java Mistakes and How to Avoid Them

An iterator is an object that traverses the elements of a collection and can optionally remove elements through its iteration protocol.

How it is used
Guides safe traversal and removal in mutable Java collections and custom Iterable implementations.
How deep it goes
Explains iterator call contracts, fail-fast modification checks, and corrected range and reader implementations without detailing collection internals beyond modCount.
Examples
Uses a numeric range, buffered reader, conditional list filtering, and list mutation during enhanced for traversal.
What you can do after
Diagnose/debug with it by avoiding skipped elements, concurrent modifications, and custom iterators that fail outside enhanced for loops.

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

Go by Example

An iterator is an abstraction that lets a consumer retrieve values from a sequence one at a time through a standardized interface.

How it is used
Standardizes incremental consumption of multiple request results while hiding sequential or concurrent production.
How deep it goes
Explains custom push iterators through `iter.Seq`, yield control, production, consumption, and tests; defers deeper iterator history externally.
Examples
Builds `Results`, `SendN`, and `Summarize`, then tests fastest-result calculation and nil-iterator handling with `slices.Values`.
What you can do after
Apply it via Go `iter.Seq` to produce and consume request results incrementally with early stopping.

Read how Go by Example explains iterator →

Idiomatic Rust

An iterator is an abstraction that produces a sequence of values one element at a time according to a traversal protocol.

How it is used
Uses iterators to traverse data structures and express operations through a fluent interface.
How deep it goes
Works from the Iterator trait’s required Item and next() to a linked-list implementation and append example.
Examples
Demonstrates a linked-list iterator whose last() method locates the node used for append().
What you can do after
Build it from scratch by implementing Iterator for a linked list and using its provided methods.

Read how Idiomatic Rust explains iterator →

Python Workout, Second Edition

The iterator protocol is the Python protocol through which an object supplies successive values for iteration.

How it is used
Supports for loops, comprehensions, and functions that consume successive values from iterable objects.
How deep it goes
Defines __iter__, __next__, and StopIteration, then works through iterator state, helper classes, generators, and exhaustion behavior.
Examples
Uses strings, lists, dictionaries, files, a repeating Circle iterator, and a multi-file line generator as concrete cases.
What you can do after
Build iterable classes, helper iterators, generator functions, and generator expressions, then diagnose exhausted or non-iterable loop targets.

Read how Python Workout, Second Edition explains iterator →

The Joy of JavaScript

An iterator object is an object that implements the iterator protocol by providing a next method that produces iteration results.

How it is used
Enables objects and generated sequences to control how values are delivered to JavaScript consumers.
How deep it goes
Defines the `next()` result contract, explains malformed results, and demonstrates custom implementations.
Examples
Uses random-number sequences, blockchain blocks and transactions, and strings as iteration examples.
What you can do after
Build it from scratch by implementing `next()` results, then enable `for...of` with `Symbol.iterator`.

Read how The Joy of JavaScript explains iterator →

Secrets of the JavaScript Ninja, Second Edition

An object that produces a sequence of values one at a time through an iteration protocol, typically using a next method.

How it is used
Uses iterators to request values from generators and to consume generated sequences with for...of.
How deep it goes
Traces next() through yield, suspension, and value/done results, without generalizing beyond generator-created iterators.
Examples
Demonstrates weapon sequences, generated IDs, and generator-based traversal of a DOM tree.
What you can do after
Apply generator iterators with next() or for-of to request sequence values and traverse DOM nodes.

Read how Secrets of the JavaScript Ninja, Second Edition explains iterator →

Software Design for Python Programmers

An iterator is an object or interface that provides sequential access to elements of a collection without exposing the collection's implementation.

How it is used
Separates one algorithm from multiple sequential collection representations through delegated traversal.
How deep it goes
Defines iterator responsibilities, concrete implementations, client delegation, and extensibility, while stopping short of broader iterator internals.
Examples
Uses baseball-team player reports backed by a list, generator, and dictionary, with ListIterator, GeneratorIterator, and DictionaryIterator.
What you can do after
Build it from scratch by defining an iterator interface, pairing implementations with collections, and delegating traversal to the client.

Read how Software Design for Python Programmers explains iterator →

Object-Oriented Software Design in C++

An iterator is an abstraction that provides sequential access to elements of a data structure without exposing its representation.

How it is used
Separates one processing algorithm from multiple sequential collection representations.
How deep it goes
Explains interfaces, cursors, delegation, and traversal code, while stopping short of a broader implementation treatment.
Examples
Uses baseball team reports over array-, vector-, and map-based Player collections.
What you can do after
Build it from scratch by defining iterator operations, storing traversal state, and delegating collection-specific iteration.

Read how Object-Oriented Software Design in C++ explains iterator →

The Quick Python Book, Fourth Edition

An iterator is an object that provides successive values through the iteration protocol until its values are exhausted.

How it is used
Supplies values to loops and consumers such as CSV writers, including file lines and paired data.
How deep it goes
Defines successive values until exhaustion and demonstrates file and zip() iteration without detailing protocol mechanics.
Examples
Demonstrates counting file lines and writing paired weather dates and temperatures to CSV.
What you can do after
Apply it via for loops and csv.writerows() to process file lines or paired lists.

Read how The Quick Python Book, Fourth Edition explains iterator →

100 C++ Mistakes and How to Avoid Them

An iterator is a C++ library object that provides a uniform means of traversing and accessing elements in a range or container.

How it is used
Uses iterators to search containers and traverse elements without imposing an index-based interface.
How deep it goes
Explains declaration, increment, dereference, end comparison, and container variation, but does not develop iterator internals.
Examples
Demonstrates key lookup with std::find and summation through vector and set iterators.
What you can do after
Apply it via STL algorithms and container loops to search or process elements while avoiding array-size bookkeeping.

Read how 100 C++ Mistakes and How to Avoid Them explains iterator →

The Well-Grounded Rubyist, Fourth Edition

An iterator is a method or construct that automatically traverses the elements of a collection.

How it is used
Uses methods that yield to supplied blocks to repeat work or process collection values.
How deep it goes
Explains block-and-yield mechanics and contrasts iterators with stateful enumerators, without detailing every iterator's implementation.
Examples
Uses loop with puts and String#each_byte to demonstrate block-based iteration and blockless calls.
What you can do after
Apply iterators by supplying a block, or call many built-in iterators without one to obtain an enumerator.

Read how The Well-Grounded Rubyist, Fourth Edition explains iterator →

Functional Programming in JavaScript

How it is used
Supports lazy traversal when callers need values incrementally or may stop before exhausting a data source.
How deep it goes
Explains internal iterator state, protocol methods, generator suspension, and for...of consumption.
Examples
Uses infinite ranges, bounded ranges, square generation, string iteration, and recursive tree traversal.
What you can do after
Build it from scratch with Symbol.iterator and next, or consume generators through for...of.

Read how Functional Programming in JavaScript explains iterator →

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.