# How to see all overriden types or functions of Base?

**URL:** <https://discourse.julialang.org/t/how-to-see-all-overriden-types-or-functions-of-base/2179>\
**Category:** New to Julia\
**Created:** [February 20, 2017, 9:15am UTC](https://discourse.julialang.org/t/how-to-see-all-overriden-types-or-functions-of-base/2179 "2017-02-20T09:15:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![chobbes](https://avatars.discourse-cdn.com/v4/letter/c/848f3c/32.png) [@chobbes](https://discourse.julialang.org/u/chobbes)\
**Post date:** [February 20, 2017, 9:15am UTC](https://discourse.julialang.org/t/how-to-see-all-overriden-types-or-functions-of-base/2179/1 "2017-02-20T09:15:59Z")

</div>

I wonder if there is a way to all types or functions in Base that have been overridden after `using` a package. I did some careful search, but no useful hits. Thanks for any comments.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [February 20, 2017, 9:23am UTC](https://discourse.julialang.org/t/how-to-see-all-overriden-types-or-functions-of-base/2179/2 "2017-02-20T09:23:08Z")

</div>

If by “override” you mean “redefine for the same signature”, this is considered bad form unless there is a compelling reason to do so.

If you just want the methods defined in a module, then `methodswith` takes a module argument.

```julia
julia> using ValidatedNumerics
julia> methodswith(Any, ValidatedNumerics)
5-element Array{Method,1}:
 ..(a, b) at /home/tamas/.julia/v0.5/ValidatedNumerics/src/intervals/intervals.jl:60                                         
 interval_from_midpoint_radius(midpoint, radius) at /home/tamas/.julia/v0.5/ValidatedNumerics/src/intervals/arithmetic.jl:371
 isempty(itr) at iterator.jl:3                                                                                               
 setindex(a::FixedSizeArrays.FixedArray, value, index::Int64...) at /home/tamas/.julia/v0.5/FixedSizeArrays/src/indexing.jl:8
 ±(a, b) at /home/tamas/.julia/v0.5/ValidatedNumerics/src/intervals/intervals.jl:66                                          

```

---

<div class="post-metadata">

**Author:** ![chobbes](https://avatars.discourse-cdn.com/v4/letter/c/848f3c/32.png) [@chobbes](https://discourse.julialang.org/u/chobbes)\
**Post date:** [February 20, 2017, 9:27am UTC](https://discourse.julialang.org/t/how-to-see-all-overriden-types-or-functions-of-base/2179/3 "2017-02-20T09:27:48Z")

</div>

Thanks. You’re right. I shouldn’t have used the word “override”. I meant the new methods added to a Base function. `methods()` or `methodswith()` are both of great use. But I wonder if there is a way to _list_ all new methods added to functions in Base by a package. Maybe there isn’t such a command.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [February 20, 2017, 9:49am UTC](https://discourse.julialang.org/t/how-to-see-all-overriden-types-or-functions-of-base/2179/4 "2017-02-20T09:49:29Z")

</div>

It is possible that I do not understand your requirement, but `methodswith(Any, module)` will list **all** methods defined by that module.

You can filter the result by checking which of those is defined in `Base`, eg with `isdefined`:

```julia
function all_redefinitions(_module, _in_module=Base)
    m = methodswith(Any, _module)
    filter(m->isdefined(_in_module, m.name), m)
end

```

---

<div class="post-metadata">

**Author:** ![chobbes](https://avatars.discourse-cdn.com/v4/letter/c/848f3c/32.png) [@chobbes](https://discourse.julialang.org/u/chobbes)\
**Post date:** [February 20, 2017, 9:56am UTC](https://discourse.julialang.org/t/how-to-see-all-overriden-types-or-functions-of-base/2179/5 "2017-02-20T09:56:53Z")

</div>

No. You understood correctly. I confused myself. I thought with `Any` being the first argument, the methods defined by Base are also returned. I totally forgot the optional second argument. Thanks a lot!
