From: mame@... Date: 2020-12-21T01:33:09+00:00 Subject: [ruby-core:101565] [Ruby master Feature#16697] Hash.ruby2_keywords_hash?(value) should support any object Issue #16697 has been updated by mame (Yusuke Endoh). Target version deleted (3.0) Status changed from Open to Feedback I don't think we will be able to decide this issue by Ruby 3.0.0. But changing it after Ruby 3.0.0 seems more confusing. I vote for WONTFIX if there is no strong reason. ---------------------------------------- Feature #16697: Hash.ruby2_keywords_hash?(value) should support any object https://bugs.ruby-lang.org/issues/16697#change-89349 * Author: Eregon (Benoit Daloze) * Status: Feedback * Priority: Normal ---------------------------------------- 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: