How to determine if an object is callable?

And a non-callable function:

julia> function f end
f (generic function with 0 methods)

julia> f isa Function
true

julia> methods(f)
# 0 methods for generic function "f":
3 Likes

This is a great example and highlights an important point: whether an object is “callable” in general is usually irrelevant in Julia (except maybe for introspection/debugging), since what matters is if it supports a particular call signature.

6 Likes