(Delayed response from me; I took a few days off after the paper).
This is a really useful simplification, thanks for getting those tests together. Since it does seem like super() can be done in terms of locals(), I wonder what the smallest set of "context" we need to store at the top of functions in desugaring is. Right now, it seems like just:
- $self and $class
- locals()
One useful question to ask is which dynamic features exist that would make us extend this set of information in the context? Just describing what information each function needs to keep track of is useful. I wonder if there's a simple listing in a C struct in the CPython implementation somewhere, and if we're reverse-engineering that?