On 11/07/2013 01:53 PM, Andrey Vlasovskikh wrote:

You should take a look at NumPy docstring conventions which are fully supported 
by Sphinx, and are actually human-readable.

There are two questions here:

1. Where to put type information?

     * Docstrings
         * ReStructured Text 
(http://sphinx-doc.org/domains.html#the-python-domain)
         * Epydoc
         * NumPy
     * Expressions
         * Python 3 function annotations
         * Decorators

You could also put asserts (and expressions which assert the presence of certain attributes) in function bodies. Existing analysis tools should already process those and would only need to implement different error reporting in case a mismatch is detected (because the error is strictly with the caller, not in the skeleton module).

--
Florian Weimer / Red Hat Product Security Team
_______________________________________________
code-quality mailing list
code-quality@python.org
https://mail.python.org/mailman/listinfo/code-quality

Reply via email to