Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Credit: Christopher Prinos
You want to fetch a result set from a database (using the Python DB API) and easily iterate over each record in the result set. However, you don't want to use the DB cursor's method fetchall: it could consume a lot of memory and would force you to wait until the whole result set comes back before you can start iterating.