-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Tighten signature of iszero
and isone
fallbacks
#57671
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
Conversation
This PR currently breaks some tests:
|
This seems to be quite breaking for somewhat limited gains. A lot of the breakage might happen in the wild, and wouldn't be caught by a I'm also not fully certain about the motivation here. One of the examples in the issue is |
In principle I like this, but we definitely need PkgEval here to evaluate the chaos it could cause.
This is strictly internal, so doesn't matter. I think this should be broadened to include |
Here's one option, very hackey but gets the right answer most of the time: isone(x::Union{Number, AbstractArray}) = x == one(x)
function isone(x)
o = one(x)
if typeof(o) == typeof(x)
o == x
else
throw ArgumentError("...")
end
end |
@nanosoldier |
As far as I remember this still fails a bunch of tests in the test suite here, so running PkgEval is probably just a waste. |
I think it only fails on stdlibs so this should be somewhat realistic (though not fully). |
The package evaluation job you requested has completed - possible new issues were detected. Report summary❗ Packages that crashed1 packages crashed only on the current version.
3 packages crashed on the previous version too. ✖ Packages that failed37 packages failed only on the current version.
1489 packages failed on the previous version too. ✔ Packages that passed tests25 packages passed tests only on the current version.
5191 packages passed tests on the previous version too. ~ Packages that at least loaded9 packages successfully loaded only on the current version.
2836 packages successfully loaded on the previous version too. ➖ Packages that were skipped altogether1 packages were skipped only on the current version.
917 packages were skipped on the previous version too. |
Looking at a few of the nano-soldier results, I estimate this breakage will require fixes to be applied to at least 19 registered packages, even once patches are applied to fix the LinearAlgebra case. This is far too breaking. |
Resolves #57372. Please see that issue for the motivation behind the change.
Could someone please run a PkgEval on this? If there are breakages in the ecosystem, I think this is a sign to not follow down this any further.