Samuele Pedroni wrote:
From: "Jim Fulton" email@example.com
For example, you can't proxy exceptions without breaking exception handling. In Zope, we rely on restricted execution to
certian kinds of introspection on exceptions and exception classes. In Zope,
also don't proxy None, because None is usually checked for identity. We also
proxy strings, and numbers.
That was a question I was asking myself about proxies: exception handling. But I never had the time to play with it to check.
Does that mean that restricted code can get unproxied instances of classic classes as caught exceptions?
Right. What we can (and will do) is intercept the exceptions and proxy the exception's instance data. So we'll be relying on restricted execution to protect the exception method meta data and on proxies to protect the exception data. Of course, we'd prefer to be able to proxy the the exception instances themselves.