rust-itertools / itertools

Extra iterator adaptors, iterator methods, free functions, and macros.
https://docs.rs/itertools/
Apache License 2.0
2.62k stars 298 forks source link

product with repeat #958

Open adamnemecek opened 3 weeks ago

adamnemecek commented 3 weeks ago

Hello, product in Python itertools can take an option repeat. It might be a good idea to add an implementation of this to itertools as well. This one seems good https://stackoverflow.com/questions/44139493/in-rust-what-is-the-proper-way-to-replicate-pythons-repeat-parameter-in-iter

Philippe-Cholet commented 3 weeks ago

If it's about the iproduct! macro, there is #264 which is a bit abondonned at the moment and if that's without macro there is itertools::repeat_n(it, repeat).multi_cartesian_product().