# Get the argument names of an function

**URL:** https://discourse.julialang.org/t/get-the-argument-names-of-an-function/32902
**Category:** New to Julia
**Created:** [January 3, 2020, 1:04am UTC](https://discourse.julialang.org/t/get-the-argument-names-of-an-function/32902 "2020-01-03T01:04:33Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![zwwi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zwwi/32/11932_2.png) [@zwwi](https://discourse.julialang.org/u/zwwi)
#### Post date: [March 8, 2020, 6:07am UTC](https://discourse.julialang.org/t/get-the-argument-names-of-an-function/32902/4 "2020-03-08T06:07:59Z")

</div>

using the following code from [https://github.com/JuliaLang/julia/blob/master/base/methodshow.jl](https://github.com/JuliaLang/julia/blob/master/base/methodshow.jl) (`Vector{Any}` changed to `Vector{Symbol}`)

```julia
function method_argnames(m::Method)
    argnames = ccall(:jl_uncompress_argnames, Vector{Symbol}, (Any,), m.slot_syms)
    isempty(argnames) && return argnames
    return argnames[1:m.nargs]
end

```

and then

```julia
ms = collect(methods(f))
method_argnames(last(ms))[2:end]

```

you’ll get

```julia
3-element Array{Symbol,1}:
 :x
 :y
 :z

```

---

_[View the full topic](https://discourse.julialang.org/t/get-the-argument-names-of-an-function/32902)._
