Re: [IronPython] mapping C# iterators to Python iterator

2007-12-03 Thread Dino Viehland
I think there's a bug here in that we're not defining __iter__ on Stack (it's enumerable but it doesn't support indexing it's items). There's not a whole lot of objects that are like that :) I've opened a bug to track this issue: http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId

Re: [IronPython] mapping C# iterators to Python iterator

2007-12-03 Thread amit
sorry for the bad indentation this should be more readable. class Dummy(object): def __init__(self, iterObj): self.iterObj = iterObj self.index = 0 def next(self): temp = self.index if self.index == self.iterObj.Count:

Re: [IronPython] mapping C# iterators to Python iterator

2007-12-03 Thread amit
thanks tonnes Dino. :) I did as you said and got it working for ArrayList class. Now I am struggling with another issue the problem is in the below code wherein I could return ArrayList values with __getitem__ For other classes say 'Stack' though it wont work because it wont have __getitem__ I

Re: [IronPython] ipy.exe crashes after attempting import in VS 2008 command window

2007-12-03 Thread Dino Viehland
You should be able to get a better stack trace by putting the MS public symbol server in your symbol path. In VS that's Tools->Options->Debugging->Symbols and then add: SRV*DownstreamStore*http://msdl.microsoft.com/download/symbols Where DownstreamStore is some directory like C:\Symbols. You

Re: [IronPython] mapping C# iterators to Python iterator

2007-12-03 Thread Dino Viehland
To map these to .NET's IEnumerator/IEnumerable you just need to define __iter__ or __getitem__. If you define __iter__ you should return something that is enumerable (implements IEnumerable or has a next method which we'll call until it throws to stop enumeration). If you define __getitem__ we

Re: [IronPython] ipy.exe crashes after attempting import in VS 2008 command window

2007-12-03 Thread David . Lawler
Hi, just a user here - but I tried this to see if I could reproduce it and could not- sorry. My environment: Python 2.4.4 and Python 2.5.1, Windows XP SP2, Visual Studio Beta 2, the released version of .net 3.5 and IP 2A6. In the VS command line with either version of python I do not get a cra