Skip to content
UdemyPythonPaid courseIntermediate levelCertificate

Python 3: Deep Dive (Part 2 - Iterators, Generators) (Udemy.com)

Sequences, Iterables, Iterators, Generators, Context Managers

Created by: Dr. Fred Baptiste

Last updated December 2023

Our take

Based on the ratings of 3,134 students, a sample of their written reviews and the syllabus, as the course stood in December 2023. No course pays to be reviewed.

This is Part 2 of Dr. Fred Baptiste's Python Deep Dive series, and it is written for people who already code in Python, not for beginners. It runs about 36 hours across 142 lectures and 14 sections. The topics are sequences, iterables, iterators, generators, comprehensions, itertools and context managers, with a project after each main block. The description lists a long set of prerequisites, including closures, decorators and named tuples, and it clearly means them.

Reviewers are warm about the teaching. They praise how clearly he explains what is happening under the hood, the practical use cases that build idiomatic habits, and the small projects that make the ideas stick. One reviewer says they finally understood what the yield expression does. Complaints are thin. Only 15 of roughly 3,100 ratings are one or two stars, and the 4-star reviews in the sample are praise too, with no specific complaint. The cost is time: this is 36 hours of thorough material.

The weak spots come from the syllabus. The course was last updated in December 2023, and the final two sections on generators as coroutines are labeled deprecated, so that chunk of about six hours can be skipped. There are no quizzes or coding exercises, so the projects are the only practice. It is paid, and it has over 40,000 students. If you know Python well and want the why behind iteration, it is a strong pick. Brush up on the prerequisites first if they feel shaky.

Best forWorking Python developers who want to understand iterators, generators and context managers from the inside.
Skip it ifYou are still learning core Python or want quick recipes, not 36 hours of internals.

Pros

  • Explains how iterables, iterators and generators work internally, not just how to use them
  • Six end-of-section projects give real practice, which reviewers say helps the ideas stick
  • Covers context managers and itertools in depth, topics the description calls often overlooked
  • Rated 4.8 from over 3,100 reviews, with the large majority at five stars

Cons

  • Last updated in December 2023, which is a while ago for a Python course
  • The two coroutine sections, about six hours, are marked deprecated
  • Heavy prerequisites, and no quizzes or coding exercises to test yourself
Good, deep-dive into nuances of iterators, generators and context managers. Good explanations of how those features work. I also enjoy the various use cases he presents that help me start thinking in idiomatic python.
Jon, a student

Labeled intermediate, but the prerequisites (closures, decorators, named tuples) make it closer to advanced.

icon
What you will learn

  • You'll be able to leverage the concepts in this course to take your Python programming skills to the next level.
  • Sequence Types and the sequence protocol
  • Iterables and the iterable protocol
  • Iterators and the iterator protocol
  • List comprehensions and their relation to closures
  • Generator functions
  • Generator expressions
  • Context managers
  • Creating context managers using generator functions
  • Using Generators as Coroutines

Course content

14 sections · 142 lectures · 36 hours of video 2 articles

  1. 1Introduction 3 free previews4 lectures · 16 min
  2. 2Sequence Types 3 free previews25 lectures · 7.9 hours
  3. 3Project 1 1 free preview3 lectures · 1 hour
  4. 4Iterables and Iterators 1 free preview22 lectures · 4.9 hours
  5. 5Project 2 1 free preview3 lectures · 17 min
  6. 6Generators 1 free preview11 lectures · 2.2 hours
  7. 7Project 3 1 free preview3 lectures · 1 hour
  8. 8Iteration Tools 1 free preview20 lectures · 4.4 hours
  9. 9Project 4 1 free preview5 lectures · 2.5 hours
  10. 10Context Managers 1 free preview12 lectures · 3.6 hours

Who it is for

The instructor says it suits

  • Python developers who want a deeper understanding of sequences, iterables, iterators, generators and context managers.

What you need before you start

  • This is a relatively advanced course, so you should already be familiar with basic Python concepts, as well as some in-depth knowledge as described in the prerequisites in the course description. Please be sure you check those and make sure!
  • You will need Python 3.6 or above, and a development environment of your choice (command line, PyCharm, Jupyter, etc.)

icon
Quality Score

Content Quality
/
Video Quality
/
Qualified Instructor
/
Course Pace
/
Course Depth & Coverage
/

Overall Score : 96 / 100

icon
Course Description

Part 2 of this Python 3: Deep Dive series is an in-depth look at:

  • sequences

  • iterables

  • iterators

  • generators

  • comprehensions

  • context managers

I will show you exactly how iteration works in Python - from the sequence protocol, to the iterable and iterator protocols, and how we can write our own sequence and iterable data types.

We'll go into some detail to explain sequence slicing and how slicing relates to ranges.

We look at comprehensions in detail as well and I will show you how list comprehensions are actually closures and have their own scope, and the reason why subtle bugs sometimes creep in to list comprehensions that we might not expect.

We'll take a deep dive into the itertools module and look at all the functions available there and how useful (but overlooked!) they can be.

We also look at generator functions, their relation to iterators, and their comprehension counterparts (generator expressions).

Context managers, an often overlooked construct in Python, is covered in detail too. There we will learn how to create and leverage our own context managers and understand the relationship between context managers and generator functions.

Each section is followed by a project designed to put into practice what you learn throughout the course.

This course series is focused on the Python language and the standard library. There is an enormous amount of functionality and things to understand in just the standard CPython distribution, so I do not cover 3rd party libraries - this is a Python deep dive, not an exploration of the many highly useful 3rd party libraries that have grown around Python - those are often sufficiently large to warrant an entire course unto themselves! Indeed, many of them already do!


** Prerequisites **

Please note that this is a relatively advanced Python course, and a strong knowledge of some topics in Python is required. 

In particular you should already have an in-depth understanding of the following topics:

  • functions and function arguments

  • packing and unpacking iterables and how that is used with function arguments (i.e. using *)

  • closures

  • decorators

  • Boolean truth values and how any object has an associated truth value

  • named tuples

  • the zip, map, filter, sorted, reduce functions

  • lambdas

  • importing modules and packages


You should also have a basic knowledge of the following topics:

  • various data types (numeric, string, lists, tuples, dictionaries, sets, etc)

  • for loops, while loops, break, continue, the else clause

  • if statements

  • try...except...else...finally...

  • basic knowledge of how to create and use classes (methods, properties) - no need for advanced topics such as inheritance or meta classes

  • understand how certain special methods are used in classes (such as __init__, __eq__, __lt__, etc)


icon
Udemy Discount

The discount is applied through our link. Open the course from here and Udemy's current promotional price is applied at checkout on most courses, no code to type.

Some courses are excluded from Udemy's promotions. If the price does not drop, clear your browser cookies and use the button again.

icon
Instructor Details

Dr. Fred Baptiste

Hi,

My name is Fred Baptiste.


I am a professional software engineer with over 25 years of experience.


I started my career with a PhD in mathematics and over the years have worked with a large variety of programming languages and technologies, including Python, Go, .Net (C# and VB), Java, C++, and JavaScript to name a few, databases including relational SQL databases such as MS SQL Server, Postgres and Snowflake, as well as No-SQL databases such as Clickhouse, DynamoDB, MongoDB, Couchbase and Neo4j, message queues such as RabbitMQ, ElasticMQ/SQS, and a variety of other technologies such as Airflow, Flink, DBT, Docker, Git, and many more.


I have focused on Python based development for the last 10 years, mainly in REST API development, automation, and data engineering.


I have spent a lot of time and effort learning and gaining an in-depth understanding of Python and writing idiomatic Python, and I'd like to share that with you. I also actively maintain my YouTube channel (mathbyteacademy) which provides a lot of additional in-depth Python development videos.


I'm definitely a Python enthusiast for many reasons, and I'd like to share that passion with you too!

icon
More courses by Dr. Fred Baptiste

$22.99

$11.99

$17.99

icon
Reviews

4.8

3,134 ratings on Udemy

Select a bar to show only those reviews.Select the bar again to show every rating.

By Ravi Prasad on 12/27/2025

This is the best course on Udemy for learning Python in depth. Dr. Fred explains even the most intricate Python concepts with exceptional clarity and well-designed coding exercises. The lessons are so engaging that the concepts truly sink in, enabling learners to apply logic confidently and solve real-world programming challenges in their day-to-day work.

By P S on 10/10/2022

The second part is even better than the first thanks to the addition of several projects in which everything taught in the lectures and coding sessions can be applied. The projects are well-thought-out, challenging without being too hard, and accompanied by a detailed exposition of Fred's own approach, which will give you a chance to improve your own code and pick up good practices. Lectures and coding sessions have the same excellent quality as in the first part. Highly recommended.

By Steve Cross on 6/18/2022

Exactly what I was looking for -- a "Deep Dive" into Python. Helps to truly UNDERSTAND the Python way of doing things and has made me a much more productive and efficient Python programmer. Fred (the instructor) takes a very methodical approach to almost every element of the language and explains "what is really going on under the covers", so-to-speak. This really helps to understand which construct to use (or not!) in which circumstances.

By Anders Albert on 11/14/2020

Now passing more than 60 completed courses on Udemy, many of them on the topic of Python (web, machine learning, and so on)., this is without a doubt the best series on the Python programming language I have done. I really enjoy the depth the instructor goes into, along with his clear and easy to understand explanation. This is an extremely helpful step towards the mastery of the Python programming language. I am looking forward to part 3 and 4. My only request is that it would be nice if the last section was updated with asyncio.

By Bhavnish Mohla on 10/1/2020

Loved the structuring of the course as well as the entire series . This part is all about optimizing stuff. Before going through this course , i used to listify almost everything before performing operations on it. After understanding iterators and iterables i no longer feel a need for creating unnecessary variables for performing such operations. By the end of the course, i have a good understanding on lazy evaluation and how helpful it is. I am looking forward to a course on Parallelism and Concurrency by Fred.

By Joseph Arleo on 4/19/2020

If you strive learn as much as possible and understand how things work when learning new technologies then this series of Deep Dive courses by Fred Baptiste on Python is highly recommended. Fred covers topics you won't find in many other Python courses. What makes these courses even better is the exceptional skill the instructor has in teaching the material. Fred is a natural teacher and the type of "professor" I wish I had when studying computer science in college.

By William Brent Lander on 9/17/2019

This is series of classes is the most comprehensive, in-depth, dive into the details of python I have ever encountered, whether in classes, books, or other tutorials. For those who want to hone their skills to a fine point, I couldn’t recommend a more masterful class. It is well thought out, well presented, and amazing in depth. I thought I knew Python before, but having seen this “Dundee wonderland”, I realize how far I have to go. Well done!

By Berenice Del Portillo on 8/1/2019

Some complex explanations are not very clear to understand why is working that way and some simple explanations are very repetitive.

By Bob Stutes on 3/12/2019

Other courses are good at being general "How-To" courses. Fred's course is not just a series of "How-To" videos. Rather it is a comprehensive look at the python language and the python standard library. As a result you not only learn python language syntax, you learn what is happening "under the covers" when the code executes. This kind of information can be essential when trying to track down subtle bugs in your code. Knowledge is power!

By Gabor Sami on 2/12/2019

After completing this course I can say it's even better then Part 1(and I didn't think that would be possible). The projects added after each section were such a great addition(thank you for that). If you study the description before buying this course I don't really get it why would you rate it less than 5 stars. I hope you'll continue releasing courses, Mr Baptiste(other than Part 3, which I'm starting now).

Showing all 10 reviews on CourseDuck

Read all 3,134 reviews on Udemy