JuliaLang / Compat.jl

Compatibility across Julia versions
Other
142 stars 117 forks source link

Avoid type piracy by defining distinct functions #814

Open martinholters opened 7 months ago

martinholters commented 7 months ago

As argued by @KristofferC ion https://github.com/JuliaLang/Compat.jl/pull/811#issuecomment-1829627924 (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.