• Kevin Modzelewski's avatar
    Support setting __dict__ · 8b94bbc4
    Kevin Modzelewski authored
    It's trickier than just setting all of the attributes, since any updates
    to either the original dict or to the object's attributes will get
    mirrored in the other object.  I don't know if anyone uses this,
    but I don't think there's any good way for us to tell if this is
    going to happen so we just have to be conservative.
    
    So, add a new distinction between "types" of hidden classes, and add
    a new "dict backed" type.  Instead of having an array of attributes,
    has a single attribute which is a dict.
    
    There are some pretty tricky corner cases that we don't support yet,
    such as if you access and save __dict__, then set __dict__, and then
    try to access the saved version.  At least we can detect that and fail.
    8b94bbc4
types.h 21.7 KB