[#74190] [Ruby trunk Feature#12134] Comparison between `true` and `false` — duerst@...
SXNzdWUgIzEyMTM0IGhhcyBiZWVuIHVwZGF0ZWQgYnkgTWFydGluIETDvHJzdC4KCgpUc3V5b3No
3 messages
2016/03/07
[#74269] Type systems for Ruby — Rob Blanco <ml@...>
Dear ruby-core,
5 messages
2016/03/10
[#74395] [Ruby trunk Feature#12142] Hash tables with open addressing — shyouhei@...
Issue #12142 has been updated by Shyouhei Urabe.
3 messages
2016/03/17
[ruby-core:74476] [Ruby trunk Bug#12198] Hash#== sometimes returns false incorrectly
From:
shevegen@...
Date:
2016-03-20 16:09:06 UTC
List:
ruby-core #74476
Issue #12198 has been updated by Robert A. Heiler. Here is Hash#rehash link: http://ruby-doc.org/core-2.3.0/Hash.html#method-i-rehash Perhaps the documentation could be updated regardless, to also notify the ruby user when .rehash may be useful. For instance, this is the first time that I read about two sets with the same content, may be considered not equal and that a .rehash can fix this behaviour displayed. I don't think I have actually seen .rehash used before yet, one can always learn something new in these bug reports. :) ---------------------------------------- Bug #12198: Hash#== sometimes returns false incorrectly https://bugs.ruby-lang.org/issues/12198#change-57595 * Author: Sebastian Skalacki * Status: Assigned * Priority: Normal * Assignee: Akinori MUSHA * ruby -v: ruby 2.4.0dev (2016-03-11 trunk 54086) [x86_64-darwin14] * Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN ---------------------------------------- Hi! Sorry for lack of the accuracy in the bug title. I have some trouble with pinpointing the issue. According to documentation, "two hashes are equal if they each contain the same number of keys and if each key-value pair is equal to (according to Object#==) the corresponding elements in the other hash." I was able to produce two hashes which satisfy this condition, however the method returns false. In other words, following happens: ~~~ e.class #=> Hash r.class #=> Hash e.size == r.size #=> true e.each_pair.to_a == r.each_pair.to_a #=> true e == r #=> false ~~~ That happens in Ruby 1.9.3, 2.3, 2.4 and probably in other versions as well. Pure Ruby, no gem could interfere. Happy Easter ]:-> ---Files-------------------------------- problem.rb (1.69 KB) -- https://bugs.ruby-lang.org/ Unsubscribe: <mailto:[email protected]?subject=unsubscribe> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>