3 ms·
Strange Hash Instances in Ruby (2017)
- Lammy 5y agoThis post discusses MRI 2.4, but I discovered this the hard way in Ruby 3.0 when I tried to use instances of a custom String subclass as Hash keys. The conventional wisdom is "don't subclass built-in types" but nobody tells you why not :)