Definitions for colloquial Python terminology (effectively an unofficial version of the Python glossary).
Table of contents
Looping
These terms are all about looping and objects you can loop over.
- Iteration
Looping over an iterable object.
A
for
loop is the epitome of iteration, but there are many other ways to iterate over an iterable in Python.List comprehensions iterate. Tuple unpacking iterates. Using
*
operator in a function call iterates (see Unpacking iterables into function arguments). Using*
operator in a list literal iterates (see Unpacking iterables into iterables).- Iterable
(Our perspective as Python users) Anything you can loop over with a
for
loop or by various other forms of iteration. More on iterables in What is an iterable.(Python's perspective) Anything that can be passed to the built-in
iter
function to get an iterator from it. If you're inventing your own iterable class, also see How to make an iterable.
Data Types
These terms are related to …