Week 1: Generators are Magical

May 21, 2025 · Sussex County, NJ

Week 1 has been a success! I’ve really enjoyed how Practical Python Programming is structured. We’re building a data processing pipeline that reads in stock data from CSV files. Starting with a simple solution, we’ve refactored, added more modules, and it’s looking more professional with each section. David Beazley is an excellent teacher; the Instructor Notes provides helpful guidance on what to focus on and what to safely skim.

A recap of this week:

Working with Data Solid intro to core Python data structures, list comprehensions, and formatting output. Got a taste of the Python object model and the collections module. Also covered iteration helpers like enumerate() and zip().

Program Organization Covered functions and modules. Some new-to-me things around:

Classes and Objects OOP finally clicked as we refactored dictionaries into a Stock class. A Eureka moment for a concept I never quite got before. We added attributes and methods, and explored special methods like __repr__ and __len__.

Generators Functions that feel magical. The idea of using yield to lazily produce values is neat! A caution that generators can only be used once. Chaining different generators to create a processing pipeline was a great example.

Goals for Week 2: Complete the remaining sections of Practical Python Programming and start working on Python programs. Begin the next book.

I’m having fun. Things are clicking. I’m solving problem sets, squashing bugs, and running into new errors. It’s going to be a summer of Python and I’m excited for it!


2025-05-21 19:06