rust-itertools / itertools

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

Implement `DoubleEndedIterator` for `Powerset` #905

Closed TennyZhuang closed 6 months ago

Philippe-Cholet commented 6 months ago

Duplicate of #620 which contains arguments on why it's not implemented.

TennyZhuang commented 6 months ago

Duplicate of #620 which contains arguments on why it's not implemented.

Ok, I just take a look at the implementation and the explanation seems good to me.

BTW, if we use a bitwise-based implementation, I guess the rev can be implemented in a naive solution?

Philippe-Cholet commented 6 months ago

No matter the implementation or the iterator, support a DoubleEndedIterator implementation can have some cost to store backward informations (and not just forward ones).

But I guess that if you use a bitwise implementation (which is surely lightweight) then the cost would probably be quite small and more acceptable for you than here for us.