[Python-3000] iostack and Oh Oh

tomer filiba tomerfiliba at gmail.com
Sat Dec 2 10:06:30 CET 2006


no, because i use the remote isinstance. the code i gave was just a
"how to". the real code would be more like:

def __isinstance__(self, types):
    return self.sync_request("isinstance", types)

and then
isinstance(conn.modules.sys.path, conn.modules.__builtin__.list) # True

(of course that's in RPyC notation. in RPyC you get access to the sevrer's
module namespace)


-tomer

On 12/2/06, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> tomer filiba wrote:
> > when a proxy is created for an object in another
> > process, you can only set __class__ to a *proxy* to the remote type...
> > so isinstance fails.
>
> But the class being passed to isinstance() can only be
> a proxy to the remote class as well, so as long as it's
> the same proxy that the overridden __class__ returns,
> it should work, shouldn't it?
>
> IOW,
>
>    in process A:
>
>          x.__class__ is X
>
>       so
>
>          isinstance(x, X) == True
>
>    in process B:
>
>          x_proxy.__class__ is X_proxy
>
>       so
>
>          isinstance(x_proxy, X_proxy) == True
>
> --
> Greg
>


More information about the Python-3000 mailing list