-
-
Notifications
You must be signed in to change notification settings - Fork 116
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
Avoid type piracy by defining distinct functions #814
Comments
One issue here is that getting rid of old stuff becomes slightly more annoying. Let me explain with the very simple Lines 801 to 803 in 8819abe
Wtih the style proposed here, this would become if VERSION < v"1.9.0-DEV.461"
VersionNumber(args...) = Base.VersionNumber(args...)
VersionNumber(v::VersionNumber) = v
else
const VersionNumber = Base.VersionNumber
end And users then do We would like people to declare compatibility with v5 asap, as it will be much more light-weight after getting rid of the old stuff, but for packages still supporting older Julia, they would also keep compatibility with v4 and keep using For those functions which required the Opinions? |
As argued by @KristofferC ion #811 (comment) (and I tend to agree), Compat should not commit type piracy by adding methods to Base functions for Base types, but rather define distinct functions of the same name, so that usage needs to be explicit opt-in (by qualification or explicitly named
using
).This is different from how we used to do it, by I think it's worthwhile.
If we agree to do it this way, we should start by applying this rule to any new features. I'm not sure we should also go to the trouble of deprecating the old style in favor of the new style for existing features. Anyway, this likely warrants some discussion before setting anything in motion.
The text was updated successfully, but these errors were encountered: