Added a type hinting recipe to docs (refs #133)

This commit is contained in:
Danilo Bargen
2013-02-16 14:03:49 +01:00
parent 860d5a061f
commit d3947a6dc7
3 changed files with 47 additions and 1 deletions

View File

@@ -13,7 +13,8 @@ General Features
- ignores syntax errors and wrong indentation
- can deal with complex module / function / class structures
- virtualenv support
- can infer function arguments from sphinx and epydoc docstrings
- can infer function arguments from sphinx and epydoc docstrings (:ref:`type
hinting <type-hinting>`)
Supported Python Features

44
docs/docs/recipes.rst Normal file
View File

@@ -0,0 +1,44 @@
.. include:: ../global.rst
Recipes
=======
Here are some tips on how to use |jedi| efficiently.
.. _type-hinting:
Type Hinting
------------
If |jedi| cannot detect the type of a function argument correctly (due to the
dynamic nature of Python), you can help it by hinting the type using
Sphinx-style info field lists or Epydoc docstrings.
**Sphinx style**
http://sphinx-doc.org/domains.html#info-field-lists
::
def myfunction(node):
"""Do something with a ``node``.
:type node: ProgramNode
"""
node.| # complete here
**Epydoc**
http://epydoc.sourceforge.net/manual-fields.html
::
def myfunction(node):
"""Do something with a ``node``.
@param node: ProgramNode
"""
node.| # complete here

View File

@@ -22,6 +22,7 @@ Docs
docs/installation
docs/features
docs/recipes
docs/plugin-api
docs/history
docs/development