some operator support for '*'

This commit is contained in:
David Halter
2012-10-04 01:31:57 +02:00
parent 7e39a7d1ba
commit 8795b4fbac
3 changed files with 21 additions and 1 deletions

View File

@@ -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 However, it does not yet support (and probably will in future versions, because
they are on my todo list): they are on my todo list):
- operation support -> [3]\*3 etc.
- manipulations of instances outside the instance variables, without using - manipulations of instances outside the instance variables, without using
functions functions
- assert - assert

View File

@@ -1401,6 +1401,12 @@ def follow_call_list(call_list):
pass pass
continue continue
result += follow_call(call) 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) return set(result)

View File

@@ -31,6 +31,21 @@ b[8-7]
b[8:] b[8:]
# -----------------
# iterable multiplication
# -----------------
a = ['']*2
#? list()
a
a = 2*2
#? int()
a
a = "a"*3
#? str()
a
# ----------------- # -----------------
# tuple assignments # tuple assignments
# ----------------- # -----------------