You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This came up on slack in the #data channel: it would be nice to have a function to check if something is Nothing, since (apparently) x == nothing has a performance hit, and it's easy to forget to use x === nothing. Related: #28700
More importantly from my perspective, it has a nice symmetry with ismissing() and isnan(). I'm always expecting this to be a thing.
I did some searching in the repo and in discourse, where I found this comment
To simplify checking for nothingness, I wonder whether it’d be helpful to have isnothing (analogous to ismissing), but it’s also true that x isa Nothing isn’t much longer.
The only thing in the repo when I search for "isnothing" is a comment in #414 that uses it in some code (not sure if that was an assumption or if it used to be a thing and isn't anymore).
Working on a simple PR that would add this if there's interest. Basically just
isnothing(x::Any) = x === nothing ? true : false
(plus docs and tests of course 😆)
The text was updated successfully, but these errors were encountered:
This came up on slack in the #data channel: it would be nice to have a function to check if something is
Nothing
, since (apparently)x == nothing
has a performance hit, and it's easy to forget to usex === nothing
. Related: #28700More importantly from my perspective, it has a nice symmetry with
ismissing()
andisnan()
. I'm always expecting this to be a thing.I did some searching in the repo and in discourse, where I found this comment
The only thing in the repo when I search for "isnothing" is a comment in #414 that uses it in some code (not sure if that was an assumption or if it used to be a thing and isn't anymore).
Working on a simple PR that would add this if there's interest. Basically just
(plus docs and tests of course 😆)
The text was updated successfully, but these errors were encountered: