Length: 4 days (32 hours)
Description: This course is aimed at people with at least one year of Python experience who want to go deeper into how Python works behind the scenes, while also learning advanced techniques that’ll make their programs more efficient and maintainable.
The course includes a discussion of Python’s data structures — both how the core data structures (string, list, tuple, and dict) are implemented, and how to use more advanced data structures (e.g., namedtuple and defaultdict).
This is the class that some of the world’s largest and best-known companies (e.g., Apple, Cisco, and Western Digital) invite me to teach to their experienced Python developers. The course includes a large number of hands-on exercises, along with live demos and ample opportunity for questions and discussion.
Like all of my courses, this is taught without slides. Instead, I live-code into a Jupyter notebook that is available in real time and which I distribute to participants at the end of the course.
This course, like all of my courses, can be given either in-person or virtually. Contact me for availability and pricing, but be warned that my time tends to fill up months in advance.
Data structures
- How do core data structures work?
- Advanced data structures in the Python standard library (namedtuple, defaultdict, and Counter)
- Paradigms for combining data structures
Functions
- Mapping arguments to parameters
- Function objects and bytecodes
- Scoping (LEGB)
- Inner functions and closures
- Type hints and “mypy”
Functional programming
- Comprehensions (list, dictionary, set)
- Nested comprehensions
- Passing functions as arguments to other functions
- Storing and retrieving functions in data structures
- lambda
Modules and packages
- Modules and namespaces
- Modules vs. packages
- Distribution packages and PyPI
Object-oriented programming
- Classes, instances, and attributes
- __new__ vs. __init__
- Attribute lookup with ICPO
- Instance and class attributes
- Magic methods and operator overloading
- Inheritance and multiple inheritance
- Class methods and static methods
- Properties
- Descriptors
Iterators and generators
- Python’s iteration protocol
- Creating iterators (and why)
- Generator functions
- Generator expressions
- itertools
Decorators
- What are decorators?
- Writing decorators with functions
- Storage across decorator invocations
- functools.wraps
- Decorators that take arguments
Concurrency in Python
- Using threads
- Python’s GIL
- futures and the ThreadPoolExecutor
- Multiprocessing and the ProcessPoolExecutor
- asyncio