Build a Paginated Cursor
Iterator pattern
Challenge 3 of Make It PluggableIntermediate~55 minFree
Learn the Iterator pattern by building a lazy paginated cursor. You will write a custom iterator over a list, make it work in for-loops, walk a page-serving backend fetching pages only on demand, prove the laziness by counting fetches, and finish with a generator that paginates in a few lines of code.