A RetroSearch Logo

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

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2014-March/133305.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 maintainAntoine Pitrou solipsis at pitrou.net
Wed Mar 19 21:23:13 CET 2014
On Wed, 19 Mar 2014 20:15:15 +0000
Paul Moore <p.f.moore at gmail.com> wrote:
> On 19 March 2014 18:46, 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?
> 
> Would that increase the size of type objects? Would that matter?
> (There's a similar question that came up in the thread about adding
> the @ operator over on python-ideas, which is what made me think of
> it...)

One additional slot is one additional pointer field, which is mostly
trivial in a type object.

Regards

Antoine.
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