MPCS 51052 - Advanced Python Programming
Assignment details & dates are still tentative as the course is being developed. Details will be finalized before Week 1 of Spring 2026.
This course explores a wide variety of programming concepts using Python and its vast ecosystem as a foundation. The goal is to explore advanced programming & software design concepts using newer features of the Python language as well as third-party libraries. The course will make heavy use of open source libraries & Python’s own code to understand how Python is written and what constitutes good “Pythonic” design.
Topics will include:
Python as an evolving language. What’s new in Python? How and why does the language evolve & what has been added recently? What tools are Python developers using today?
Metaprogramming & “power-user” features. What are the parts of Python’s syntax & libraries that aren’t used every day that can lead to more expressive code? We’ll look at generators/coroutines, context managers, decorators, descriptors & other features typically not covered in earlier courses. How do they work internally? When do you use them?
Python & the web. Why is Python such a popular language for web development? We’ll use this as a jumping off point to discuss trade-offs in library design and work with libraries like Django, Flask, Starlette, FastAPI, etc.
Asynchronous programming in Python. What is the GIL? Why are there so many ways to do asynchronous work in Python & which are worth using? We’ll also explore some async web frameworks to see real-world usage.
Making Python faster. How write the most performant Python you can, and what to do when that still isn’t fast enough. We’ll touch on Python’s C API, PyPy and other alternate interpreters, and enhancing Python with Rust.
The course will have regular programming assignments as a well as a final project.
Course Goals
- Gain a deeper understanding of Python’s newer & more advanced features, with an eye towards language mastery.
- See how common real-world tasks like parallel & web programming push the limits of Python and the solutions that have arisen since.
- Explore the Python ecosystem to better understand library API design and real-world performance considerations.
- Gain experience building a full application in Python through the course project.
Quick Links
- Lecture Notes
- Course Policies - Academic Honesty, AI, Accessibility, Code of Conduct, and Diversity policies.
- Course Project
- Using uv
- Using pytest
- Getting Help
- CS Student Resource Guide
Office Hours
TBD
Schedule
Class will meet: TBD
There will be recommended readings & videos most weeks, and a programming assignment every week.
Schedule subject to change, major changes will be announced in class and on Ed Discussion.
| Week | Tues | Thurs | Due |
|---|---|---|---|
| 1. Evolving Python | Course Intro / How Python Evolves | Writing “Modern” Python in 2026 | M1 |
| 2. Solid Python | Typing | Testing in Practice | A2 |
| 3. Metaprogramming Python | Metaprogramming | Metaclasses | A1; A3 |
| 4. Practical Python | Evolution of Dataclasses | Coroutines | M2 |
| 5. Async Python | The Notorious G.I.L. | asyncio |
A5 |
| 6. Web Python | Web Frameworks | async web |
|
| 7. Faster Python | Profiling | Alternate Interpreters | M3 |
| 8. Extending Python | C API | Other Extensions | |
| 9. Future Python | GIL-free Python | __future__ |
A9, A10 |
| 10. Finals | - | - | M4; A4; A6; A7; A8 |
Assignments
There are ten assignments in this class, as well as a quarter-long project with a few milestones.
| Number | Name | Type | Due |
|---|---|---|---|
| A1 | PEP Report | Written | |
| A2 | New Syntax Practice | Problem Set | |
| A3 | Typing & Testing | Problem Set | |
| A4 | Metaprogramming | Original Work | |
| A5 | Coroutines | Problem Set | |
| A6 | Async | Original Work | |
| A7 | Web API | Original Work | |
| A8 | Extension | Original Work | |
| A9 | PEP | Written | |
| A10 | PyCon Report | Written |
Written
These assignments will involve doing outside reading and presenting to me & your peers on what you learn. This helps build your technical communication skills, and gives practice learning challenging technical content on your own.
Assignment 1: PEP Report
Your choice should either be a Finished PEP from a recent version (Python 3.11 or later), or in the Accepted or Open phase. The PEP should be about the language itself (no release note, tutorial, or governance PEPs).
You may not choose a PEP that someone else has already made a post about.
Read your chosen PEP and write an Ed post with the following sections:
- Summary: Summarize the core ideas of the PEP in your own words. Why is it interesting to you?
- Alternatives: What else is/was being considered?
- Example: Write a piece of example code that shows how the PEP would be used. This example must be original, not borrowing from the example in the PEP itself. Take time to understand what the PEP does and how code would be improved by adopting the new syntax/feature.
- Link to implementation: Your PEP most likely mentions a “bpo” number, an issue in the Python bug tracker. For example, PEP 674 mentions https://github.com/python/cpython/issues/89639. Using these link(s) (there may be a few), try to find the relevant Git PR/commits that implement the PEP. Provide a link to the implementation, or if you cannot find one, the relevant issues.
- Opinion: What is your opinion on this PEP? Would you vote to accept it or not?
Assignment 9: Drafting a PEP
For this assignment, you will be writing a PEP of your own.
Based on everything we’ve covered in class, and everything you know about Python from using it– what enhancement do you want to add? You might consider:
- Something that bugs you about the way Python works that you think can be fixed.
- A piece of syntax from another language you miss when using Python.
Write your PEP according to the guidelines in PEP 1, which includes templates for writing new PEPs as well as the expected sections.
We will discuss the PEPs created by the class as a group.
Assignment 10: PyCon Talk Review
Details on this assignment will be updated during the quarter.
Problem Sets
For problem sets you will be provided with an existing codebase with functions/methods to implement and fix.
These are designed to give practice with new concepts in the language to build & test your understanding of how to use these features.
Assignment 2: New Syntax Practice
Assignment 3: Typing & Testing
Assignment 5: Coroutines
Original Work
The remaining assignments will have you implementing short programs mostly independently. This is in part because these topics are related to the overal design of a program and thinking through where it would be appropriate to use these features.
For these assignments you will have options:
- You may write a short original program meeting given specifications. (Some suggestions will be provided.)
- You may decide that part of your quarter project requires the use of the relevant topic, and if so– that portion of your project can be used for the relevant assignment.
Do not attempt to force all of these into your project in an attempt to do “less work”.
This is a bad idea for a few reasons:
- Part of the assignment is correctly applying these new tools to a problem, and rarely will it make sense for all of these to be part of the same program.
- A suitable example program that demonstrates the concept will often be shorter and less complex than integration into your full project, especially if it isn’t a natural fit.
Assignment 4: Metaprogramming
Write a program that makes appropriate use of metaclasses, descriptors, and/or a custom-written class decorator.
Specifications TBD
Assignment 6: Async Tasks
Write a program that uses asynchronous Python to perform some task where the use of async results in improved performance.
Specifications TBD
Assignment 7: Web API
Write a non-trivial web API. This may be done using any suitable library, including:
- Raw WSGI/ASGI
- Flask
- Django
- FastAPI
- Starlette
Specifications TBD
Assignment 8: Extensions
Re-implement a critical piece of code as an external extension to Python. This may be done using any suitable language, recommendations are:
- Cython
- C
- Rust (using PyO3)
Specifications TBD
Course Project
Course project details TBD, will be shared in Week 1.
The course project consists of several milestones:
- M1: Proposal - To help you scope your project, we’ll meet to discuss your idea in Week 2.
- M2: Architecture Plan - Due in Week 4.
- M3: Prototype - Due in Week 8.
- M4: Final Product - Due in Week 10, instead of a final.
This project will require you to apply skills you learn in class, augmented with self-guided learning.
Grading
We’ll be using specifications grading. You will be given a set of specifications of what makes work Satisfactory, Not satisfactory, or Ungradable.
Some assignments will have additional criteria to qualify for an E._
Final Grade Calculation
| Component | Points |
|---|---|
| Programming Assignments | 10 |
| Project Milestones 1-3 | 3 |
| Project Final | 3 |
The ESNU grades are converted to points:
| Letter | Point Value | Description |
|---|---|---|
| E | 1.5 | Awarded for exceeding the base criteria on an assignment, only available on a few assignments. |
| S | 1 | Awarded for meeting base criteria for an assignment with minimal errors. |
| N | 0.5 | Work that fails to meet the established base criteria. |
| U | 0 | Work that is ungradable. |
And finally, those points are used to determine a letter grade.
Note: Obtaining an E will be challenging, the intention is that one would only choose to attempt the E criteria on a few assignments.
| Letter Grade | Required Points |
|---|---|
| A | TBD |
| A- | |
| B+ | |
| B | |
| B- | |
| C+ |
Academic Honesty violations, including unauthorized use of AI, will earn U on affected assignments and be ineligible for resubmission. Additionally, the highest grade you will be eligible to earn will be a B.
C- is the minimum grade to receive credit for this course.
If you feel that you are at risk of falling behind reach out to James proactively to discuss options.
Resubmission & Late Policy
TBD