1
0
forked from VimPlug/jedi

reduce/remove getitem side effects, tests for #297

This commit is contained in:
Dave Halter
2014-04-07 16:06:07 +02:00
parent ea62ad6a50
commit 17345b6e78

View File

@@ -71,3 +71,12 @@ class TestInterpreterAPI(TestCase):
self.check_interpreter_complete('getattr(Foo, baz[1:-1]).append',
locals(),
['append'])
def test_getitem_side_effects(self):
class Foo():
def __getitem__(self, index):
# possible side effects here, should therefore not call this.
return index
foo = Foo()
self.check_interpreter_complete('foo[0].', locals(), [])