A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2003-March/033929.html below:

[Python-Dev] Capabilities

[Python-Dev] CapabilitiesJim Fulton jim@zope.com
Mon, 10 Mar 2003 12:10:29 -0500
Samuele Pedroni wrote:
> From: "Ka-Ping Yee" <ping@zesty.ca>
> 
>>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.
> 
> 
> Indeed, that's the fact that implementations of methods are normal functions
> that access the instance attributes like everything else do,
> that's why Zope-proxies become necessary (and a bit brittle):
> 
> class A:
>  def geta(self):
>     return self.a # 1
> 
> a=A()
> 
> a.a # 2
> 
> (1) and (2) are using the same operation/execution path.

This points out a nice feature of zope proxies.  The proxied
object's methods are called with an unproxied self, so you can
easily allow access to the object's methods without providing access
to other attributes. Or, equivalently, you can provide access to
one set of methods and those methods can use other methods that
you don't provide access to.

Could you explain why you say that zope proxies are brittle?

Jim

-- 
Jim Fulton           mailto:jim@zope.com       Python Powered!
CTO                  (888) 344-4332            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4