# \[cppyy\] GetNumMethods for namespaces

**URL:** <https://root-forum.cern.ch/t/cppyy-getnummethods-for-namespaces/40849>\
**Category:** Newbie\
**Created:** [August 5, 2020, 4:44pm UTC](https://root-forum.cern.ch/t/cppyy-getnummethods-for-namespaces/40849 "2020-08-05T16:44:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexandrumc](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/c89c15/32.png) [@alexandrumc](https://root-forum.cern.ch/u/alexandrumc)\
**Post date:** [August 5, 2020, 4:44pm UTC](https://root-forum.cern.ch/t/cppyy-getnummethods-for-namespaces/40849/1 "2020-08-05T16:44:44Z")

</div>

Hi,

I’ve tried to use this [function](https://github.com/root-project/root/blob/master/bindings/pyroot/cppyy/cppyy-backend/clingwrapper/src/clingwrapper.cxx#L1319), but it returns 0 for namespaces.

Any ideas on how to avoid that?

Thanks!

---

<div class="post-metadata">

**Author:** ![oshadura](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/oshadura/32/14460_2.png) [@oshadura](https://root-forum.cern.ch/u/oshadura)\
**Post date:** [August 6, 2020, 8:05am UTC](https://root-forum.cern.ch/t/cppyy-getnummethods-for-namespaces/40849/2 "2020-08-06T08:05:03Z")

</div>

@etejedor is in vacation but I hope he will be reply as soon as he will back…

---

<div class="post-metadata">

**Author:** ![etejedor](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/e/e79b87/32.png) [@etejedor](https://root-forum.cern.ch/u/etejedor)\
**Post date:** [August 10, 2020, 12:40pm UTC](https://root-forum.cern.ch/t/cppyy-getnummethods-for-namespaces/40849/3 "2020-08-10T12:40:55Z")

</div>

Hello,

If I understand correctly, you are trying to use an internal Cppyy function from your code? Could you give me some context?

---

<div class="post-metadata">

**Author:** ![alexandrumc](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/c89c15/32.png) [@alexandrumc](https://root-forum.cern.ch/u/alexandrumc)\
**Post date:** [August 11, 2020, 8:29am UTC](https://root-forum.cern.ch/t/cppyy-getnummethods-for-namespaces/40849/4 "2020-08-11T08:29:21Z")

</div>

Hello,

Sorry, no, I’m not calling the internal function, I’m calling this function that calls the internal one:

> <https://github.com/root-project/root/blob/414fbd3862573e603621ebb19d0331279bc65be3/bindings/pyroot/cppyy/cppyy-backend/clingwrapper/src/clingwrapper.cxx#L2384>

The context is simple: I have a `cppyy_scope_t` object which is, in fact, a namespace; for this namespace, I want to know how many free functions are inside it, but I can’t use the function from above because it simply returns 0 for namespaces. So basically I need a workaround for this.

---

<div class="post-metadata">

**Author:** ![etejedor](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/e/e79b87/32.png) [@etejedor](https://root-forum.cern.ch/u/etejedor)\
**Post date:** [August 11, 2020, 10:08am UTC](https://root-forum.cern.ch/t/cppyy-getnummethods-for-namespaces/40849/5 "2020-08-11T10:08:07Z")

</div>

Hi,

I see, if you are trying to implement a C++ library on top of cppyy directly, I would recommend that you use the upstream cppyy (instead of the cppyy distributed with ROOT, see [https://cppyy.readthedocs.io/en/latest/](https://cppyy.readthedocs.io/en/latest/) for more information) and you will be able to get support for cppyy-backend functions from the cppyy developers.
