[IronPython] Iteration via __getitem__ doesn't work in the Visual Studio debugging environment
tony.meyer at gmail.com
Thu Sep 9 02:05:16 CEST 2010
I have this program:
self.data = range(5)
def __getitem__(self, item):
a = A()
for v in a:
i.e. there's a class that gets iteration through the __getitem__
method. When run with IronPython in the shell (or with CPython), you
get the expected result:
C:\>"c:\Programs\IronPython 2.7\ipy.exe" Program.py
Underneath, of course, this is doing a, a, a, a, a, and
stopping when a raises an IndexError.
When I run this in Visual Studio, the debugger catches the IndexError,
so this doesn't work. It seems like the exception should be allowed
to propagate further, so that the iteration works - but maybe this
just isn't compatible with how the debugger works?
(It's easy enough to fix this by defining _iter__, of course).
Is this a bug? Or just a limitation of how the debugging environment works?
More information about the Ironpython-users