mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-08 06:44:46 +08:00
% operation returned both left and right side, but only the left side is really important.
This commit is contained in:
@@ -244,4 +244,8 @@ def _element_calculate(evaluator, left, operator, right):
|
||||
elif operator == '-':
|
||||
if _is_number(left) and _is_number(right):
|
||||
return [create(evaluator, left.obj - right.obj)]
|
||||
elif operator == '%':
|
||||
# With strings and numbers the left type typically remains. Except for
|
||||
# `int() % float()`.
|
||||
return [left]
|
||||
return [left, right]
|
||||
|
||||
@@ -84,3 +84,13 @@ return_one(''.undefined_attribute)
|
||||
@undefined_decorator
|
||||
def func():
|
||||
return 1
|
||||
|
||||
# -----------------
|
||||
# operators
|
||||
# -----------------
|
||||
|
||||
string = '%s %s' % (1, 2)
|
||||
|
||||
# Shouldn't raise an error, because `string` is really just a string, not an
|
||||
# array or something.
|
||||
string.upper
|
||||
|
||||
Reference in New Issue
Block a user