Python in Practice: OOP, Modules, Comprehensions & Testing
Trace real Python code for classes, inheritance, dunder methods, modules, comprehensions, exceptions, regex and pytest, and predict what it returns, with every answer checked as you go.
- One-time payment
- Instant access right after payment
- Secure checkout with Stripe
About this course
In this intermediate Python course you read real code for a fictional tea shop and predict exactly what it does. You trace classes and properties, follow super() through inheritance and the MRO, make objects sortable and list-like with dunder methods, and keep money exact in cents. You see how imports, packages and the module cache really behave, evaluate list, dict and set comprehensions, follow try, except, else and finally, parse text with regular expressions and think like pytest: parametrized boundary cases, fixtures and coverage. Every lesson is a hands-on lab with instant checks, and a capstone checkout and final exam lead to your certificate. First lesson free.
Lessons
- Classes & Objects: Model Products with __init__ and MethodsFree
- Class vs Instance Attributes: Shared Defaults and Shadowing Locked
- Properties: Validated Attributes with @property and Setters Locked
- Inheritance & super(): Extend Products without Copying Code Locked
- Polymorphism & MRO: One Call, Many Shipping Classes Locked
- Dunder Methods I: __repr__, __eq__, __lt__ and Sorting Objects Locked
- Dunder Methods II: Make a Cart Behave Like a List Locked
- Operator Overloading: A Money Class with +, * and Exact Cents Locked
- Dataclasses: Less Boilerplate, Ordering and __post_init__ Locked
- Modules: Import Once, Names, Bindings and reload() Locked
- Packages: __init__.py, Relative Imports and Import Cost Locked
- List Comprehensions: Map, Filter and Conditional Expressions Locked
- Dict & Set Comprehensions: Group, Deduplicate, Last-Wins Locked
- Built-ins with key=, Generators and next(): Idiomatic Searching Locked
- Exceptions: try, except, else, finally and Control Flow Locked
- Custom Exceptions: Hierarchies, raise and Handler Order Locked
- Regular Expressions I: Anchors, Classes and Quantifiers Locked
- Regular Expressions II: Groups, findall and Tuples Locked
- Testing with pytest: assert, parametrize and Boundary Cases Locked
- pytest Fixtures, Scopes and Coverage Locked
- Capstone: A Tested Checkout with Classes, Exceptions and Exact Cents Locked