How bad is type piracy actually?

Right, type piracy is defining function f(x::T) where you “own” neither f nor T. If f is your own function, or T is a type you defined, there’s no issue at all. But even if neither is true, it still might be OK. It’s just a smell that something bad might be happening, such as:

  • The author/designer of f really did not want it to support type T, so you’re misunderstanding what the function is supposed to mean.
  • The code is in the wrong place, and should be moved to where f or T is defined.

But if everything seems to be in order, pirate away.

25 Likes