Issue #13562 has been updated by shyouhei (Shyouhei Urabe).
The patch seems okay to me, but honestly I don't see any practical use case of it. Do you nedd this?
----------------------------------------
Feature #13562: Use a sized enumerator with #yield_self
https://bugs.ruby-lang.org/issues/13562#change-64848
* Author: shan (Shannon Skipper)
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
----------------------------------------
The #yield_self Enumerator instance always has a #count of `1`. I think it might be nice to provide a lazy #size of `1` to match the #count for parity.
Currently:
~~~ ruby
42.yield_self.count #=> 1
42.yield_self.size #=> nil
~~~
I propose:
~~~ ruby
42.yield_self.count #=> 1
42.yield_self.size #=> 1
~~~
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>