[Python-Dev] Capabilities
Ka-Ping Yee
ping@zesty.ca
Mon, 10 Mar 2003 05:14:24 -0600 (CST)
On Sun, 9 Mar 2003, Guido van Rossum wrote:
> - Which attributes are considered introspective?
Here's a preliminary description of the boundary between "introspective"
and "restricted", off the top of my head:
1. The only thing you can do with a bound method is to call it
(bound methods have no attributes except __doc__).
2. The following instance attributes are off limits:
__class__, __dict__, __module__.
That might be a reasonable start.
However, there is still the problem that the established technique
for storing instance-specific state in Python is to use globally-
accessible data attributes instead of a limited scope. We would
also need to add a safe (private) place for instances to put state.
-- ?!ng