]> granicus.if.org Git - python/commit
Allow assignments to instance.__dict__ and instance.__class__. The
authorGuido van Rossum <guido@python.org>
Mon, 25 Aug 1997 21:23:56 +0000 (21:23 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 25 Aug 1997 21:23:56 +0000 (21:23 +0000)
commitb2173c3146e945100ba53bfe6343d20ec3c9a333
tree8e69dd57a2a4bdf072e2b7747405f1cd83b851d2
parenta27d11221303d9cc6a2359b6de2cdaba6a2b1e97
Allow assignments to instance.__dict__ and instance.__class__.  The
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).
Objects/classobject.c