On Wed, Mar 19, 2014 at 12:46 PM, Antoine Pitrou <solip...@pitrou.net> wrote:
> In http://bugs.python.org/issue19359#msg213530 I proposed to introduce a 
> "proxy
> protocol" (__proxy__ / tp_proxy) that would be used as a fallback by
> _PyObject_LookupSpecial to fetch the lookup target, i.e.:
>
> def _PyObject_LookupSpecial(obj, name):
>     tp = type(obj)
>     try:
>         return getattr(tp, name)
>     except AttributeError:
>         return getattr(tp.tp_proxy(), name)
>
> What do you think?

Regardless of the attr lookup in the interpreter, it would be nice to
have a standardized explicit __proxied__ attribute on proxy objects
(similar to __wrapped__).

-eric
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to