From: mame@... Date: 2020-12-12T02:38:11+00:00 Subject: [ruby-core:101422] [Ruby master Feature#16697] Hash.ruby2_keywords_hash?(value) should support any object Issue #16697 has been updated by mame (Yusuke Endoh). jbeschi (jacopo beschi) wrote in #note-9: > Anyways I'd wait for the devs meeting outcome and see if we can move this forward. My comment #7 is the meeting outcome. Some committers including matz discussed this issue, but we were not sure if the change is really needed. Even if we change it in Ruby 2.7.3 and 3.0.0, people cannot depend on the new behavior if they care users of Ruby 2.7.2. Also, while it is trivial to workaround the issue, changing the behavior may bring new confusion. Anyway, this issue must be handled not only in master but also in ruby 2.7 branch. @nagachika , who is Ruby 2.7 branch maintainer, didn't attend the meeting. So we first ask @nagachika 's opinion. ---------------------------------------- Feature #16697: Hash.ruby2_keywords_hash?(value) should support any object https://bugs.ruby-lang.org/issues/16697#change-89183 * Author: Eregon (Benoit Daloze) * Status: Open * Priority: Normal * Target version: 3.0 ---------------------------------------- But currently it raises, which makes it needlessly inconvenient to use: ```ruby > Hash.ruby2_keywords_hash?({}) => false > Hash.ruby2_keywords_hash?("hello") Traceback (most recent call last): 5: from /home/eregon/.rubies/ruby-trunk/bin/irb:23:in `
' 4: from /home/eregon/.rubies/ruby-trunk/bin/irb:23:in `load' 3: from /home/eregon/prefix/ruby-trunk/lib/ruby/gems/2.8.0/gems/irb-1.2.3/exe/irb:11:in `' 2: from (irb):4 1: from (irb):4:in `ruby2_keywords_hash?' TypeError (wrong argument type String (expected Hash)) ``` See https://github.com/ruby/ruby/pull/2966/files#r394741112 for a motivating example. I'd like to suggest backporting this to 2.7 too. -- https://bugs.ruby-lang.org/ Unsubscribe: