public void PythonInterop_NamedIndexers1() {
if (!_driver.RunPython) return;
var py = Runtime.GetEngine("python");
ScriptScope scope = py.CreateScope();
py.Execute(@"
class C:
def __init__(self):
self.Foo = Indexable()
class Indexable:
def __setitem__(self, index, value):
print index, value
", scope);
AssertOutput(() =>
Engine.Execute(@"
c = C().new
c.foo[1, 2] = 3
c.Foo[4, 5] = 6
c.send(:foo=, 7, 8, 9)
c.send(:Foo=, 10, 11, 12)
", scope), @"
(1, 2) 3
(4, 5) 6
(7, 8) 9
(10, 11) 12
");
}