mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 14:34:31 +08:00
full python 2.5-3.2 compatibility. but 2.5 isn't fully tested, because that's not possible
This commit is contained in:
@@ -50,15 +50,15 @@ inst.var
|
||||
#? ['var_class', 'var_func']
|
||||
TestClass.var
|
||||
|
||||
#? ['real']
|
||||
inst.var_local.real
|
||||
#? int()
|
||||
inst.var_local
|
||||
#? []
|
||||
TestClass.var_local.real
|
||||
TestClass.var_local.
|
||||
|
||||
#? ['real']
|
||||
TestClass().ret(1).real
|
||||
#? ['real']
|
||||
inst.ret(1).real
|
||||
#? int()
|
||||
TestClass().ret(1)
|
||||
#? int()
|
||||
inst.ret(1)
|
||||
|
||||
myclass = TestClass(1, '', 3.0)
|
||||
#? int()
|
||||
@@ -67,8 +67,8 @@ myclass.get_first()
|
||||
myclass.get_first.real
|
||||
|
||||
# too many params
|
||||
#? ['real']
|
||||
TestClass(1,1,1).var_inst.real
|
||||
#? int()
|
||||
TestClass(1,1,1).var_inst
|
||||
|
||||
# too few params
|
||||
#? int()
|
||||
@@ -85,10 +85,10 @@ myclass.second_new
|
||||
# multiple classes / ordering
|
||||
ints = TestClass(1, 1.0)
|
||||
strs = TestClass("", '')
|
||||
#? ['real']
|
||||
ints.second.real
|
||||
#? ['upper']
|
||||
strs.second.upper
|
||||
#? float()
|
||||
ints.second
|
||||
#? str()
|
||||
strs.second
|
||||
|
||||
#? ['var_class']
|
||||
TestClass.var_class.var_class.var_class.var_class
|
||||
|
||||
@@ -4,33 +4,27 @@
|
||||
a = ""
|
||||
a = 1
|
||||
|
||||
#? ['real']
|
||||
a.real
|
||||
#? []
|
||||
a.upper
|
||||
#? int()
|
||||
a
|
||||
#? []
|
||||
a.append
|
||||
|
||||
a = list
|
||||
|
||||
b = 1; b = ""
|
||||
#? ['upper']
|
||||
b.upper
|
||||
#? []
|
||||
b.real
|
||||
#? str()
|
||||
b
|
||||
|
||||
a = 1
|
||||
temp = b;
|
||||
b = a
|
||||
a = temp
|
||||
#? ['real']
|
||||
b.real
|
||||
#? []
|
||||
b.upper
|
||||
#? []
|
||||
a.real
|
||||
#? ['upper']
|
||||
a.upper
|
||||
#? int()
|
||||
b
|
||||
#? int()
|
||||
b
|
||||
#? str()
|
||||
a
|
||||
|
||||
a = tuple
|
||||
if 1:
|
||||
@@ -45,51 +39,35 @@ a.index
|
||||
# tuples exchanges
|
||||
# -----------------
|
||||
a, b = 1, ""
|
||||
#? ['real']
|
||||
a.real
|
||||
#? []
|
||||
a.upper
|
||||
#? []
|
||||
b.real
|
||||
#? ['upper']
|
||||
b.upper
|
||||
#? int()
|
||||
a
|
||||
#? str()
|
||||
b
|
||||
|
||||
b, a = a, b
|
||||
#? ['real']
|
||||
b.real
|
||||
#? []
|
||||
b.upper
|
||||
#? []
|
||||
a.real
|
||||
#? ['upper']
|
||||
a.upper
|
||||
#? int()
|
||||
b
|
||||
#? str()
|
||||
a
|
||||
|
||||
b, a = a, b
|
||||
#? ['real']
|
||||
a.real
|
||||
#? []
|
||||
a.upper
|
||||
#? []
|
||||
b.real
|
||||
#? ['upper']
|
||||
b.upper
|
||||
#? int()
|
||||
a
|
||||
#? str()
|
||||
b
|
||||
|
||||
# -----------------
|
||||
# function stuff
|
||||
# -----------------
|
||||
def a(a=3):
|
||||
#? ['real']
|
||||
a.real
|
||||
#? []
|
||||
a.upper
|
||||
#? int()
|
||||
a
|
||||
#? []
|
||||
a.func
|
||||
return a
|
||||
|
||||
#? ['real']
|
||||
a(2).real
|
||||
#? []
|
||||
a(2).upper
|
||||
#? int()
|
||||
a(2)
|
||||
#? []
|
||||
a(2).func
|
||||
# -----------------
|
||||
@@ -98,22 +76,16 @@ a(2).func
|
||||
class A(object):
|
||||
a = ""
|
||||
a = 3
|
||||
#? ['real']
|
||||
a.real
|
||||
#? []
|
||||
a.upper
|
||||
#? []
|
||||
a.append
|
||||
#? int()
|
||||
a
|
||||
# TODO remove this line!!
|
||||
a = list()
|
||||
def __init__(self):
|
||||
self.b = ""
|
||||
self.b = 3
|
||||
#? ['real']
|
||||
self.b.real
|
||||
##? []
|
||||
self.b.upper
|
||||
##? []
|
||||
self.b.append
|
||||
# TODO should this be so?
|
||||
#? int() str() list()
|
||||
self.b
|
||||
|
||||
self.b = list
|
||||
|
||||
@@ -147,12 +119,8 @@ a.append
|
||||
#? []
|
||||
a.real
|
||||
|
||||
#? ['append']
|
||||
a.a.append
|
||||
#? ['real']
|
||||
a.a.real
|
||||
#? ['upper']
|
||||
a.a.upper
|
||||
#? list() str() int()
|
||||
a.a
|
||||
|
||||
# -----------------
|
||||
# class stuff
|
||||
@@ -166,8 +134,8 @@ math.cosh
|
||||
math.real
|
||||
|
||||
math = 3
|
||||
#? ['real']
|
||||
math.real
|
||||
#? int()
|
||||
math
|
||||
#? []
|
||||
math.cos
|
||||
|
||||
@@ -180,5 +148,5 @@ from math import *
|
||||
cosh.real
|
||||
|
||||
cosh = 3
|
||||
#? ['real']
|
||||
cosh.real
|
||||
#? int()
|
||||
cosh
|
||||
|
||||
@@ -54,8 +54,8 @@ dic2 = {'asdf': 3}
|
||||
#? ['popitem']
|
||||
dic2.popitem
|
||||
|
||||
#? ['real']
|
||||
dic2['asdf'].real
|
||||
#? int()
|
||||
dic2['asdf']
|
||||
|
||||
# -----------------
|
||||
# set
|
||||
|
||||
@@ -126,6 +126,9 @@ def test_dir(completion_test_dir, third_party=False):
|
||||
global tests_pass
|
||||
for f_name in os.listdir(completion_test_dir):
|
||||
if len(sys.argv) == 1 or [a for a in sys.argv[1:] if a in f_name]:
|
||||
if sys.hexversion < 0x02060000 \
|
||||
and f_name in ['generators.py', 'types.py']:
|
||||
continue
|
||||
if f_name.endswith(".py"):
|
||||
if third_party:
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user