T
Tomasz Wegrzanowski
Hash equality right now ignores the default values.
So a == b may be true even if a[0] == b[0] would be false.
Is this behaviour intended ?
irb(main):001:0> a = Hash.new(0)
=> {}
irb(main):002:0> b = Hash.new(42)
=> {}
irb(main):003:0> a == b
=> true
irb(main):004:0> a[0] == b[0]
=> false
irb(main):005:0> c = Hash.new{|ht,k| ht[k] = 5}
=> {}
irb(main):006:0> a == c
=> true
irb(main):007:0> a[0] == c[0]
=> false
So a == b may be true even if a[0] == b[0] would be false.
Is this behaviour intended ?
irb(main):001:0> a = Hash.new(0)
=> {}
irb(main):002:0> b = Hash.new(42)
=> {}
irb(main):003:0> a == b
=> true
irb(main):004:0> a[0] == b[0]
=> false
irb(main):005:0> c = Hash.new{|ht,k| ht[k] = 5}
=> {}
irb(main):006:0> a == c
=> true
irb(main):007:0> a[0] == c[0]
=> false