From: Florian Gross Date: 2007-06-29T11:10:25+09:00 Subject: [BUG] delete_if with destructive methods in block Hi, Here's some odd Hash#delete_if behaviour: h = {1 => 2, 3 => 4, 5 => 6} h.delete_if do |*a| p a h.shift p h puts true end It outputs the following: [5, 6] {1=>2, 3=>4} [5] {3=>4} [3, 4] {} [3] {} The same behaviour can be produced by replacing h.shift with h.delete(h.keys.first). It happens for me on ruby 1.9.0 (2007-04-02 patchlevel 0) and ruby 1.8.4 (2005-12-24). I'm not sure why this happens instead of a hash modified during iteration exception being raised. Kind regards, Florian Gross