From: "matz (Yukihiro Matsumoto) via ruby-core" Date: 2024-11-07T08:58:15+00:00 Subject: [ruby-core:119794] [Ruby master Feature#20793] Allow Multiple Arguments for the .is_a? Method Issue #20793 has been updated by matz (Yukihiro Matsumoto). Status changed from Open to Rejected `is_a?(A, B)` can be read as `is_a?(A) || is_a?(B)` or `is_a?(A) && is_a?(B)`. This ambiguity might lead to less readability. Matz. ---------------------------------------- Feature #20793: Allow Multiple Arguments for the .is_a? Method https://bugs.ruby-lang.org/issues/20793#change-110479 * Author: artemb (Artem Borodkin) * Status: Rejected ---------------------------------------- I propose allowing multiple arguments to be passed to the .is_a? Method imply "OR" semantics: ``` ruby name.is_a? String, Symbol ``` Currently, we need to write the following to achieve the same functionality: ``` ruby [String, Symbol].include?(name.class) ``` -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/