# What is \`Callable\`

**URL:** https://discourse.julialang.org/t/what-is-callable/73884
**Category:** Internals & Design
**Created:** [December 31, 2021, 11:39pm UTC](https://discourse.julialang.org/t/what-is-callable/73884 "2021-12-31T23:39:34Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Stephen\_Vavasis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stephen_vavasis/32/3389_2.png) [@Stephen\_Vavasis](https://discourse.julialang.org/u/Stephen_Vavasis)
#### Post date: [December 31, 2021, 11:39pm UTC](https://discourse.julialang.org/t/what-is-callable/73884/1 "2021-12-31T23:39:35Z")

</div>

The function `get` in `dict.jl` has the following signature:

```julia
function get(default::Callable, h::Dict{K,V}, key) where V where K

```

I am wondering: what does `Callable` mean? Perhaps `Union{Function,Type}`? Also, does it specialize? It seems like `get` is a function that ought to specialize for better performance. In other words, why is this not written as:

```julia
function get(default::T, h::Dict{K,V}, key) where T where V where K

```

(I am rewriting the sorted container code in DataStructures.jl and would like to follow an appropriate pattern for `get` and `get!`)

---

<div class="post-metadata">

### Author: ![mikmoore](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mikmoore/32/31109_2.png) [@mikmoore](https://discourse.julialang.org/u/mikmoore)
#### Post date: [January 1, 2022, 12:41am UTC](https://discourse.julialang.org/t/what-is-callable/73884/2 "2022-01-01T00:41:34Z")

</div>

See discussion in [#43491](https://github.com/JuliaLang/julia/issues/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.
