# Python help function on ROOT class methods

**URL:** <https://root-forum.cern.ch/t/python-help-function-on-root-class-methods/34328>\
**Category:** Newbie\
**Tags:** python\
**Created:** [May 30, 2019, 7:19am UTC](https://root-forum.cern.ch/t/python-help-function-on-root-class-methods/34328 "2019-05-30T07:19:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![antonio.iuliano2](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/antonio.iuliano2/32/24948_2.png) [@antonio.iuliano2](https://root-forum.cern.ch/u/antonio.iuliano2)\
**Post date:** [May 30, 2019, 7:19am UTC](https://root-forum.cern.ch/t/python-help-function-on-root-class-methods/34328/1 "2019-05-30T07:19:38Z")

</div>

Dear ROOT experts,

I am learning how to write a ROOT C++ class and load it in a Python script.

It works fine, but I am wondering if I can add documentation to be intercepted by the help python function.

Explaining, is there something similar to the ‘’’ comment ‘’’ notation at the start of a python function?

Best regards,  
Antonio

---

<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:** [May 31, 2019, 8:20am UTC](https://root-forum.cern.ch/t/python-help-function-on-root-class-methods/34328/2 "2019-05-31T08:20:23Z")

</div>

Dear Antonio,

By default PyROOT adds a docstring to every method in a class which tells you the C++ signature of that method, you can check it with `ROOT.YourClass.YourMethod. __doc__ `. Regarding classes, no docstring is added.

I am not aware of any mechanism implemented yet to pick documentation specified in the C++ code and show it on the Python side. PyROOT allows you to assign (from Python) some value to the ` __doc__ ` attribute of a class (`ROOT.YourClass. __doc__ = "SomeString"`) and that will show up when you do `help(ROOT.YourClass)`, but the same is not true for methods - PyROOT will prevent you from writing the docstring.

Enric

---

<div class="post-metadata">

**Author:** ![antonio.iuliano2](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/antonio.iuliano2/32/24948_2.png) [@antonio.iuliano2](https://root-forum.cern.ch/u/antonio.iuliano2)\
**Post date:** [June 4, 2019, 7:00am UTC](https://root-forum.cern.ch/t/python-help-function-on-root-class-methods/34328/3 "2019-06-04T07:00:36Z")

</div>

Thank you for the answer,

I will then just refer to the comments in the C++ code manually.

Best regards,  
Antonio
