Feature #13562
closed
Use a sized enumerator with #yield_self
Added by shan (Shannon Skipper) almost 7 years ago.
Updated almost 7 years ago.
Description
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:
42.yield_self.count #=> 1
42.yield_self.size #=> nil
I propose:
42.yield_self.count #=> 1
42.yield_self.size #=> 1
The patch seems okay to me, but honestly I don't see any practical use case of it. Do you nedd this?
shyouhei (Shyouhei Urabe) wrote:
The patch seems okay to me, but honestly I don't see any practical use case of it. Do you nedd this?
the pr was already merged, but this ticket was not closed because of that
Hanmac (Hans Mackowiak) wrote:
shyouhei (Shyouhei Urabe) wrote:
The patch seems okay to me, but honestly I don't see any practical use case of it. Do you nedd this?
the pr was already merged, but this ticket was not closed because of that
Thank you. Issue updated to refer the changeset.
- Status changed from Open to Closed
Also available in: Atom
PDF
Like0
Like0Like0Like0Like0Like0