forked from VimPlug/jedi
support for unicode/str and float/int literals (different returns)
This commit is contained in:
@@ -837,13 +837,10 @@ def follow_call(scope, call):
|
|||||||
if isinstance(current, parsing.Array):
|
if isinstance(current, parsing.Array):
|
||||||
result = [Array(current)]
|
result = [Array(current)]
|
||||||
else:
|
else:
|
||||||
# TODO add better care for int/unicode, now str/float are just used
|
|
||||||
# instead
|
|
||||||
if not isinstance(current, parsing.NamePart):
|
if not isinstance(current, parsing.NamePart):
|
||||||
if current.type == parsing.Call.STRING:
|
if current.type in (parsing.Call.STRING, parsing.Call.NUMBER):
|
||||||
scopes = get_scopes_for_name(builtin.Builtin.scope, 'str')
|
t = type(current.name).__name__
|
||||||
elif current.type == parsing.Call.NUMBER:
|
scopes = get_scopes_for_name(builtin.Builtin.scope, t)
|
||||||
scopes = get_scopes_for_name(builtin.Builtin.scope, 'float')
|
|
||||||
else:
|
else:
|
||||||
debug.warning('unknown type:', current.type, current)
|
debug.warning('unknown type:', current.type, current)
|
||||||
# make instances of those number/string objects
|
# make instances of those number/string objects
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ a.
|
|||||||
|
|
||||||
def gen():
|
def gen():
|
||||||
yield 1
|
yield 1
|
||||||
yield ""
|
yield u""
|
||||||
|
|
||||||
gen_exe = gen()
|
gen_exe = gen()
|
||||||
|
|
||||||
|
|||||||
@@ -241,5 +241,5 @@ gen_exe = gen()
|
|||||||
next(gen_exe).upper
|
next(gen_exe).upper
|
||||||
#? ['real']
|
#? ['real']
|
||||||
next(gen_exe).real
|
next(gen_exe).real
|
||||||
#? float() str()
|
#? int() str()
|
||||||
next(gen_exe)
|
next(gen_exe)
|
||||||
|
|||||||
Reference in New Issue
Block a user