Skip to content

=== in comparing with nothing #364

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 23, 2023
Merged

Conversation

jishnub
Copy link
Member

@jishnub jishnub commented Jan 23, 2023

This might help with type-inference on older versions of Julia

@codecov
Copy link

codecov bot commented Jan 23, 2023

Codecov Report

Base: 71.97% // Head: 71.98% // Increases project coverage by +0.01% 🎉

Coverage data is based on head (fc18d6c) compared to base (6b777fe).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #364      +/-   ##
==========================================
+ Coverage   71.97%   71.98%   +0.01%     
==========================================
  Files          79       79              
  Lines        8311     8311              
==========================================
+ Hits         5982     5983       +1     
+ Misses       2329     2328       -1     
Impacted Files Coverage Δ
src/LinearAlgebra/helper.jl 64.23% <100.00%> (ø)
src/Multivariate/ProductFun.jl 49.44% <0.00%> (+0.55%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@jishnub jishnub merged commit 6e231f8 into JuliaApproximation:master Jan 23, 2023
@jishnub jishnub deleted the nothingcmp branch January 23, 2023 08:27
@dlfivefifty
Copy link
Member

I would suggest just using isnothing(xst)

@jishnub
Copy link
Member Author

jishnub commented Jan 24, 2023

isnothing(x) is equivalent to x === nothing on recent Julia versions, but from what I remember, the === nothing used to be the recommended style on older versions. I can't remember if they are equivalent on v1.6, so I went with the one that is known to be better on old versions.

@dlfivefifty
Copy link
Member

If isnothing isn't the recommended style then its weird the function even exists...

@jishnub
Copy link
Member Author

jishnub commented Jan 25, 2023

I think the idea was that custom Nothing types may extend isnothing for their types, which wouldn't be possible with === nothing. However, the performance issue was unfortunate, which is why it was recommended to use === nothing if not working with custom types. At least on recent Julia versions, all of isnothing, === nothing and == nothing are equivalent, so that's one less thing to remember.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants