Tagged articles
Iterable
12 articles · Page 1 of 1
The article explains how the Iterator pattern, built into Java as Iterable and Iterator interfaces, lets you traverse any collection uniformly without exposing its internal structure, demonstrates the fail‑fast mechanism, and shows when custom collections should implement Iterable.
Design PatternIterableJava
0 likes · 13 min read

The article explains Python's for‑in loop syntax, describes common iterable types such as strings, lists, tuples and sets, details how the range function defines start and end values, and provides concrete code examples that print numbers, list elements and characters from both English and Chinese strings.
IterableListString
0 likes · 3 min read

This article explains Python iterables, covering their basic concepts, how to create and use them with loops, iter() and next(), built‑in functions that accept iterables, comprehension techniques, advanced operations like zip, enumerate, filter, map, and their relationship with generators for efficient data processing.
ComprehensionsIterablePython
0 likes · 7 min read

This article demystifies Python’s for-loop by explaining how iterable objects and iterators work under the hood, illustrating the iterator protocol with code examples, and providing practical custom iterator implementations, common pitfalls, and tips for efficient data processing.
IterablePythondata processing
0 likes · 9 min read

This article explains Python iterators, iterables, and generators, detailing their definitions, core methods, advantages, disadvantages, and practical code examples—including iterator objects, generator creation via comprehensions and the yield keyword, decorator integration, and mutable data handling—providing a comprehensive guide for developers.
DecoratorIterablePython
0 likes · 14 min read

This article explains Python's iteration protocol, detailing how iterable objects and iterators work, and provides multiple code examples—including custom iterables, generators, and iterator-based test data handling—to demonstrate their use in building flexible and memory‑efficient applications.
Iterablegeneratoriteration-protocol
0 likes · 11 min read

This article explains Python's iterator protocol by showing how objects become iterable through __iter__, how the built‑in iter function creates iterator objects, the CPython internals of PyObject_GetIter, and how the __next__ method advances elements, with concrete code examples and source‑level snippets.
CPythonIterablePython
0 likes · 16 min read

This article explains Python's for loop in depth, covering basic syntax, the optional else clause, the concepts of iterables and iterators, how to implement custom iterators and iterable objects, the loop's execution flow, an equivalent while‑loop implementation, and a step‑by‑step disassembly of the generated bytecode.
Iterablebytecodedisassembly
0 likes · 12 min read

This article explains the concepts and differences between Python iterables, iterators, and generators, shows how to create custom iterable and iterator classes, demonstrates the use of __iter__ and __next__ magic methods, and provides practical generator examples for efficient lazy evaluation.
Iterablefundamentalsgenerator
0 likes · 8 min read

This article explains how Python determines whether an object is iterable by using the built‑in iter function, detailing the roles of __iter__, __getitem__, iterator protocols, and showing concise implementations with generators and generator expressions.
IterablePythongenerator
0 likes · 7 min read

This article explains how Python's built‑in sorted() function sorts any iterable and returns a new list, contrasts it with the in‑place list.sort() method, and demonstrates usage of key functions, reverse ordering, and multi‑dimensional sorting with code examples.
Iterablekey functionlist.sort
0 likes · 5 min read

This article explains why Python sequences are iterable by detailing how the built‑in iter function, __iter__ and __getitem__ methods work, and shows multiple implementations—including classic iterator classes, generator functions, and generator expressions—to create custom iterable objects.
Iterablefundamentalsgenerator
0 likes · 7 min read
