As the title say, i am wandering if it is OK to reexport a method from a different package. I currently have :
module MyPackage
using OtherPackage
struct mytype end
OtherPackage.function(x::mytype) = 1
end
The fact is that MyPackage provides new methods to this function, on types that are defined in MyPackage (so no type piracy), but the generic is only exported if I do :
using MyPackage
# Cannot use `function`
using OtherPackage
# Now i can
Would it me OK to export OtherPackage.function, so that i could do:
Thanks. Do you know if there is a âstandardâ, or a good practice regarding the choice between re-exporting and telling people to load both packages ?
I would say that it depends on the relationship between your package and the other package. If your package builds âon top ofâ the other package but a user wouldnât particularly need to be aware of the underlying package then re-export. If your package is an addition that a user would be using while also using the underlying package directly then advise they load both.