From: "sawa (Tsuyoshi Sawada)" Date: 2022-11-13T02:30:56+00:00 Subject: [ruby-core:110734] [Ruby master Feature#19128] Hash#delete could take a second argument as the default value? Issue #19128 has been updated by sawa (Tsuyoshi Sawada). Since you are avoiding doing: ```rb {}.delete(:a) || [] ``` it must be the case that you have a hash in which `nil` can be a meaningful value, and you want to distinguish that from the case where `delete` results in a miss hit. What is the use case for that? ---------------------------------------- Feature #19128: Hash#delete could take a second argument as the default value? https://bugs.ruby-lang.org/issues/19128#change-100069 * Author: dorianmariefr (Dorian Mari��) * Status: Open * Priority: Normal ---------------------------------------- e.g. `{}.delete(:a, [])` would return `[]` -- https://bugs.ruby-lang.org/ Unsubscribe: