Advanced Python
Length: 4 days
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.
Let’s talk about how to customize this course for your team! Set a meeting at https://savvycal.com/reuven/corp-training.
Audience
People with at least one year of Python experience, who want to take their Python skills to the next level. This is not a class for experienced developers who want to jump into Python quickly! It assumes that you’re already familiar with developing Python code, and writing both functions and classes.
The course includes a large number of exercises for hands-on practice, as well as live demos and the opportunity for questions.
Participants will receive the Jupyter notebooks into which I live-code during the class — including demos, exercises, and remarks.
Syllabus
• Data structures: How do core data structures work? Advanced data structures, including Decimal, 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.
• Functional programming: Comprehensions (list, set, dict). Nested comprehensions. Passing functions as arguments. Storing and retrieving functions in data structures. Dispatch tables. lambda.
• Modules and packages: Writing modules. Writing packages. Distribution packages. PyPI. pip and uv.
• Object-oriented programming: Classes. Instances. __new__ and __init__. Attributes. ICPO lookup. Inheritance and multiple inheritance. Magic methods. Class and static methods. Properties. Descriptors.
• Iterators and generators: The iterator protocol. Two ways to make classes iterable. Generator functions. Generator expressions. itertools.
• Decorators: What are they? Writing decorators. Storage in the outer functions. functools.wraps. Decorators that take arguments. Decorating classes.
• Concurrency: Threads. The GIL and free-threaded Python. concurrent.futures. Locking. map. Multiprocessing. Subinterpreters. asyncio.
•
