-
Notifications
You must be signed in to change notification settings - Fork 357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
list assignment index out of range error in zip_array class extension method #35
Comments
Thanks for pointing this out. That code looks ugly. |
Thanks for jumping on it so quickly. Any idea when this would get merged into master? |
I don't have code that triggers the bug, so it's hard for me to know if really fixes the bug. If you could verify the fix, or post some minimal code that triggers the bug, then I can make a unit-test. When we know the fix is correct, then I can merge to master. |
Hi, @dbrattli
result
|
The code in |
@dbrattli, my understanding from reading the docs at http://reactivex.io/documentation/operators/zip.html is that zip_array is supposed to take a variable number of observables and zip them all. This is not pretty, but I think it shows the intended behavior:
|
Yes, but you can do that already with >>> import rx
>>> def res(*args):
... return list(args)
...
>>> s1 = rx.Observable.range(0, 5)
>>> s2 = s1.skip(1)
>>> s3 = s1.skip(2)
>>> rx.Observable.zip(s1, s2, s3, res).subscribe(print)
[0, 1, 2]
[1, 2, 3]
[2, 3, 4]
<rx.autodetachobserver.AutoDetachObserver object at 0x1025c1320> Isn't this the same? |
You're right. I should've read the description better instead of just looking at the diagram and thinking zip only works on 2 observables at a time. |
Thus removed a lot of duplicated code. Also renamed it to zip_list since we don’t have arrays in Python, but kept zip_array as an alias for now.
I've now added the simplified Observable.zip_array to the develop branch. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
The class extension method zip_array's action() method has this code:
n is set to len(queues) earlier in the method, so this throws index out of range error.
The text was updated successfully, but these errors were encountered: