From: "zetter (Chris Zetter) via ruby-core" Date: 2025-01-26T12:08:52+00:00 Subject: [ruby-core:120794] [Ruby master Bug#21089] Missing methods on enumerators created from Enumerator::product and Enumerator::Chain Issue #21089 has been reported by zetter (Chris Zetter). ---------------------------------------- Bug #21089: Missing methods on enumerators created from Enumerator::product and Enumerator::Chain https://bugs.ruby-lang.org/issues/21089 * Author: zetter (Chris Zetter) * Status: Open * ruby -v: ruby 3.5.0dev (2025-01-26T08:52:22Z master d4a1a2780c) +PRISM [arm64-darwin24] * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- 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. -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/