[Twisted-Python] waiting on any deferred in a list?

2016-04-24 Thread Benjamin Rutt
Hi all, I've been using a pattern for quite some time to collect a bunch o' deferreds in a list and then yield on them one at a time. Here is some untested pseudocode: --- @defer.inlineCallbacks def foo( ls ): defs = [] # get all the deferreds going for item in ls: d = some_

Re: [Twisted-Python] waiting on any deferred in a list?

2016-04-24 Thread meejah
I think you'll want an idiom kind of like this (also untested ;): @inlineCallbacks def foo(ls): defs = [] def process_an_item(result, item): print("Item '{}' done: {}".format(item, result)) for item in ls: d = something_async(item)

[Twisted-Python] IPv6 comparison handling

2016-04-24 Thread Maciej Wasilak
Hello, In my UDP Twisted based library there is a problem with IPv6 addresses representation. Addresses are compared as simple strings, and it sometimes causes mismatches: "fe80:::bbff:fecc:" should be equal to "fe80:::::bbff:fecc:" I've noticed that Python 3 has nice

Re: [Twisted-Python] IPv6 comparison handling

2016-04-24 Thread Glyph
> On Apr 24, 2016, at 12:21 PM, Maciej Wasilak wrote: > > Hello, > > In my UDP Twisted based library there is a problem with IPv6 addresses > representation. Addresses are compared as simple strings, and it > sometimes causes mismatches: > > "fe80:::bbff:fecc:" should be equal to > "fe