Python Morsels Courses

Generators & iterators in Python

Embracing lazy looping can increase the efficiency and readability of your looping and iterable-oriented code.

Whether you're looping over files, database rows, or other large iterables, understanding generators and iterators can improve your code's readability and performance.

Object-oriented programming with classes in Python

Functions and modules great, but they're not the only ways to modularize your Python code.

Python's classes are both complex and powerful. When would you use a class in Python and how do they work? And even more importantly, when shouldn't you use a class?

First-class functions & decorators in Python

Python's decorators rely on the ability to pass functions to other functions and define functions within another function.

When should you use decorators, how can you make your own decorators, and what should you watch out for when using and making decorators?