What is `Callable`

See discussion in #43491. The short answer is that it’s Union{Function,Type}, like you’d guessed, but that you really should avoid using it unless ambiguities would arise otherwise. If we were better people, we probably would have already removed ::Callable from existence. But we haven’t gotten around to it yet.

Since the body of the function would presumably include default(key), I think the function will choose to specialize on typeof(default) whether or not you use the ::T annotation. But I could be mistaken. You can try it with and without to see if it makes a difference. Be sure to restart julia before finalizing your decision, because sometimes the performance doesn’t update properly in this case from Revise alone.

4 Likes