[Python-Dev] PEP 447 (type.__getdescriptor__)

Joao S. O. Bueno jsbueno at python.org.br
Thu Jul 23 15:52:54 CEST 2015

On 22 July 2015 at 14:21, Ronald Oussoren <ronaldoussoren at mac.com> wrote:
>> 2. Is this useful, that you can think of, for anything other than connecting to Objective C?
> Not immediately.  But then again, I initially thought that decorators would have limited appeal as well :-).  I guess this could be useful for other proxy-like objects as well, especially when preloading the __dict__ is relatively expensive.

I think one place this could be immediately useful is in code using
remote method invocation/remote attribute access. This allows one to
subclass proxy types for remote objects, and call methods that resolve
remotely in a seamless way.
(And without having to download and pre-populate an entire API into
the proxy-class __dict__)

I found the solution rather concise for the flexibility it adds as well.
> Apart from direct usefulness this closes a hole in the way you can influence attribute lookup.
> Ronald

More information about the Python-Dev mailing list