Project

General

Profile

Actions

Bug #17317

closed

In 2.7.2, Hash#except doesn't seem to exist, but is in the documentation

Bug #17317: In 2.7.2, Hash#except doesn't seem to exist, but is in the documentation

Added by Anonymous almost 5 years ago. Updated almost 5 years ago.

Status:
Third Party's Issue
Assignee:
-
Target version:
-
ruby -v:
ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-linux]
[ruby-core:100778]

Description

According to https://ruby-doc.org/core-2.7.2/Hash.html#method-i-except, Hash#except is available in 2.7.2, but it doesn't appear to actually be there.

Run the following on the command line:

ruby -v -e 'h={a:1,b:2}; puts h, h.except(:a)'

Output:

ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-linux]
Traceback (most recent call last):
-e:1:in `<main>': undefined method `except' for {:a=>1, :b=>2}:Hash (NoMethodError)

This defines a Hash and then called except on it; the method appears to not be present although the docs indicate it is in this version. Indeed, I cannot find rb_hash_except in hash.c for 2.7.2.

Actions

Also available in: PDF Atom