Guide to: Learning Iteration and Generators in Python

Introducing Guide to: Learning Iteration and Generators in Python

Guide to: Learning Iteration and Generators in Python is a complete guide to understanding more advanced features of Python. Understanding iteration enables understanding generators and easily creating objects that can iterate. This guide will explain the theory behind iteration in Python and teach best practices for generator creation and use. Do not beware the yield, rather embrace the power it provides.

Learn Iteration

Iteration is a common pattern in programming and especially in Python. This guide will teach you how iteration works and how to take full advantage of it. You will learn:

  • The Iterator Protocol
  • How sequences iterate
  • About creating objects that iterate
  • The difference between iterables and iterators
  • Gotchas with iterators

Learn Generators

Generators are a simple way to embed an iterator within a function. They enable simpler code, and more efficiency. Though they are not without their weaknesses. You will learn:

  • How to write a function generator
  • How to write objects that generate
  • When to use generators
  • When to use lists
  • Slicing iterables
  • The truth about xrange
  • More …

Buy Now at Amazon!

Guide to: Learning Iteration and Generators in Python The book is available on Amazon and soon on other platforms. Join the hundreds of others who have learned these tips from the author through conference tutorials and sessions now presented in book form.

You’ll learn the best practices without wasting time searching or picking up advice here and there. I’ve collected all the gems I’ve gleaned over years of writing and teaching Python for you.

A No Nonsense Guide to Generators and Iteration in Python

Python is a programming language that lets you work more quickly and integrate your systems more effectively. You can learn to use Python and see almost immediate gains in productivity and lower maintenance costs.

Python Language Website

About the Book

Guide to: Learning Iteration and Generators in Python distills years of experience coding and teaching Python and presents it in a easily digestable form. It is full of examples to illustrate the skills needed to read and write decorators in Python. Also {“included are callouts to indicate common gotchas as well as best practices”}. Those looking to understand how generators and iteration work in Python will be able to come up to speed much faster with this book than working on their own.

Guide to: Learning Iteration and Generators in Python is the book I wanted when I was learning generators in Python. I have taught Python to hundreds over the years at conferences, and user groups, and I’m combining the most pertinent and useful information for you.

Buy Now at Amazon!

About the Author

Matt Harrison has over 10 years Python experience across the domains of search, build management and testing, business intelligence and storage.

He has presented and taught tutorials at conferences such as SCALE, PyCON and OSCON as well as local user groups. In addition he has been a private tutor teaching programming to teenagers as well as retired folk. The structure of this book is based off of his first hand experience teaching Python to many individuals.

Matt occasionally tweets useful Python related information at __mharrison__ and Matt blogs at