Python structured docstrings IDE compatible

In PHP, I was used for the PHPdoc syntax:

/** Do something useful
@param first    Primary data
@return int
@throws BadException
*/
function($first){ ...

- a short useful link: it is very convenient when you only need to remember what it is, especially for third-party libraries. In addition, all IDEs can display this in pop-up tooltips.

There seems to be no convention in Python: just text. He describes things well, but it's too long to be a digest.

Ok, let it be so. But in my applications, I don't want to use piles of plaintext.

Are there any known conventions? But how to document class attributes ?! PyCharm IDE recipes are especially welcome :)


Python3 has PEP 3107 for functional annotations. This is not useful for 2.x (2.6, specifically)

PEP 0287 reStructuredText: , .

+3
2

numpydoc , reStructuredText ( python) Sphinx. , PyCharm, numpydoc.

Sphinx : http://sphinx.pocoo.org/ext/autodoc.html?highlight=autoattribute

+1

epydoc. reStructured Text HTML- ( javadoc).

+2

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


All Articles