> However, the change that made Enumerator#to_set refuse to operate when the size returns infinity introduced a compatibility issue TBH, I don't see the compatibility argument applied with any consistency here. Let's imagine severa...zverok (Victor Shepelev)
I too, would expect the whole expression to be covered. This would be also consistent with `Method#source_location` which includes `def` (and not starts from the argument, or from the beginning of the body).zverok (Victor Shepelev)
There are, by the way, other effects of the current default that are, even if minor, still annoying: ```ruby Enumerator.produce(1, &:succ).lazy.take(6).size # Ruby 3.4: => 6 -- which is correct and useful # Ruby 4.0: => nil -- ...zverok (Victor Shepelev)
> I think `Enumerator#size` should only be non-nil when it is known to be the exact size. > ... I would argue that it is _known_ to be infinite: that's how `produce` works: loops infinitely, unless explicitly stopped by an _exception_, t...zverok (Victor Shepelev)
In #21701 a new argument `size:` was introduced, and its default value is `nil` (unknown). While I support the new argument, I'd argue that the default should be `Float::INFINITY`. **Reasoning:** By _design_, `Enumerator.produce` ...zverok (Victor Shepelev)
* [Bug #21780] Change the default size of `Enumerator.produce` back to infinity (zverok) * While the new argument is a good addition to the API, I argue that `Float::INFINITY` would be a more friendly default, corresponding to the mos...zverok (Victor Shepelev)
Just noticed that on the latest `master` subclasses `#inspect` didn't change (unlike what @matz suggests here: https://bugs.ruby-lang.org/issues/21389#note-3): ```ruby class MySet < Set end p Set[1, 2, 3] #=> Set[1, 2, 3] p My...zverok (Victor Shepelev)
This works: ```ruby proc { |x| binding.eval('x') }.call(1) #=> 1 ``` This doesn't (neither with numbered parameters, nor with `it`): ```ruby proc { _1; binding.eval('_1') }.call(1) # undefined local variable or method '_1' for ...zverok (Victor Shepelev)