-
Notifications
You must be signed in to change notification settings - Fork 135
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
Wierd bug with flatten and partition #124
Comments
Thanks @cdoool for opening an issue! I agree that the behavior seems wrong. I did a little more debugging and I think this example shows that it is due to the sequence being consumed twice in Thanks for the bug report! In [36]: a, b = seq([[1, 2, 3], [4, 5, 6]]).flatten().partition(lambda x: x > 2)
In [37]: a
Out[37]: [3, 4, 5, 6]
In [38]: b
Out[38]: []
In [39]: a, b = seq([[1, 2, 3], [4, 5, 6]]).flatten().partition(lambda x: x > 2)
In [40]: b
Out[40]: [1, 2]
In [41]: a
Out[41]: [] |
@cdoool I believe I've fixed the issue on master. I included the example above in the tests, but it would be great if you can verify for your specific use case that it works that would be great. If everything looks good I can push out a minor release on PyPI |
Can confirm everything works fine now. Many thanks! |
Thanks, new version should be out on pypi now |
Hi! First of all, thanks for the great library. Thanks to it I no longer want to migrate back to Scala.
On a first day of using it, I encountered a strange bug:
val = seq([1,2,3,4,5,6]).partition(lambda x:x>2)
(val = [[3, 4, 5, 6], [1, 2]])
But
val = seq([[1,2,3],[4,5,6]]).flatten().partition(lambda x:x>2)
(val = [[3, 4, 5, 6], []])
Surely, it's a bug?
The text was updated successfully, but these errors were encountered: