[zeromq-dev] czmq python binding Zpoller
Arnaud Loonstra
arnaud at sphaero.org
Wed Nov 4 21:58:30 CET 2015
Indeed, it was fixed last night. Did you test that?
Rg,
Arnaud
On November 4, 2015 9:53:42 PM GMT+01:00, Johan Philips <johan.philips at kuleuven.be> wrote:
>
>
>On 2015-11-04 20:38, Arnaud Loonstra wrote:
>> On 2015-11-03 22:55, Johan Philips wrote:
>>> On 2015-11-03 19:31, Arnaud Loonstra wrote:
>>>> I think you are right. Have you tried removing index().
>>>
>>> Yes and that silences the error but how can I add 2 sockets to the
>>> poller? Is the only way by using the 'add' method?
>>>
>>> In zpoller (the C version) you could stack them in the constructor.
>>> i.e.
>>> zpoller_new(socket1, socket2, NULL)
>>>
>>> In python this results in:
>>>
>>> Traceback (most recent call last):
>>> File "zyre_test.py", line 12, in <module>
>>> poller = Zpoller(n1,n2,None)
>>> File "/home/jphilips/workspace/czmq/bindings/python/czmq.py",
>line
>>> 1781, in __init__
>>> assert(len(args) == 2)
>>> AssertionError
>>> Exception AttributeError: "'Zpoller' object has no attribute
>>> 'allow_destruct'" in <bound method Zpoller.__del__ of <czmq.Zpoller
>>> object at 0x7f53f7a6d590>> ignored
>>
>> Ah I understand it now. You get an assertion error in the constructor
>> before the
>> allow_destruct bool can be set. So in the destructor you get another
>> error because the
>> allow_destruct isn't set. So the first error is a bug, the second can
>> be blamed on python
>> allowing dynamic types. We could prevent it by assigning
>allow_destruct
>> earlier but it
>> shouldn't be a problem. I think it is fixed here
>> https://github.com/zeromq/zproject/pull/271
>
>I've pulled that code before but the assertion of 2 arguments is, in my
>
>opinion, a "bug" because we want the constructor to be variadic, right?
>
>>
>> The binding for czmq is updated as well. Just pull from the latest
>> master.
>>
>> Rg,
>>
>> Arnaud
>> _______________________________________________
>> zeromq-dev mailing list
>> zeromq-dev at lists.zeromq.org
>> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>>
>_______________________________________________
>zeromq-dev mailing list
>zeromq-dev at lists.zeromq.org
>http://lists.zeromq.org/mailman/listinfo/zeromq-dev
Send from my feature bloated phone.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20151104/91b323b7/attachment.htm>
More information about the zeromq-dev
mailing list