[Python-3000] iostack and Oh Oh
jimjjewett at gmail.com
Fri Dec 1 19:45:57 CET 2006
On 12/1/06, tomer filiba <tomerfiliba at gmail.com> wrote:
> i would still like to understand how object proxying (e.g., weakrefs, RPyC),
> could work when all/most frameworks/libraries would be based on ABCs.
> again, the problem is, your proxy is an instance of ProxyType, that
> refers to another, "concrete" object (e.g., getattr on the proxy performs a
> getattr on the concrete object). but this only works with duck typing.
> the concrete object may implement certain interfaces that ProxyType
> does not/cannot implement (a la 3rd party). so despite the fact that the
> proxy object *behaves* just like the concrete object, they are of different
> types and ABCs. checking if the proxy implements an interface may
> fail, although the proxy is sufficient for whatever purposes you wished
> to use it.
Why? Why can't your proxy be a derived class that claims to inherit
from those same base classes, but just happens to override all the
methods (and attributes). If the problem is that an ABC is checked by
identity rather than name, and it isn't available to the proxy, then
how is it available to the checker?
More information about the Python-3000