From: "Earlopain (Earlopain _) via ruby-core" Date: 2026-08-16T13:50:29+00:00 Subject: [ruby-core:126403] [Ruby Misc#9136] Deprecated Enumerator.new(object, method) bad for BasicObject Issue #9136 has been updated by Earlopain (Earlopain _). Status changed from Assigned to Closed It was removed in Ruby 3.0 ---------------------------------------- Misc #9136: Deprecated Enumerator.new(object, method) bad for BasicObject https://bugs.ruby-lang.org/issues/9136#change-118541 * Author: atlas (Atlas Prime) * Status: Closed * Assignee: zzak (zzak _) ---------------------------------------- =begin Documentation it says: In the second, deprecated, form, a generated Enumerator iterates over the given object using the given method with the given arguments passed. Use of this form is discouraged. Use Kernel#enum_for or Kernel#to_enum instead. e = Enumerator.new(ObjectSpace, :each_object) #-> ObjectSpace.enum_for(:each_object) But (({#enum_for})) and (({#to_enum})) are not available to subclasses of (({BasicObject})). In fact, I was defining (({#to_enum})) for a class that is a subclass of (({BasicObject})), and now I get warning of deprecation. =end -- 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/