~jasper/type_stack_calc

ref: 6aca66fb1a7cf1e10f7dd3263f04537c8ff37590 type_stack_calc/type_stack_calc/util/scopify.py -rw-r--r-- 262 bytes
6aca66fb — Jasper den Ouden Apparently `to_c` can already read ahead one, hopefully its this simple... 1 year, 1 month ago
                                                                                
1
2
3
4
5
6
7
8
9
10
from type_stack_calc.ib.scope import Scope

def scopify(variables):
    if isinstance(variables, dict):
        vs = Scope(None, may_set=True)
        for k, v in list(variables.items()):
            vs.get_comp(k).set(v)
        return vs
    return variables