• Guido van Rossum's avatar
    Allow assignments to instance.__dict__ and instance.__class__. The · b2173c31
    Guido van Rossum yazdı
    former lets you give an instance a set of new instance vars.  The
    latter lets you give it a new class.  Both are typechecked and
    disallowed in restricted mode.
    
    For classes, the check for read-only special attributes is tightened
    so that only assignments to __dict__, __bases__, __name__,
    __getattr__, __setattr__, and __delattr__ (these could be made to work
    as well, but I don't know if that's useful -- let's see first whether
    mucking with instances will help).
    b2173c31
classobject.c 33.7 KB