Hi, I am having trouble figuring out how to set up an object to be scriptable through the C API. An example of what I am attempting to do:
>>> obj = foo.Foo() >>> obj["key"] Traceback (most recent call last): File "<stdin>", line 1, in ? TypeError: unsubscriptable object >>> I've tried defining __getitem__ as a method, but that hasn't worked. Is there a tp_field that I am failing to understand, something like tp_iter and tp_iternext? thanks~ -- http://mail.python.org/mailman/listinfo/python-list