lists vs. tuples in `itertools.product`
The CPython implementation of itertools.product() from the Python Standard Library returns an iterator of tuples, whereas the codon version returns lists. Is this on purpose? I think it would be best if methods and functions in codon behave as in Python unless a deviation makes sense.
Hi @ypfmde, this is because tuple lengths in Codon need to be known at compile-time. So, the repeat argument complicates this because it means the generated tuples will have lengths that might not be known until runtime. In fact, without repeat, we do produce tuples just like Python.
One thing we can easily do is check if repeat is a constant integer and provide an overload that produces tuples. This would probably be the most common usage anyway.