[Python-Dev] Read-only function attributes

Guido van Rossum guido@digicool.com
Tue, 30 Jan 2001 09:01:15 -0500


> I see that the function attribute feature specifically allows
> assignment to func_code and func_defaults, but no other special
> attributes.  This seems really suspect to me.  Why would we want
> to allow the reassignment of special attributes at all?

As Effbot said, this is useful in certain circumstances where a
development environment wants to implement a "better reload".  For
this same reason you can assign to a class's __bases__ and __dict__
and to an instance's __class__ and __dict__.

--Guido van Rossum (home page: http://www.python.org/~guido/)