Re: Trouble with getitem

Irmen de Jong <[email protected]> Sat, 19 Jul 2014 11:26:08 +0200
Newsgroups gmane.comp.python.pyro
Message-ID <[email protected]>
On 18-7-2014 17:57, Justin M Wozniak wrote:
> Hi
>     I'm having trouble with Pyro and the getitem syntax.  I am basically trying to use
> __getitem__ on the proxy.  A stand-alone test is attached.
> 
> In short, the server class has:
>     def __getitem__(self, key):
>         message("__getitem__")
>         return self.getitem(key)
> 
> and the client has:
>     proxy = Pyro4.Proxy(uri)
>     value3 = proxy[key3]
> 
> which results in:
> TypeError: 'Proxy' object has no attribute '__getitem__'
> 
> If anyone can help me get this working it would be greatly appreciated.

__getitem__ isn't proxied at the moment (this may change in a future version).
Just invoke the getitem() method that you already seem to have, directly.

Irmen


------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds