Naming class_getattr is an historical mistake since it takes an object, not a type, as first argument. Not having a primitive to execute a lookup directly on a type has become a problem in #2.
We should implement a mro_lookup primitive. Doing class_getattr could then be written as mro_lookup(type(x), "__method__"). This is both more expressive and more accurately named.
Naming
class_getattris an historical mistake since it takes an object, not a type, as first argument. Not having a primitive to execute a lookup directly on a type has become a problem in #2.We should implement a
mro_lookupprimitive. Doingclass_getattrcould then be written asmro_lookup(type(x), "__method__"). This is both more expressive and more accurately named.