mirror of
https://github.com/davidhalter/jedi.git
synced 2026-01-31 09:35:22 +08:00
Merge master into linter.
This commit is contained in:
@@ -51,6 +51,26 @@ left
|
||||
#? int()
|
||||
[a for a in {1:'x'}][0]
|
||||
|
||||
##? 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:
|
||||
|
||||
@@ -4,3 +4,24 @@ raise
|
||||
|
||||
#? ['except', 'Exception']
|
||||
except
|
||||
|
||||
#? []
|
||||
b + continu
|
||||
|
||||
#? []
|
||||
b + continue
|
||||
|
||||
#? ['continue']
|
||||
b; continue
|
||||
|
||||
#? ['continue']
|
||||
b; continu
|
||||
|
||||
#? []
|
||||
c + brea
|
||||
|
||||
#? []
|
||||
a + break
|
||||
|
||||
#? ['break']
|
||||
b; break
|
||||
|
||||
@@ -65,6 +65,15 @@ class X(): pass
|
||||
#? type
|
||||
type(X)
|
||||
|
||||
# -----------------
|
||||
# enumerate
|
||||
# -----------------
|
||||
for i, j in enumerate(["as", "ad"]):
|
||||
#? int()
|
||||
i
|
||||
#? str()
|
||||
j
|
||||
|
||||
# -----------------
|
||||
# re
|
||||
# -----------------
|
||||
|
||||
@@ -295,9 +295,12 @@ def collect_dir_tests(base_dir, test_files, check_thirdparty=False):
|
||||
skip = 'Thirdparty-Library %s not found.' % lib
|
||||
|
||||
path = os.path.join(base_dir, f_name)
|
||||
source = open(path).read()
|
||||
if not is_py3:
|
||||
source = unicode(source, 'UTF-8')
|
||||
|
||||
if is_py3:
|
||||
source = open(path, encoding='utf-8').read()
|
||||
else:
|
||||
source = unicode(open(path).read(), 'UTF-8')
|
||||
|
||||
for case in collect_file_tests(StringIO(source),
|
||||
lines_to_execute):
|
||||
case.path = path
|
||||
|
||||
Reference in New Issue
Block a user