[issue23990] Callable builtin doesn't respect descriptors

Ionel Cristian Mărieș report at bugs.python.org
Sun Apr 19 21:05:24 CEST 2015


Ionel Cristian Mărieș added the comment:

On Sun, Apr 19, 2015 at 10:01 PM, Ethan Furman <report at bugs.python.org>
wrote:

> The "right thing", using a meta-class, is to have the meta-class check if
> the proxied object is callable, and if so, put in the __call__ function in
> the class that is being created.

​Yes indeed, for a plain proxy. Unfortunately for a *lazy* proxy this is
not acceptable as it ​would "create" (or "access") the target. The point is
to delay that till it's actually needed, not when the proxy is created.

Thanks,
-- Ionel Cristian Mărieș, http://blog.ionelmc.ro

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23990>
_______________________________________


More information about the Python-bugs-list mailing list