Issue #15987 has been updated by Eregon (Benoit Daloze).


I agree for methods taking an :exception keyword arguments.
I would consider this a bug to treat `nil` as "want exception".

Do you have examples of other methods taking a boolean option and treating `nil` the same as `true`?
Those should probably be fixed too, but they might be hard to find.

----------------------------------------
Feature #15987: Let boolean option (such as `exception` in `Kernel#Complex`, `Kernel#Float`, `Kernel#Integer`, `Kernel#Rational`) be falsy vs. truthy
https://bugs.ruby-lang.org/issues/15987#change-79159

* Author: sawa (Tsuyoshi Sawada)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
----------------------------------------
Some boolean options (such as the `exception` option in `Kernel#Complex`, `Kernel#Float`, `Kernel#Integer`, and `Kernel#Rational`) distinguish `false` vs. other values. But in most other cases where a boolean notion is concerned (for example, the `chomp` option in `Kernel#gets`), the distinction is between falsy vs. truthy values.

I request the distinction to be falsy vs. truthy. In other words, I would like the value `nil` to work on the falsy side rather than the truthy side. I listed some such options here, but perhaps there are other options that I missed. I would like the request to be applied for those options too.



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>