Pyro5 icon indicating copy to clipboard operation
Pyro5 copied to clipboard

Let properties be generators too

Open mawildoer opened this issue 2 years ago • 1 comments

I'm sure there's a better way to achieve this - but this tweak means properties can be generators too.

I did note that in the case you tried to call it as a method still, the error kinda sucked, but I think it's okay:

Pyro traceback:
Traceback (most recent call last):
  File "<ipython-input-34-268747a29aa7>", line 3, in <module>
    for results in dummy.thingos():
                   ^^^^^^^^^^^^^^^
TypeError: '_StreamResultIterator' object is not callable

This function's also pretty enormous, so perhaps there's a good place to pull this section of repeated code out to?

mawildoer avatar Jan 31 '24 03:01 mawildoer

Could you perhaps also add a unit test for this? I think TestServerOnce in test_server.py contains tests that check iteration and such

irmen avatar Feb 04 '24 15:02 irmen