# Best practice way to check if method is defined for given arguments

**URL:** <https://discourse.julialang.org/t/best-practice-way-to-check-if-method-is-defined-for-given-arguments/34152>\
**Category:** General Usage\
**Created:** [February 4, 2020, 9:33am UTC](https://discourse.julialang.org/t/best-practice-way-to-check-if-method-is-defined-for-given-arguments/34152 "2020-02-04T09:33:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![oschulz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oschulz/32/2998_2.png) [@oschulz](https://discourse.julialang.org/u/oschulz)\
**Post date:** [February 4, 2020, 9:33am UTC](https://discourse.julialang.org/t/best-practice-way-to-check-if-method-is-defined-for-given-arguments/34152/1 "2020-02-04T09:33:03Z")

</div>

What’s the clean, best-practice way to check if a method is defined for a given set of arguments, from within package code? I want to check if certain required methods/traits are implemented for given arguments/types before running an algorithm that uses them at deeper levels, to provide the user with an instructive high-level error message like “you should implement …” or “the following is required for …” instead of low-level “no method matching …” errors thrown from low-level functions.

Would using `@which` be considered a clean solution?

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [February 4, 2020, 9:34am UTC](https://discourse.julialang.org/t/best-practice-way-to-check-if-method-is-defined-for-given-arguments/34152/2 "2020-02-04T09:34:55Z")

</div>

`applicable` maybe?

---

<div class="post-metadata">

**Author:** ![oschulz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oschulz/32/2998_2.png) [@oschulz](https://discourse.julialang.org/u/oschulz)\
**Post date:** [February 4, 2020, 9:49am UTC](https://discourse.julialang.org/t/best-practice-way-to-check-if-method-is-defined-for-given-arguments/34152/3 "2020-02-04T09:49:28Z")

</div>

That’s it, thanks!
