1
0
forked from VimPlug/jedi

Better examples

This commit is contained in:
Dave Halter
2020-03-14 15:42:16 +01:00
parent bdb36ab626
commit fbba7714e4
2 changed files with 12 additions and 11 deletions

View File

@@ -126,11 +126,12 @@ References:
>>> rns = script.get_references(5, 8) >>> rns = script.get_references(5, 8)
>>> rns >>> rns
[<Definition full_name='__main__.x', description='x = 3'>, [<Definition full_name='__main__.x', description='x = 3'>,
<Definition full_name='__main__.x', description='x'>] <Definition full_name='__main__.x', description='x = 4'>,
<Definition full_name='__main__.x', description='del x'>]
>>> rns[1].line >>> rns[1].line
5 3
>>> rns[0].column >>> rns[1].column
8 4
Deprecations Deprecations
------------ ------------
@@ -138,5 +139,5 @@ Deprecations
The deprecation process is as follows: The deprecation process is as follows:
1. A deprecation is announced in the next major/minor release. 1. A deprecation is announced in the next major/minor release.
2. We wait either at least a year & at least two minor releases until we remove 2. We wait either at least a year and at least two minor releases until we
the deprecated functionality. remove the deprecated functionality.

View File

@@ -661,6 +661,8 @@ class Interpreter(Script):
""" """
Jedi API for Python REPLs. Jedi API for Python REPLs.
Implements all of the methods that are present in :class:`.Script` as well.
In addition to completion of simple attribute access, Jedi In addition to completion of simple attribute access, Jedi
supports code completion based on static code analysis. supports code completion based on static code analysis.
Jedi can complete attributes of object which is not initialized Jedi can complete attributes of object which is not initialized
@@ -676,17 +678,15 @@ class Interpreter(Script):
def __init__(self, source, namespaces, **kwds): def __init__(self, source, namespaces, **kwds):
""" """
Parse `source` and mixin interpreted Python objects from `namespaces`. Parse ``source`` and mixin interpreted Python objects from ``namespaces``.
:type source: str :type source: str
:arg source: Code to parse. :arg source: Code to parse.
:type namespaces: list of dict :type namespaces: list of dict
:arg namespaces: a list of namespace dictionaries such as the one :arg namespaces: a list of namespace dictionaries such as the one
returned by :func:`locals`. returned by :func:`globals`.
Other optional arguments are same as the ones for :class:`Script`. Other optional arguments are same as the ones for :class:`.Script`.
If `line` and `column` are None, they are assumed be at the end of
`source`.
""" """
try: try:
namespaces = [dict(n) for n in namespaces] namespaces = [dict(n) for n in namespaces]