• Kevin Modzelewski's avatar
    Only defined locals go into the class dict · 8604ba34
    Kevin Modzelewski authored
    Before we would write all local names into the class dict;
    this is close, but was including undefined names.
    
    Have to get help from the IR generator to determine the live names,
    so add a LOCALS opcode (CPython has a similar one), and use that to
    generate the dict that a classdef returns.
    
    The current support is not quite enough to support the locals() function,
    since even though we have that information available at the IR generator,
    it's not easy to make it available to the runtime.
    8604ba34
class_scoping.py 2.03 KB