Jump to ratings and reviews
Rate this book

Guide to: Learning Iteration and Generators in Python

Rate this book
Do you want to take your Python to the next level?Python is easy to learn. You can learn the basics in a day and beproductive with it. But there are more advanced constructs that youwill eventually run across if you spend enough time with it. Don't be confused by these. Learn them, embrace them, and improve your code and others. Iteration and GeneratorsUnderstanding 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.The guide ProtocolIteratorsIterablesClass IterationThe yield statementGeneratorsFunction GeneratorsClass GeneratorsWrite Python code like the mastersThese constructs, while not necessary per se, allow you to be more succinct,re-use code, and think about code in a different way. You will the constructs workWhen to use themReal life examples from the standard libraryUnderstand other's codeThis book covers many of these intermediate constructs that are available in Python. The book covers both Python 2 and 3. Topics them with classesReal world examples of their useBased on popular tutorials and sessions I have taught material similar to these constructs at popular tutorials at conferences such as PyCon, OSCON and Strata (and otherconferences). This book is based on my experience teaching and usingPython for many years. I hope you learn something while in the courseof your reading. Maybe it will help you in your next task, codereview, or job interview. Up Your Advanced Python SkillsIt is assumed that the reader has some knowledge of Python. You will walk away knowing the the in's and out's of iteration and generators, when to use them, and how to use them.

76 pages, Kindle Edition

First published March 12, 2012

2 people are currently reading
15 people want to read

About the author

Matt Harrison

42 books24 followers

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
6 (37%)
4 stars
6 (37%)
3 stars
4 (25%)
2 stars
0 (0%)
1 star
0 (0%)
No one has reviewed this book yet.

Can't find what you're looking for?

Get help and learn more about the design.