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
Well, I 'm now sure if we should add such a feature.
Case with nil == nil is easy and trivial.
But for nil >= nil, what should we do? And nil <= nil? How it will affect sorting?
For reference: Python does not allow for >= with None:
>>> None >= None
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: '>=' not supported between instances of 'NoneType' and 'NoneType'
I agree with your point about comparing nil with nil. However, regarding comparisons between nil and specific values (like nil > 1), would it be possible for expr to support this to provide a better user experience? Thank you.
Interesting topic! I have a lot of math with potential nil values in my application and implemented the logic with a patcher. But I think expected results will be application dependent: is nil > 1 false, or nil? To me, nil is not comparable to any value, so nil > nil is false. To be consistent, nil == nil would be false as well!
Activity
5idu commentedon Feb 24, 2025
@antonmedv any ideas? tks~
antonmedv commentedon Feb 24, 2025
Well, I 'm now sure if we should add such a feature.
nil == nilis easy and trivial.nil >= nil, what should we do? Andnil <= nil? How it will affect sorting?5idu commentedon Feb 25, 2025
I agree with your point about comparing nil with nil. However, regarding comparisons between nil and specific values (like nil > 1), would it be possible for expr to support this to provide a better user experience? Thank you.
mdmcconnell commentedon Feb 26, 2025
Interesting topic! I have a lot of math with potential nil values in my application and implemented the logic with a patcher. But I think expected results will be application dependent: is nil > 1 false, or nil? To me, nil is not comparable to any value, so nil > nil is false. To be consistent, nil == nil would be false as well!
antonmedv commentedon Feb 26, 2025
@mdmcconnell has a good point.
I think it is better to be explicit: