Curious what the view on asserts in released, production code is.
Working on PR for Pkg.TOML. It has lots of places that trigger assert error on nothing values with a get method:
get(x) = (@assert !isnull(x); x). In the package, nothing is often acceptable, but requires explicit handling. Note that isnull() returns true or false based when whether the argument is nothing–precedes the isnothing() function in Julia 1.1.
In every instance of the use of this get method, it is wrapped in or preceded by an if statement that properly handles the nothing value, consistent with the rules of TOML, including generating appropriate errors where necessary.
Before all these “nothings” were explicitly handled, the asserts were a good testing strategy–if you have the appropriate test cases, you’ll find out where you failed to handle a nothing. In the production code, should the asserts be left in? As the code is currently written, none of the asserts can be raised. I’m inclined to remove them.
For comparison, the JSON package in the registry contains no @asserts.