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/2014-March/133730.html below:

[Python-Dev] Making proxy types easier to write and maintain

[Python-Dev] Making proxy types easier to write and maintain [Python-Dev] Making proxy types easier to write and maintainEric Snow ericsnowcurrently at gmail.com
Mon Mar 31 20:53:17 CEST 2014
On Wed, Mar 19, 2014 at 12:46 PM, Antoine Pitrou <solipsis at 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
More information about the Python-Dev mailing list

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