From: hanmac@... Date: 2017-05-16T06:46:55+00:00 Subject: [ruby-core:81194] [Ruby trunk Feature#13562] Use a sized enumerator with #yield_self Issue #13562 has been updated by Hanmac (Hans Mackowiak). 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 ---------------------------------------- Feature #13562: Use a sized enumerator with #yield_self https://bugs.ruby-lang.org/issues/13562#change-64849 * 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: