1. Home
  2. Computing & Technology
  3. Python
Python Blog

From Al Lukaszewski, Former About.com Guide to Python

Increased Use of Iterators in 3.0

Friday January 9, 2009
In addition to changes in print syntax and increased use of views, Python 3.0 also sees an increased underlying use of iterators. Many built-in functions that previously returned lists now return iterators.

An iterator is a simple generator that returns the next in a series of values. Where lists keep a static rota of values, iterators keep track of what the last value returned was and then return the next value in the series. This helps to keep resources used to a minimum, among other benefits.

For a list of the functions affected, see "From Lists and Tuples to Iterators", the latest in the series "Transitioning from 2.x to 3.0".
Explore Python
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Python

©2009 About.com, a part of The New York Times Company.

All rights reserved.