1
0
forked from VimPlug/jedi

dynamic docstring improvements

This commit is contained in:
David Halter
2013-02-23 22:21:34 +04:30
parent e8feb0b7d2
commit 68ace0d05b
+10 -9
View File
@@ -2,25 +2,25 @@
To understand Python on a deeper level, |jedi| needs to understand some of the To understand Python on a deeper level, |jedi| needs to understand some of the
dynamic features of Python, however this probably the most complicated part: dynamic features of Python, however this probably the most complicated part:
- Array modifications (e.g. `list.append`) - Array modifications (e.g. ``list.append``)
- Parameter completion in functions - Parameter completion in functions
- Flow checks (e.g. `if isinstance(a, str)` -> a is a str) - Flow checks (e.g. ``if isinstance(a, str)`` -> a is a str)
Array modifications Array modifications
******************* *******************
If the content of an array (`set`/`list`) is wanted somewhere, the current If the content of an array (``set``/``list``) is wanted somewhere, the current
module will be checked for appearances of `arr.append`, `arr.insert`, etc. If module will be checked for appearances of ``arr.append``, ``arr.insert``, etc.
the `arr` name points to an actual array, the content will be added If the ``arr`` name points to an actual array, the content will be added
This can be really cpu intensive, as you can imagine. Because |jedi| has to This can be really cpu intensive, as you can imagine. Because |jedi| has to
follow **every** `append`. However this works pretty good, because in *slow* follow **every** ``append``. However this works pretty good, because in *slow*
cases, the recursion detector and other settings will stop this process. cases, the recursion detector and other settings will stop this process.
It is important to note that: It is important to note that:
1. Array modfications work only in the current module 1. Array modfications work only in the current module
2. Only Array additions are being checked, `list.pop`, etc. is being ignored. 2. Only Array additions are being checked, ``list.pop``, etc. is being ignored.
Parameter completion Parameter completion
******************** ********************
@@ -36,10 +36,11 @@ There's no doubt wheter bar is an ``int`` or not, but if there's also a call
like ``foo('str')``, what would happen? Well, we'll just show both. Because like ``foo('str')``, what would happen? Well, we'll just show both. Because
that's what a human would expect. that's what a human would expect.
It works as follows:: It works as follows:
- A param is being encountered - A param is being encountered
- search for function calls named ``foo`` - search for function calls named ``foo``
- execute these calls and check the injected params. This work with an - execute these calls and check the injected params. This work with a
``ParamListener``. ``ParamListener``.
Flow checks Flow checks