From: knu@... Date: 2017-10-22T12:27:43+00:00 Subject: [ruby-core:83501] [Ruby trunk Bug#12970][Closed] == Equality of recursive sets fails Issue #12970 has been updated by knu (Akinori MUSHA). Status changed from Open to Closed This is not a bug but a feature. Set#reset has been added so you can use it if need be. ---------------------------------------- Bug #12970: == Equality of recursive sets fails https://bugs.ruby-lang.org/issues/12970#change-67515 * Author: kdeberk (Kevin de Berk) * Status: Closed * Priority: Normal * Assignee: * Target version: * ruby -v: 2.2.5, 2.3.3 * Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN ---------------------------------------- Comparing recursive arrays and hashes with equal? contents (save for the recursive element) using == succeeds. However, using == to compare two recursive sets with equal? contents fails. I expect that to succeed. See the attached script. This is my output for 2.2.5 and 2.3.3: ~~~ [1, 2, 3] == [1, 2, 3]? -> true [1, 2, 3, [...]] == [1, 2, 3, [...]]? -> true {:a=>1, :b=>2} == {:a=>1, :b=>2}? -> true {:a=>1, :b=>2, :c=>{...}} == {:a=>1, :b=>2, :c=>{...}}? -> true # == #? -> true # == #? -> false ~~~ ---Files-------------------------------- recursive_set_comparison.rb (871 Bytes) fix_recursive_sets.patch (2.39 KB) -- https://bugs.ruby-lang.org/ Unsubscribe: