Refactor execute_operation a bit

This commit is contained in:
Dave Halter
2020-01-12 13:01:08 +01:00
parent bd2ed8dbbd
commit 11a12d6ca8
7 changed files with 36 additions and 17 deletions

View File

@@ -300,6 +300,17 @@ some_dct['b']
#? int() float() str()
some_dct['c']
class Foo:
pass
objects = {object(): 1, Foo: '', Foo(): 3.0}
#? int() float() str()
objects[Foo]
#? int() float() str()
objects[Foo()]
#? int() float() str()
objects['']
# -----------------
# with variable as index
# -----------------

View File

@@ -56,6 +56,12 @@ a
(3 ** 3)
#? int() str()
(3 ** 'a')
#? int() str()
(3 + 'a')
#? bool()
(3 == 'a')
#? bool()
(3 >= 'a')
class X():
foo = 2

View File

@@ -206,6 +206,7 @@ current_dirname = os.path.basename(dirname(dirname(dirname(__file__))))
('example.py', '"test%scomp' % s, None, ['letion' + s]),
('example.py', 'r"comp"', None, []),
('example.py', 'r"tes"', None, []),
('example.py', '1 + r"tes"', None, []),
('example.py', 'r"tes"', 5, ['t' + s]),
('example.py', 'r" tes"', 6, []),
('test%sexample.py' % se, 'r"tes"', 5, ['t' + s]),