1
0
forked from VimPlug/jedi

string additions also work now - be prepared #24!

This commit is contained in:
Dave Halter
2014-03-09 12:36:17 +01:00
parent 70e1970f40
commit b22c9c96f2
2 changed files with 30 additions and 1 deletions

View File

@@ -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