GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Is there any reason for
BatList.n_cartesian_product  = assert false
I think [] is good (or at least invalid_arg) instead of assert false.
Thanks for your report. It is clear that assert false is wrong: assertion failures are to be used in cases that cannot happen, and in particular it should never, ever be sent back to the user. This is clearly a bug.
After a bit of mathematical thinking, I think the One Right Answer in this case is []. Would you care to provide a patch to change this behavior? BatList.n_cartesian_product currently has no tests at all. In your patch, could you write some unit tests verifying the behavior in the general case, for a list of singleton lists, for a list of a single list, and for the empty list?
I sended a pull request. (I'm a github beginner. I'm sorry for anything bad..)
Your contribution closes this bug. Thanks a lot, and I hope you'll find other bugs :-)