From: shannonskipper@... Date: 2017-05-14T06:55:32+00:00 Subject: [ruby-core:81152] [Ruby trunk Feature#13562] Use a sized enumerator with #yield_self Issue #13562 has been updated by shan (Shannon Skipper). I'm not at all sure about my implementation, but here is a pull request with my attempt: https://github.com/ruby/ruby/pull/1615 ---------------------------------------- Feature #13562: Use a sized enumerator with #yield_self https://bugs.ruby-lang.org/issues/13562#change-64804 * 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: