PyCharm docstrings associated with classes

IntelliJ IDEA allows you to reference other methods in comments on Java documents. This allows me to move the cursor over a character and jump to a definition using a keyboard shortcut, as well as hold down the ctrl key while hovering over the mouse, displaying an underline under the character that you can click. For instance:

/** * This is a link to a method {@link #setBalance} */ 

I am trying to achieve this in Python using PyCharm. I tried different things from other answers with no luck. Here are a few attempts:

 def my_func(my_arg): ''' Convert a S{decimal.Decimal} to an :ref:`int`. This method imports a module called :mod:``django``. Sometimes we might call :func:`~utils.error` to raise an {@link Exception}. ''' 

None of these autocomplete or hyperlink creation.

Maybe PyCharm just didn't implement this function (yet)?

This question is similar to the Class Method Reference in python docstring , but the answers do not seem to apply to PyCharm.

+12
source share
2 answers

I contacted the support service, and it turned out that it was not implemented.

I created a request for a function to track their problems:

https://youtrack.jetbrains.com/issue/PY-14743

Update:

the original function request is marked as duplicate

https://youtrack.jetbrains.com/issue/PY-27635

Condition: in progress

+12
source
 def die_hard(self): """ Throws a :class:'NakatomiPlazaError'. """ raise NakatomiPlazaError('Yippee ki-yay') 

Worked for me.

+5
source

Source: https://habr.com/ru/post/1209032/


All Articles