# How do I tell if an object is callable (a function-like object)?

**URL:** https://discourse.julialang.org/t/how-do-i-tell-if-an-object-is-callable-a-function-like-object/100831
**Category:** General Usage
**Tags:** question, functors
**Created:** [June 26, 2023, 6:07am UTC](https://discourse.julialang.org/t/how-do-i-tell-if-an-object-is-callable-a-function-like-object/100831 "2023-06-26T06:07:40Z")
**Posts on this page:** 1
**Showing post:** 12

<div class="post-metadata">

### Author: ![MilesCranmer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/milescranmer/32/21070_2.png) [@MilesCranmer](https://discourse.julialang.org/u/MilesCranmer)
#### Post date: [June 26, 2023, 3:47pm UTC](https://discourse.julialang.org/t/how-do-i-tell-if-an-object-is-callable-a-function-like-object/100831/12 "2023-06-26T15:47:30Z")

</div>

If the reason you are avoiding catching MethodError is for speed, you could see this thread:: [Performance of hasmethod vs try-catch on MethodError](https://discourse.julialang.org/t/performance-of-hasmethod-vs-try-catch-on-methoderror/99827).

The solution is overkill (works by caching the `MethodError`s) but it works, is type stable, and only faces a ~10 ns overhead.

---

_[View the full topic](https://discourse.julialang.org/t/how-do-i-tell-if-an-object-is-callable-a-function-like-object/100831)._
