ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:120794] [Ruby master Bug#21089] Missing methods on enumerators created from Enumerator::product and Enumerator::Chain
@ 2025-01-26 12:08 zetter (Chris Zetter) via ruby-core
  2025-01-27  1:52 ` [ruby-core:120796] " nobu (Nobuyoshi Nakada) via ruby-core
  0 siblings, 1 reply; 2+ messages in thread
From: zetter (Chris Zetter) via ruby-core @ 2025-01-26 12:08 UTC (permalink / raw)
  To: ruby-core; +Cc: zetter (Chris Zetter)

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/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [ruby-core:120796] [Ruby master Bug#21089] Missing methods on enumerators created from Enumerator::product and Enumerator::Chain
  2025-01-26 12:08 [ruby-core:120794] [Ruby master Bug#21089] Missing methods on enumerators created from Enumerator::product and Enumerator::Chain zetter (Chris Zetter) via ruby-core
@ 2025-01-27  1:52 ` nobu (Nobuyoshi Nakada) via ruby-core
  0 siblings, 0 replies; 2+ messages in thread
From: nobu (Nobuyoshi Nakada) via ruby-core @ 2025-01-27  1:52 UTC (permalink / raw)
  To: ruby-core; +Cc: nobu (Nobuyoshi Nakada)

Issue #21089 has been updated by nobu (Nobuyoshi Nakada).

Assignee set to knu (Akinori MUSHA)

----------------------------------------
Bug #21089: Missing methods on enumerators created from Enumerator::product and Enumerator::Chain
https://bugs.ruby-lang.org/issues/21089#change-111664

* Author: zetter (Chris Zetter)
* Status: Open
* Assignee: knu (Akinori MUSHA)
* 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/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-01-27  1:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-26 12:08 [ruby-core:120794] [Ruby master Bug#21089] Missing methods on enumerators created from Enumerator::product and Enumerator::Chain zetter (Chris Zetter) via ruby-core
2025-01-27  1:52 ` [ruby-core:120796] " nobu (Nobuyoshi Nakada) via ruby-core

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).