Bug #21089
openMissing methods on enumerators created from Enumerator::product and Enumerator::Chain
Description
I was using Enumerator.product
and noticed the enumerators it returned were missing the next
method.
When looking at the source code, I saw all the stateful enumerator methods were missing (next
, peek_values
, peek
, next_values
, feed
) as they were removed from the Enumerator::Product
subclass with rb_undef_method
.
This also applies to instances of Enumerator::Chain
, it looks like the methods never worked and were removed in https://bugs.ruby-lang.org/projects/ruby-master/repository/git/revisions/68d028578a5975fe6c44d29c502615ff9af72927
Because the English documentation says Enumerator.product
'Generates a new enumerator object' and the documentation says it inherits from Enumerator
I expected it to have the next
method available. I can use .to_enum
to make the next method available, but I'm not sure why I need to.
I'm unsure if this could be solved by making these available or the documentation could be improved.
Updated by nobu (Nobuyoshi Nakada) 9 days ago
- Related to Feature #18685: Enumerator.product: Cartesian product of enumerables added
Updated by nobu (Nobuyoshi Nakada) 9 days ago
- Assignee set to knu (Akinori MUSHA)