From: Michael Neumann Date: 2004-12-14T02:02:37+09:00 Subject: Hash freezes String keys are returns copy Hi, My observation is, that Hash behaves differently for different kinds of objects. While an Object key is preserved as is, a String key isn't (it's frozen and a copy is returned)! I'd like to get back my original key from a Hash, but with String keys this is not possible. a = 'test' b = Object.new h = {} h[a] = a h[b] = b h.each do |k,v| puts "key: " p k p k.object_id p k.frozen? puts "value: " p v p v.object_id p v.frozen? end The result is (indented for readability): key: # 68129230 false value: # 68129230 false key: "test" 68135310 true value: "test" 68135320 false Is this intended behaviour? So in my case, instead of { obj => data }, I now have to store { obj => [obj, data] }, as I can't get the original object "obj" back. Regards, Michael