mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 14:04:26 +08:00
Added a type hinting recipe to docs (refs #133)
This commit is contained in:
@@ -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
44
docs/docs/recipes.rst
Normal 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
|
||||
@@ -22,6 +22,7 @@ Docs
|
||||
|
||||
docs/installation
|
||||
docs/features
|
||||
docs/recipes
|
||||
docs/plugin-api
|
||||
docs/history
|
||||
docs/development
|
||||
|
||||
Reference in New Issue
Block a user