forked from VimPlug/jedi
string additions also work now - be prepared #24!
This commit is contained in:
@@ -2,6 +2,9 @@
|
||||
Test Jedi's operation understanding. Jedi should understand simple additions,
|
||||
multiplications, etc.
|
||||
"""
|
||||
# -----------------
|
||||
# numbers
|
||||
# -----------------
|
||||
x = [1, 'a', 1.0]
|
||||
|
||||
#? int() str() float()
|
||||
@@ -23,3 +26,29 @@ constant = 1
|
||||
|
||||
#? float()
|
||||
x[calculate(1)]
|
||||
|
||||
def calculate(number):
|
||||
return number + constant
|
||||
|
||||
# -----------------
|
||||
# strings
|
||||
# -----------------
|
||||
|
||||
class FooBar(object):
|
||||
muahaha = 3.0
|
||||
raboof = 'fourtytwo'
|
||||
|
||||
x = 'mua' + 'ha'
|
||||
|
||||
#? float()
|
||||
getattr(FooBar, x + 'ha')
|
||||
|
||||
|
||||
# github #24
|
||||
target = u''
|
||||
for char in reversed(['f', 'o', 'o', 'b', 'a', 'r']):
|
||||
target += char
|
||||
|
||||
answer = getattr(FooBar, target)
|
||||
##? str()
|
||||
answer
|
||||
|
||||
Reference in New Issue
Block a user