Re: [IronPython] Dict convertion question

2006-07-20 Thread JoeSox
On 7/20/06, J. Merrill <[EMAIL PROTECTED]> wrote: > At 01:05 AM 7/20/2006, JoeSox wrote (in part) > >File.WriteAllText(Application.StartupPath + "\\mydict.txt", > >myDict.ToCodeString()); > >(This results in a file size of 1,540,096 bytes which was created in about a > >second.) > > I don't know

Re: [IronPython] Dict convertion question

2006-07-20 Thread Dino Viehland
That could be really slow right now as we'll do all the code gen, compilation, etc... only to run it once. We have an experimental option called FastEval (-X:FastEval) that might speed that up as well, but unfortunately I don't think it works for everything. -Original Message- From: [

Re: [IronPython] Dict convertion question

2006-07-20 Thread J. Merrill
You should really try executing the ToCodeString result At 12:49 PM 7/20/2006, JoeSox wrote >On 7/20/06, Bruce Christensen <[EMAIL PROTECTED]> wrote: >> What is the nature of the dict that you're trying to save? > >It's a >{4: [6, 4278, 44657, 30279, 58912, 67939, 18551, 33653, 28303, 6692,

Re: [IronPython] Dict convertion question

2006-07-20 Thread Bruce Christensen
Sometimes. :) ToCodeString() from .NET is the same as repr() from Python. So if you stick to simple things like lists, dicts, strings, etc., then that will work. Once you add objects into the mix, though, all bets are off. --Bruce -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL

Re: [IronPython] Dict convertion question

2006-07-20 Thread Dino Viehland
That will work unless the dict contains some objects who's repr isn't really a usable repr - eg . You could even just read the string from the file & eval it. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of J. Merrill Sent: Thursday, July 20, 2006 12:04

Re: [IronPython] Dict convertion question

2006-07-20 Thread J. Merrill
At 01:05 AM 7/20/2006, JoeSox wrote (in part) >File.WriteAllText(Application.StartupPath + "\\mydict.txt", >myDict.ToCodeString()); >(This results in a file size of 1,540,096 bytes which was created in about a >second.) I don't know much about ToCodeString, but from the name, it should produce a

Re: [IronPython] Dict convertion question

2006-07-20 Thread JoeSox
On 7/20/06, Bruce Christensen <[EMAIL PROTECTED]> wrote: > What is the nature of the dict that you're trying to save? It's a {4: [6, 4278, 44657, 30279, 58912, 67939, 18551, 33653, 28303, 6692, 4827, 110144, 18920, 15569, 11571, 77917, 7968, 10137, 14154, 33180, 12544, 54062, 159370, 9495], 11: [

Re: [IronPython] Dict convertion question

2006-07-20 Thread Bruce Christensen
Thanks for the feedback. In CPython, there are actually two implementations of pickle: one written in Python (pickle) and one written in C (cPickle). Only the Python version of pickle is available in beta 9, but we're hoping to include an implementation of cPickle, which should be quite a bit faste

Re: [IronPython] Typing problem with vendor library?

2006-07-20 Thread Martin Maly
The problem is that the method is called with int as the last parameter, but the two overloads in question take “ref Int16” and “ref UInt16”. So the conversion is happening in the opposite direction and IronPython cannot safely choose between Int16 and UInt16 given that the input is Int32.