
Issue #21124 has been updated by andrykonchin (Andrew Konchin). Yes, indeed. You are right. My bad. I was confused by result of `#to_a` called on such Enumerator: ```ruby [1, 2, 3].find.to_a # => [1, 2, 3] ``` ---------------------------------------- Bug #21124: Enumerable#find called without a block returns Enumerator without size https://bugs.ruby-lang.org/issues/21124#change-111824 * Author: andrykonchin (Andrew Konchin) * Status: Feedback * ruby -v: 3.4.1 * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- When a collection's size is known then enumerator that iterates it usually has size (that's `#size` returns a collection size). But an enumerator returned by `Enumerable#find` called without a block doesn't have size: ```ruby [1, 2, 3].find.size # => nil ``` Expected result here is `3`. Usually similar methods in the Enumerable module return enumerators with size (when these enumerators for instance iterate the collection itself): ```ruby [1, 2, 3].each_entry.size # => 3 ``` -- https://bugs.ruby-lang.org/