1
0
forked from VimPlug/jedi

Merge branch 'master' of github.com:davidhalter/jedi

This commit is contained in:
Dave Halter
2015-09-30 14:59:43 +02:00
4 changed files with 21 additions and 4 deletions

View File

@@ -97,7 +97,7 @@ You can run Jedi on cPython 2.6, 2.7, 3.2, 3.3 or 3.4, but it should also
understand/parse code older than those versions.
Tips on how to use Jedi efficiently can be found `here
<https://jedi.readthedocs.org/en/latest/docs/recipes.html>`_.
<https://jedi.readthedocs.org/en/latest/docs/features.html#recipes>`_.
API
---

View File

@@ -62,8 +62,8 @@ class Script(object):
:type source: str
:param line: The line to perform actions on (starting with 1).
:type line: int
:param col: The column of the cursor (starting with 0).
:type col: int
:param column: The column of the cursor (starting with 0).
:type column: int
:param path: The path of the file in the file system, or ``''`` if
it hasn't been saved yet.
:type path: str or None

View File

@@ -242,7 +242,7 @@ class Evaluator(object):
except (IndexError, AttributeError):
pass
else:
if isinstance(comp_for, tree.CompFor):
if isinstance(comp_for, tree.CompFor) and c[0] != '{':
return [iterable.Comprehension.from_atom(self, atom)]
return [iterable.Array(self, atom)]

View File

@@ -50,6 +50,23 @@ left
##? str()
{a-1:b for a,b in {1:'a', 3:1.0}.items()}[0]
# with a set literal
#? int()
[a for a in {1, 2, 3}][0]
#? set()
{a for a in range(10)}
##? int()
[x for x in {a for a in range(10)}][0]
##? int()
{a for a in range(10)}.pop()
##? int()
iter({a for a in range(10)}).next()
# list comprehensions should also work in combination with functions
def listen(arg):
for x in arg: