mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 14:04:26 +08:00
some operator support for '*'
This commit is contained in:
@@ -65,7 +65,6 @@ Jedi supports many of the widely used Python features:
|
||||
However, it does not yet support (and probably will in future versions, because
|
||||
they are on my todo list):
|
||||
|
||||
- operation support -> [3]\*3 etc.
|
||||
- manipulations of instances outside the instance variables, without using
|
||||
functions
|
||||
- assert
|
||||
|
||||
@@ -1401,6 +1401,12 @@ def follow_call_list(call_list):
|
||||
pass
|
||||
continue
|
||||
result += follow_call(call)
|
||||
elif call == '*':
|
||||
if [r for r in result if isinstance(r, Array)
|
||||
or isinstance(r, Instance)
|
||||
and str(r.name) == 'str']:
|
||||
# if it is an iterable, ignore * operations
|
||||
next(calls_iterator)
|
||||
return set(result)
|
||||
|
||||
|
||||
|
||||
@@ -31,6 +31,21 @@ b[8-7]
|
||||
b[8:]
|
||||
|
||||
|
||||
# -----------------
|
||||
# iterable multiplication
|
||||
# -----------------
|
||||
a = ['']*2
|
||||
#? list()
|
||||
a
|
||||
|
||||
a = 2*2
|
||||
#? int()
|
||||
a
|
||||
|
||||
a = "a"*3
|
||||
#? str()
|
||||
a
|
||||
|
||||
# -----------------
|
||||
# tuple assignments
|
||||
# -----------------
|
||||
|
||||
Reference in New Issue
Block a user