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
{{ message }}
Repository navigation
Checking if NDArray is null returns wrong results #935
Just got into this after migrating from the older version that used NumSharp. Almost had a heart attack by watching an expression if (x != null) throwing a NullReferenceException.
It looks like it was an intended behavior, according to the implementation, but wait, this is not a Python anymore! Despite there is an "is" operator in C# now, this is not a common idiomatic form. No one should expect from "x == null" anything else except checking for null! In other words, let's not try to turn C# into a Python, please?
Activity
m0nzderr commentedon Aug 5, 2022
Just got into this after migrating from the older version that used NumSharp. Almost had a heart attack by watching an expression
if (x != null)throwing a NullReferenceException.It looks like it was an intended behavior, according to the implementation, but wait, this is not a Python anymore! Despite there is an "is" operator in C# now, this is not a common idiomatic form. No one should expect from "x == null" anything else except checking for null! In other words, let's not try to turn C# into a Python, please?
Superpiffer commentedon Feb 20, 2023
Solved 5821275