# Full path of a datatype or a function

**URL:** https://discourse.julialang.org/t/full-path-of-a-datatype-or-a-function/11396
**Category:** General Usage
**Created:** [June 3, 2018, 7:36pm UTC](https://discourse.julialang.org/t/full-path-of-a-datatype-or-a-function/11396 "2018-06-03T19:36:30Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Qiyamah](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/qiyamah/32/2660_2.png) [@Qiyamah](https://discourse.julialang.org/u/Qiyamah)
#### Post date: [June 3, 2018, 7:36pm UTC](https://discourse.julialang.org/t/full-path-of-a-datatype-or-a-function/11396/1 "2018-06-03T19:36:30Z")

</div>

Hi,

I would like to get the full path of a data type  
like  
for Int it would be Base.Int

for a user defined datatype named MyDT in module X.Y.Z, it would be X.Y.Z.MyDT

is there a function which does that?

Thanks

---

<div class="post-metadata">

### Author: ![yuyichao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yuyichao/32/20_2.png) [@yuyichao](https://discourse.julialang.org/u/yuyichao)
#### Post date: [June 3, 2018, 9:17pm UTC](https://discourse.julialang.org/t/full-path-of-a-datatype-or-a-function/11396/2 "2018-06-03T21:17:35Z")

</div>

The module of a type could be determined from `T.name.module`. The module of a function is just the module of the type of the function. The module of a method is in the `module` field of the `Method` as well.

Given the module, you can determine the fullly qualified name using `fullname`.

Note that,

1. this is usually **NOT** a good way to access a type/function/to generate code in a macro.
2. For `Int` it’s `Core`, not `Base`.

---

<div class="post-metadata">

### Author: ![ScottPJones](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/scottpjones/32/146_2.png) [@ScottPJones](https://discourse.julialang.org/u/ScottPJones)
#### Post date: [June 4, 2018, 2:12am UTC](https://discourse.julialang.org/t/full-path-of-a-datatype-or-a-function/11396/3 "2018-06-04T02:12:38Z")

</div>

> [@yuyichao](#):
>
> this is usually **NOT** a good way to access a type/function/to generate code in a macro.

Do you have any better methods to recommend to the OP?  
Also, why is it not a good way to access the type/function in that circumstance?  
That might be useful information.  
(Thanks in advance!)
