From sanxiyn at gmail.com Wed Mar 1 01:53:07 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Wed, 1 Mar 2006 09:53:07 +0900 Subject: [IronPython] CLS compliance In-Reply-To: <4404826A.9090105@daimi.au.dk> References: <4404826A.9090105@daimi.au.dk> Message-ID: <5b0248170602281653y1224458dn@mail.gmail.com> 2006/3/1, Peter Mechlenborg : > I would be very interested in information describing how to do this as > a programmer and also how it has been implemented. Does any such > information exist? Well, you can read the complete source code of IronPython. Yes, it uses reflection to consume CLS types. Seo Sanghyeon From dinov at exchange.microsoft.com Wed Mar 1 02:24:51 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 28 Feb 2006 17:24:51 -0800 Subject: [IronPython] CLS compliance In-Reply-To: <4404B9EC.5020906@daimi.au.dk> Message-ID: <4039D552ADAB094BB1EA670F3E96214E01BEAC45@df-foxhound-msg.exchange.corp.microsoft.com> Great summary of the problem space. First, let's look at your first Point class. One aside on the CLR: we do have the concept of value types & reference types so int is a primitive. But the CLR also supports boxing (and C# has auto-boxing) so we can just box that int up into an object. We can then do the cast back to an int which will unbox it (the cast is also C#'s syntax for unboxing value types). We currently have 2 different ways in which built-in functions are called. One is via our ReflectedMethod class which uses a late-bound dynamic invocation after using reflection to match parameters (including overload resolution). The other code path is our optimized path using BuiltinFunction's where we generate a dynamic method that will perform the method binding and do an early-bound (early here being defined as at the time the dynamic method is generated, but it still doesn't happen at call time). That has me jumping to the end of your mail: this is how we handle CLS consumption. We also allow CLS extension (you can derive from built-in types) by dynamically creating a single CLS class that derives from the base class (actually a single class for each object/interface combo). This class will override all of the virtual methods w/ a helper function that will check if the user has replaced the function from Python. Therefore: class foo(list): def __getitem__(self, index): return 'abc' and you pass an instance off to C# code: object ConsumesAList(IList foo){ return foo[0]; } returns 'abc' and not the IronPython List's implementation's get_Item. So that's how you can actually inherit from a built-in type in the CLR. Ok, so now we get to the production side of things... All the options you mention are possible... For our CodeDOM implementation we will consume @accepts and @returns syntax (as described in PEP 318 and implemented in the non-standard typecheck library). This is the 'extra decoration' approach to getting the type information. Inference is nice but it also has additional problems. Even if we infer the types you're using or expecting correctly, how do we know those are the types you want? Maybe you really want to expose something that accepts objects! And ultimately exposing APIs that only take objects isn't that bad. It allows C# code to call the Python code, and it allows the Python code to receive anything it wants. The C# programmer is a little upset because they don't get their rich type info but that's tough for them, Python APIs will accept any inputs. The other interesting case here is inheritance where we presumably do know the real type information, and can therefore generate correct overrides. But I don't personally see that as the biggest problem. I'd be happy to live in a world where my Python code only exposed object signatures, at least as a starter solution. To me the biggest issue is how can we maintain Python compatibility while at the same time creating this static-type view of the Python world. That problem starts with class definitions (in Python class definitions are executable statements) and carries through to doing things like changing a method at runtime (where a normal CLS producer should call the changed method, not the statically compiled method). And obviously there's lots of other challenges in this space as well - hence the reason we don't yet have a solution here :) Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Peter Mechlenborg Sent: Tuesday, February 28, 2006 1:00 PM To: Discussion of IronPython Subject: Re: [IronPython] CLS compliance Dino Viehland wrote: > IronPython can consume CLS types and extend them, but cannot produce > new CLS types. Unfortunately that last part is extremely tricky > because CLR types are not dynamic, but Python types are. It is > something that's on our radar but we don't yet have a solution for it. Thanks for the quick answer. Up front I must say that my knowledge about Python and CLR is limited, so I hope that the following is not completely wrong. My understanding is that the general way of targeting a dynamic language towards a static VM/language is to escape through the common root type, i.e., Object, and then use runtime casts to perform runtime type checks. The following code fragment should illustrate this through the use of a Point class, using Java-like syntax: class Point { Object x,y; void move(Object xx, Object yy) { x = (int)x + (int)xx; y = (int)y + (int)yy; } } The fields and arguments are qualified by Object, but cast to integer before the addition in the move method. I'm assuming that integers are objects and not primitive types, I'm not sure how it would look if integers were primitive. If the above code was generated from a untyped language, and we wanted to expose the move method and the Point class through the CLS, we need some extra type information. I'm not sure how to do this, but ideas could be optional type declarations, some kind of IDL, or type inference, and in my eyes this is the biggest problem when trying to produce CLS compliant code from a dynamic language. If we have the extra type information we can create wrapper methods with more specific type declarations: class Point { Object x,y; void cls_move(int xx, int yy) { this.move((Object) xx, (Object) yy); } void move (Object xx, Object yy) { ... } } Here cls_move should be used by foreign languages, while move should be use natively; in general giving objects two separate interfaces, one for foreign code, and one for native code (I'm regarding the fields as private). What I sketched above is properly too simplistic, but would the general idea work of wrapper methods work for code produced by IronPython? (Maybe the hardest problem is all the little details). I'm quite interested in how you have implemented consumption of CLS types, because I don't see an obvious way of doing this. If we reverse the Point example: class Point { int x,y; void move(int xx, int yy) { x = x + xx; y = y + yy; } } Point is now written in a static language, and we would like to use it from IronPython. In this case all arguments passed from the callee to the move method must be qualified as int, but in IronPython the type of the arguments are not known. One solution is to create wrapper objects around all foreign objects, and that way provide a single location that can translate dynamic calls into static calls. This however adds extra overhead, and also complicates inheritance because the wrapper would have to use delegation, which does not preserve the self/this reference, which again conflicts with overriding of methods. I think delegation would be needed because CLS only supports single inheritance for classes. It might also be possible to use reflection, and make all calls to foreign objects in a reflective way. Am I missing something obvious? What is your general strategy for consumption of CLS types in IronPython? > > Do you want to help develop Dynamic languages on CLR? > (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) It does seem like a very interesting job. Its nice to see some focus on dynamic languages. Have fun, -- Peter _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From kfarmer at thuban.org Wed Mar 1 08:08:41 2006 From: kfarmer at thuban.org (Keith J. Farmer) Date: Tue, 28 Feb 2006 23:08:41 -0800 Subject: [IronPython] CLS compliance Message-ID: Source code and API listings are merely implementation details; they generally do a poor job of explaining why a thing is done a certain way, and so are of limited scope in education. ----- Keith J. Farmer // kfarmer at thuban.org -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Sanghyeon Seo Sent: Tuesday, 28 February 2006 16:53 Well, you can read the complete source code of IronPython. Yes, it uses reflection to consume CLS types. From metch at daimi.au.dk Wed Mar 1 09:18:41 2006 From: metch at daimi.au.dk (Peter Mechlenborg) Date: Wed, 01 Mar 2006 09:18:41 +0100 Subject: [IronPython] CLS compliance In-Reply-To: <4039D552ADAB094BB1EA670F3E96214E01BEAC45@df-foxhound-msg.exchange.corp.microsoft.com> References: <4039D552ADAB094BB1EA670F3E96214E01BEAC45@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <440558E1.50201@daimi.au.dk> Thank you for the detailed explanation. Dino Viehland wrote: > Great summary of the problem space. First, let's look at your first > Point class. One aside on the CLR: we do have the concept of value > types & reference types so int is a primitive. But the CLR also > supports boxing (and C# has auto-boxing) so we can just box that int > up into an object. We can then do the cast back to an int which will > unbox it (the cast is also C#'s syntax for unboxing value types). > > We currently have 2 different ways in which built-in functions are > called. One is via our ReflectedMethod class which uses a late-bound > dynamic invocation after using reflection to match parameters > (including overload resolution). The other code path is our optimized > path using BuiltinFunction's where we generate a dynamic method that > will perform the method binding and do an early-bound (early here > being defined as at the time the dynamic method is generated, but it > still doesn't happen at call time). > > That has me jumping to the end of your mail: this is how we handle CLS > consumption. We also allow CLS extension (you can derive from > built-in types) by dynamically creating a single CLS class that > derives from the base class (actually a single class for each > object/interface combo). This class will override all of the virtual > methods w/ a helper function that will check if the user has replaced > the function from Python. Therefore: > > class foo(list): > def __getitem__(self, index): > return 'abc' > > and you pass an instance off to C# code: > > object ConsumesAList(IList foo){ > return foo[0]; > } > > returns 'abc' and not the IronPython List's implementation's get_Item. > So that's how you can actually inherit from a built-in type in the > CLR. Ok, that seems like a much better solution than the delegation stuff I wrote about. > > Ok, so now we get to the production side of things... All the options > you mention are possible... For our CodeDOM implementation we will > consume @accepts and @returns syntax (as described in PEP 318 and > implemented in the non-standard typecheck library). This is the > 'extra decoration' approach to getting the type information. Ok. > > Inference is nice but it also has additional problems. Even if we > infer the types you're using or expecting correctly, how do we know > those are the types you want? Maybe you really want to expose > something that accepts objects! Yes, that's correct, I hadn't thought about that. > And ultimately exposing APIs that > only take objects isn't that bad. It allows C# code to call the > Python code, and it allows the Python code to receive anything it > wants. The C# programmer is a little upset because they don't get > their rich type info but that's tough for them, Python APIs will > accept any inputs. :-). I guess there will always be a dilemma about whether typed languages should take precedence over untyped, or the other way around. > > The other interesting case here is inheritance where we presumably do > know the real type information, and can therefore generate correct > overrides. > > But I don't personally see that as the biggest problem. I'd be happy > to live in a world where my Python code only exposed object > signatures, at least as a starter solution. To me the biggest issue > is how can we maintain Python compatibility while at the same time > creating this static-type view of the Python world. > > That problem starts with class definitions (in Python class > definitions are executable statements) and carries through to doing > things like changing a method at runtime (where a normal CLS producer > should call the changed method, not the statically compiled method). > And obviously there's lots of other challenges in this space as well - > hence the reason we don't yet have a solution here :) This is definitely a hard problem. In my opinion the CLR and also the JVM are too focused on static languages (not just static types). This makes it difficult to target image based language, such as Smalltalk and Common lisp to, and I guess also Python and Ruby, on these platforms. The JVM is getting a dynamic-invoke instruction, and I think this will make it much easier to target the JVM with dynamic languages, do you know if similar plans exist for the CLR? Anyway, keep up the good work, stay cool, and have fun, -- Peter From metch at daimi.au.dk Wed Mar 1 09:30:22 2006 From: metch at daimi.au.dk (Peter Mechlenborg) Date: Wed, 01 Mar 2006 09:30:22 +0100 Subject: [IronPython] CLS compliance In-Reply-To: <5b0248170602281653y1224458dn@mail.gmail.com> References: <4404826A.9090105@daimi.au.dk> <5b0248170602281653y1224458dn@mail.gmail.com> Message-ID: <44055B9E.2040802@daimi.au.dk> Sanghyeon Seo wrote: > 2006/3/1, Peter Mechlenborg : > >>I would be very interested in information describing how to do this as >>a programmer and also how it has been implemented. Does any such >>information exist? > > > Well, you can read the complete source code of IronPython. I have looked a bit on the source code, but my Python and C# is not up to speed :-). Luckily Dino's answer contains the information I was looking for. > > Yes, it uses reflection to consume CLS types. Ok, thanks. > > Seo Sanghyeon -- Peter From snaury at gmail.com Wed Mar 1 11:40:22 2006 From: snaury at gmail.com (Snaury) Date: Wed, 1 Mar 2006 13:40:22 +0300 Subject: [IronPython] IronPython hungs when creating Excel.Application Message-ID: The following code hungs when creating Excel.Application, by the CPU usage I can guess it is doing something, but I never had enough patience to wait if it ever unhungs. Is this supposed behaviour, or am I doing something wrong? import System # Workaround for MS Excel bug print "Setting en-US culture..." System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo("en-US") # Now try to create Excel Application print "Getting Excel.Application typeref" typeref = System.Type.GetTypeFromProgID("Excel.Application") print "Creating Excel.Application object" xlApp = System.Activator.CreateInstance(typeref) xlApp.Visible = true xlApp.UserControl = true From paparipote at hotmail.com Wed Mar 1 16:32:53 2006 From: paparipote at hotmail.com (Paparipote .) Date: Wed, 01 Mar 2006 11:32:53 -0400 Subject: [IronPython] IronPython hungs when creating Excel.Application Message-ID: I only made a correction, I replaced true by True and run your code without problems. It did not hang my Win Xp computer; instead, it generated an Excel session. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From snaury at gmail.com Wed Mar 1 16:42:53 2006 From: snaury at gmail.com (Snaury) Date: Wed, 1 Mar 2006 18:42:53 +0300 Subject: [IronPython] IronPython hungs when creating Excel.Application In-Reply-To: References: Message-ID: Ah! I'm really sorry. Today I tried with IronPython Beta 3 and it misteriously worked. =^_^= I didn't realize I never tried it with Beta 3, just somehow assumed I did... x_x On 3/1/06, Paparipote . wrote: > I only made a correction, I replaced true by True and run your code without > problems. It did not hang my Win Xp computer; instead, it generated an Excel > session. > > _________________________________________________________________ > MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From joshua.kugler at uaf.edu Wed Mar 1 19:09:40 2006 From: joshua.kugler at uaf.edu (Joshua Kugler) Date: Wed, 1 Mar 2006 09:09:40 -0900 Subject: [IronPython] CLS compliance In-Reply-To: References: Message-ID: <200603010909.40927.joshua.kugler@uaf.edu> On Tuesday 28 February 2006 22:08, Keith J. Farmer wrote: > > Well, you can read the complete source code of IronPython. > > > > Yes, it uses reflection to consume CLS types. > > Source code and API listings are merely implementation details; they > generally do a poor job of explaining why a thing is done a certain way, > and so are of limited scope in education. > Properly (even heavily) commented source *should* explain why things are done a certain way. They should go beyond simple things like, "Check to make sure we're not over some limit." If the source code is to be understandable to newbies (or even new hires), comments should fully explain architecture, design decisions, and code flow. Of course, I've yet to run into a project that does this well. Hopefully, a couple of my upcoming projects at work will have more comments than source code. :) j----- k----- -- Joshua Kugler PGP Key: http://pgp.mit.edu/ CDE System Administrator ID 0xDB26D7CE http://distance.uaf.edu/ From info at geatec.com Wed Mar 1 21:59:38 2006 From: info at geatec.com (J. de Hooge) Date: Wed, 1 Mar 2006 21:59:38 +0100 Subject: [IronPython] Fallen over: from sys import * Message-ID: <000001c63d73$0e6f33e0$6402a8c0@GEADELL> Hi, IP team, thanks for the new version! I've just started trying out my code on it. Seems that the following detail doesn't work anymore in Beta 3, used to work upto Beta 2 from sys import * The following is reported: Traceback (most recent call last): File C:\activ_dell\prog\qQuick\try\try.py, line 1, in Initialize StandardError: Exception has been thrown by the target of an invocation. Following workaround will require some prefixing but does the job: import sys Kind regards Jacques de Hooge info at geatec.com P.S. I've uploaded some free IP stuff to www.qquick.org . For people interested in using WinForms in combination with IP, especially the file view.py is worth looking at. -------------- next part -------------- An HTML attachment was scrubbed... URL: From kfarmer at thuban.org Wed Mar 1 22:27:37 2006 From: kfarmer at thuban.org (Keith J. Farmer) Date: Wed, 1 Mar 2006 13:27:37 -0800 Subject: [IronPython] comments vs docs (was RE: CLS compliance) References: <200603010909.40927.joshua.kugler@uaf.edu> Message-ID: At that point, the source code often becomes unreadable. At least, for me. Personally, I need the code to be more or less intact, rather than balkanized. What I think needs to happen is something similar to MS Word's comments view (where various people's comments are stored in the doc file, but are displayed as marginalia). An IDE could interpret either an external file, or some extended comment block, and pull that away from the main part of the source, so that it is still intact, but the callouts are still accessible. It still doesn't address "Why are visitors a good way to transform ASTs?", or the like. Instead, it's still focussed on the particular implementation, and thus can easily become desynchronized. It's the more general "How do you build a compiler, and why are certain tradeoffs made?" that I think the OP was asking about. Something too broad of scope to be good comment fodder, IMHO. "Read the source" then becomes a non-answer. ________________________________ From: users-bounces at lists.ironpython.com on behalf of Joshua Kugler Sent: Wed 3/1/2006 10:09 AM To: users at lists.ironpython.com Subject: Re: [IronPython] CLS compliance On Tuesday 28 February 2006 22:08, Keith J. Farmer wrote: > > Well, you can read the complete source code of IronPython. > > > > Yes, it uses reflection to consume CLS types. > > Source code and API listings are merely implementation details; they > generally do a poor job of explaining why a thing is done a certain way, > and so are of limited scope in education. > Properly (even heavily) commented source *should* explain why things are done a certain way. They should go beyond simple things like, "Check to make sure we're not over some limit." If the source code is to be understandable to newbies (or even new hires), comments should fully explain architecture, design decisions, and code flow. Of course, I've yet to run into a project that does this well. Hopefully, a couple of my upcoming projects at work will have more comments than source code. :) j----- k----- -- Joshua Kugler PGP Key: http://pgp.mit.edu/ CDE System Administrator ID 0xDB26D7CE http://distance.uaf.edu/ _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From swheatley at gmail.com Wed Mar 1 23:09:45 2006 From: swheatley at gmail.com (Shawn Wheatley) Date: Wed, 1 Mar 2006 17:09:45 -0500 Subject: [IronPython] clr.AddRefernce* woes In-Reply-To: <003901c63939$f8700d90$0200a8c0@cartman> References: <1140775341.43fed9ae04026@webmail.raincode.com> <003901c63939$f8700d90$0200a8c0@cartman> Message-ID: Hi All! I just got back from PyCon, where I got to see Martin Maly's talk on IronPython. I see that Beta 3 is causing quite a bit of problems. I seem to be having more problems than most, but that may be due to how I set up my environment. Could someone help me? Here's what I did: 1) Downloaded the latest IP beta and unpacked to C:\Program Files\IronPython-1-Beta3 2) Added C:\Program Files\IronPython-1-Beta3 to my path 3) Created a batch file to launch IronPythonConsole: "C:\Program Files\IronPython-1-Beta3\IronPythonConsole" %1 %2 %3 %4 %5 %6 %7 %8 %9 4) When trying to do any import that involves a reference, I get an error: C:\Program Files\IronPython-1-Beta3>ipc IronPython 1.0.2237 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import clr >>> import System >>> clr.AddReference(System.Reflection.Assembly.Load('System.Xml')) Traceback (most recent call last): File , line 0, in input##76 IOError: Could not load file or assembly 'System.Xml' or one of its dependencies . The system cannot find the file specified. >>> clr.AddReference(System.Reflection.Assembly.LoadFrom('System.Xml')) Traceback (most recent call last): File , line 0, in input##94 IOError: Could not load file or assembly 'file:///C:\Program Files\IronPython-1- Beta3\System.Xml' or one of its dependencies. The system cannot find the file sp ecified. >>> clr.AddReference(System.Reflection.Assembly.LoadWithPartialName('System.Xml' )) Process is terminated due to StackOverflowException. C:\Program Files\IronPython-1-Beta3> If anybody could help me out I'd really appreciate it. Thanks, Shawn Wheatley On 2/24/06, Dan Shechter wrote: > Worked like a charm! Thanks! > > Just one note, if you want to make this completely "generic" You need to > >>>clr.AddAssembly(System.Reflection.Assembly.LoadFrom( > System.Environment.CurrentDirectory + > System.IO.Path.DirectorySeparatorChar + > "MYDLL.DLL")) > > Danke! > > -----Original Message----- > From: Stanislas Pinte [mailto:stan at phidani.be] > Sent: Friday, February 24, 2006 12:02 > To: Discussion of IronPython; Dan Shechter > Cc: 'Discussion of IronPython' > Subject: Re: [IronPython] clr.AddRefernce* woes > > Selon Dan Shechter : > > > Perhaps I wasn't being clear: > > I have been able to use your suggested workaround to load .NET "Core" > > assemblies such as System.Xml etc. > > I am able to do that with the following code: (don't know if it is the > recommended way) > > ClrModule.AddAssembly(Assembly.LoadFrom(currentDirName + > Path.DirectorySeparatorChar + > "MyPackage.dll")); > > --> all namespaces inside MyPackage.dll are then magically available in the > python engine. > > > > > My problem is that I don't have a working workaround for Assemblies like > > mapack.dll or my own assemblies which reside in some other directory (like > > the IronPython tutorial directory). > > > > -----Original Message----- > > From: users-bounces at lists.ironpython.com > > [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland > > Sent: Friday, February 24, 2006 04:08 > > To: Discussion of IronPython > > Subject: Re: [IronPython] clr.AddRefernce* woes > > > > There were a couple of bugs w/ assembly loading in beta 3. > > > > As a work around you should be able to do: > > > > import System > > clr.AddReference(System.Reflection.Assembly.Load('System.Xml')) > > > > clr.AddReference(System.Reflection.Assembly.LoadFrom('System.Xml')) > > > > > clr.AddReference(System.Reflection.Assembly.LoadWithPartialName('System.Xml' > > )) > > > > > > Obviously we'll have it fixed in beta 4. > > > > > > Do you want to help develop Dynamic languages on CLR? > > > (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F > > 0-45DF-8B78-DC1B43134038) > > > > -----Original Message----- > > From: users-bounces at lists.ironpython.com > > [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Shechter > > Sent: Thursday, February 23, 2006 4:19 PM > > To: users at lists.ironpython.com > > Subject: [IronPython] clr.AddRefernce* woes > > > > Hi, > > I've just installed beta 3 drop but I can't use clr.AddReference to > anything > > that isn't part of .NET 2.0 core libraries. > > I'm trying to load a .NET 2.0 compiled assembly. "PERWAPI.dll", I have a > > test.exe console c# program > > which does invoke methods and instantiate classes defined within that DLL. > > I'm also having problems with the tutorial "demo" using mapack.dll., I've > > provided a transcript below: > > ---------------------------------------- CUT HERE > > ---------------------------- > > >>> import clr > > >>> clr.AddReference("System.XML") > > - Crashed > > > > >>> import clr > > >>> clr.AddReferenceByPartialName("System.XML") > > - works > > > > >>> clr.AddReferenceByPartialName("Mapack") > > Traceback (most recent call last): > > File , line 0, in input##152 > > File , line 0, in AddReferenceByPartialName##81 > > RuntimeError: Could not add reference to assembly Mapack > > > > >>> clr.Path > > [] > > > > >>> clr.Path.append(System.Environment.CurrentDirectory) > > > > >>> clr.Path > > ['C:\\Development\\IronPython\\Tutorial'] > > > > >>> clr.AddReferenceByPartialName("Mapack") > > - Crashed > > ---------------------------------------- CUT HERE > > ---------------------------- > > > > Naturally the same happens for PERWAPI.dll (which I'm really interested in > > getting to work) and naturally, > > Both .DLLs (PERWAPI.DLL & MAPACK.DLL) are in the ' > > C:\Development\IronPython\Tutorial'' on my machine... > > > > Any ideas? > > > > > > > > _______________________________________________ > > users mailing list > > users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ > > users mailing list > > users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > > _______________________________________________ > > users mailing list > > users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > > > > > > > > > > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From Martin.Maly at microsoft.com Wed Mar 1 23:40:56 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Wed, 1 Mar 2006 14:40:56 -0800 Subject: [IronPython] clr.AddRefernce* woes In-Reply-To: Message-ID: <5C0A6F919D675745BB1DBA7412DB68F501AD896C@df-foxhound-msg.exchange.corp.microsoft.com> Hi Shawn, Good to see you playing with IronPython! I may have mentioned it in the talk, or certainly in several hallway discussions, we shipped 1.0 Beta 3 with an unfortunate infinite recursion in the clr.AddReference code. The bad news is that mostly everyone hits this, the good news (and actually the only reason why we didn't ship refresh immediately right after we discovered the problem) is that there is a workaround. For System.Xml, you can use (and this is copied from the released 1.0 Beta 3 console: IronPython 1.0.2237 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import clr >>> clr.AddReferenceByPartialName("System.Xml") >>> from System.Xml import * >>> d = XmlDocument() >>> Since the stack overflow also hits the case when you try to pass an assembly directly into the clr.AddReference( ... ), even if Assembly.LoadFrom found your library, you'd hit the bug also. To import ANY library directly from the file, you can use this code. The trick is to tell IronPython where to look for your DLLs. To do that, you can call: clr.Path.Add(path) a special case in the code below being: clr.Path.Add(System.Environment.CurrentDirectory) Whole code follows: C:\IronPython-1.0-Beta3>IronPythonConsole.exe IronPython 1.0.2237 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import clr >>> import System >>> clr.Path.Add(System.Environment.CurrentDirectory) 0 >>> clr.AddReferenceToFile("x.dll") >>> import Hello >>> Hello.Method() 'Hello' >>> I hope this helps. Again, if it wasn't for these workarounds, we'd have released an update, but as things are now (and with the pre-PyCon craze) we made the call to publicize the workarounds and fix more bugs rather than spend the time on an additional release. We apologize if it was a wrong call. The next release of IronPython will be coming out mid next week so stay tuned. Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Shawn Wheatley Sent: Wednesday, March 01, 2006 2:10 PM To: Discussion of IronPython Subject: Re: [IronPython] clr.AddRefernce* woes Hi All! I just got back from PyCon, where I got to see Martin Maly's talk on IronPython. I see that Beta 3 is causing quite a bit of problems. I seem to be having more problems than most, but that may be due to how I set up my environment. Could someone help me? Here's what I did: 1) Downloaded the latest IP beta and unpacked to C:\Program Files\IronPython-1-Beta3 2) Added C:\Program Files\IronPython-1-Beta3 to my path 3) Created a batch file to launch IronPythonConsole: "C:\Program Files\IronPython-1-Beta3\IronPythonConsole" %1 %2 %3 %4 %5 %6 %7 %8 %9 4) When trying to do any import that involves a reference, I get an error: C:\Program Files\IronPython-1-Beta3>ipc IronPython 1.0.2237 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import clr >>> import System >>> clr.AddReference(System.Reflection.Assembly.Load('System.Xml')) Traceback (most recent call last): File , line 0, in input##76 IOError: Could not load file or assembly 'System.Xml' or one of its dependencies . The system cannot find the file specified. >>> clr.AddReference(System.Reflection.Assembly.LoadFrom('System.Xml')) Traceback (most recent call last): File , line 0, in input##94 IOError: Could not load file or assembly 'file:///C:\Program Files\IronPython-1- Beta3\System.Xml' or one of its dependencies. The system cannot find the file sp ecified. >>> clr.AddReference(System.Reflection.Assembly.LoadWithPartialName('System.Xml' )) Process is terminated due to StackOverflowException. C:\Program Files\IronPython-1-Beta3> If anybody could help me out I'd really appreciate it. Thanks, Shawn Wheatley From Martin.Maly at microsoft.com Wed Mar 1 23:57:25 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Wed, 1 Mar 2006 14:57:25 -0800 Subject: [IronPython] Fallen over: from sys import * In-Reply-To: <000001c63d73$0e6f33e0$6402a8c0@GEADELL> Message-ID: <5C0A6F919D675745BB1DBA7412DB68F501AD899E@df-foxhound-msg.exchange.corp.microsoft.com> Thanks for the repro, Jacques. We already have fix for this one so it will be in the next week's release. Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of J. de Hooge Sent: Wednesday, March 01, 2006 1:00 PM To: users at lists.ironpython.com Subject: [IronPython] Fallen over: from sys import * Hi, IP team, thanks for the new version! I've just started trying out my code on it. Seems that the following detail doesn't work anymore in Beta 3, used to work upto Beta 2 from sys import * The following is reported: Traceback (most recent call last): File C:\activ_dell\prog\qQuick\try\try.py, line 1, in Initialize StandardError: Exception has been thrown by the target of an invocation. Following workaround will require some prefixing but does the job: import sys Kind regards Jacques de Hooge info at geatec.com P.S. I've uploaded some free IP stuff to www.qquick.org. For people interested in using WinForms in combination with IP, especially the file view.py is worth looking at. -------------- next part -------------- An HTML attachment was scrubbed... URL: From hanu_man_ji at hotmail.com Thu Mar 2 02:21:26 2006 From: hanu_man_ji at hotmail.com (jai hanuman) Date: Wed, 1 Mar 2006 20:21:26 -0500 Subject: [IronPython] basic questions References: Message-ID: i'm trying to incorporate scripting to a windows app. i'm trying to find out the pros and cons of Ironpython, VSA, and VSTA. can someone provide me some pointers when to use which? regards jai hanuman From thane at magna-capital.com Thu Mar 2 04:26:29 2006 From: thane at magna-capital.com (Thane Plummer) Date: Wed, 1 Mar 2006 22:26:29 -0500 Subject: [IronPython] basic questions In-Reply-To: Message-ID: <001201c63da9$193949b0$6603a8c0@Dell9150> The C++ guys would be glad to provide you with pointers. The Managed C++ people will give you pointers, but only safe ones. The C# group will give you pointers, but only if they _really_ have to. The Python group gives you pointers all the time, but you're never really aware of it. But seriously ... I had the same question about 2 years ago and was able to make use of Python.NET from Brian Lloyd at Zope. To really answer this question you need to identify how the scripting will be used. Will you only make system calls? Will users make scripts of scripts? Is it mainly for short-cuts and/or macro-type functions in your program? What data types do your users need to create or reference? By clearly defining the use of scripts you narrow the field of contenders. My short answer is that IP can probably scan the greatest spectrum of applicability; anything from scripts that simply wrap function calls, i.e. open an explorer window with this URL, to self-contained programs that create windows and respond to system events. Good luck! -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of jai hanuman Sent: Wednesday, March 01, 2006 8:21 PM To: users at lists.ironpython.com Subject: [IronPython] basic questions i'm trying to incorporate scripting to a windows app. i'm trying to find out the pros and cons of Ironpython, VSA, and VSTA. can someone provide me some pointers when to use which? regards jai hanuman _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dingyi.lin at gmail.com Thu Mar 2 04:54:51 2006 From: dingyi.lin at gmail.com (peter lin) Date: Thu, 2 Mar 2006 11:54:51 +0800 Subject: [IronPython] basic questions In-Reply-To: <001201c63da9$193949b0$6603a8c0@Dell9150> References: <001201c63da9$193949b0$6603a8c0@Dell9150> Message-ID: <4a8b0de20603011954i3868aff2s@mail.gmail.com> I also have the same question. Here is my situation. The data is in MSSQL, I would like to use IP to write some scripts like rule check , and this will usually need data from more than two tables and more data from other table while rule checking, I have to think this way because different customer has different rules to check, so I will either use plugin or script language to make the application more dynamically. I have successfully use T-SQL to handle this issue. If I have to deal with DB in script file, what is the best way you can recommend me to use? Thanks. 2006/3/2, Thane Plummer : > > The C++ guys would be glad to provide you with pointers. > The Managed C++ people will give you pointers, but only safe ones. > The C# group will give you pointers, but only if they _really_ have to. > The Python group gives you pointers all the time, but you're never really > aware of it. > > But seriously ... > > I had the same question about 2 years ago and was able to make use of > Python.NET from Brian Lloyd at Zope. To really answer this question you > need to identify how the scripting will be used. Will you only make > system > calls? Will users make scripts of scripts? Is it mainly for short-cuts > and/or macro-type functions in your program? What data types do your > users > need to create or reference? By clearly defining the use of scripts you > narrow the field of contenders. > > My short answer is that IP can probably scan the greatest spectrum of > applicability; anything from scripts that simply wrap function calls, i.e. > open an explorer window with this URL, to self-contained programs that > create windows and respond to system events. > > Good luck! > > -----Original Message----- > From: users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] On Behalf Of jai hanuman > Sent: Wednesday, March 01, 2006 8:21 PM > To: users at lists.ironpython.com > Subject: [IronPython] basic questions > > i'm trying to incorporate scripting to a windows app. i'm trying to find > out > > the pros and cons of Ironpython, VSA, and VSTA. can someone provide me > some > pointers when to use which? > regards > jai hanuman > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.kobalczyk at softwaremind.pl Thu Mar 2 08:05:23 2006 From: s.kobalczyk at softwaremind.pl (Szymon Kobalczyk) Date: Thu, 02 Mar 2006 08:05:23 +0100 Subject: [IronPython] basic questions In-Reply-To: References: Message-ID: <44069933.8060008@softwaremind.pl> jai hanuman napisa?(a): > i'm trying to incorporate scripting to a windows app. i'm trying to find out > the pros and cons of Ironpython, VSA, and VSTA. can someone provide me some > pointers when to use which? > regards > Hello, In the past I was using VSA for scripting. It gives you access to JScript and VBScript languages for .NET. At first glance it all looks really nice but the main problem is that these scripts get compiled to IL and allocate memory. So if your scripts change often or you have many small scripts (more like rule or expression evaluator) this won't work. Now Microsoft released VSTA as a replacement, but this system targets totally different scenarios. It is intended to enable macro recording and plugin extensibility in your application similar to VBA mechanisms found in Office. And this is even more heavyweight than VSA as you need first to create and register the object model four your application, VSTA has separate redistributable package and the "dynamic" code is compiled from C# or VB.NET. So currently we are using IronPython witch has proved most flexible and lightweight. We use it as expression and rule evaluator for our workflow engine and in templates for document generator (I should blog on this shortly). I think I should carefully evaluate this tools (and maybe others) and choose one that best fits your scenarios. Regards, Szymon Kobalczyk. From sombrero at gmail.com Thu Mar 2 08:14:22 2006 From: sombrero at gmail.com (Andrew Sutherland) Date: Thu, 2 Mar 2006 02:14:22 -0500 Subject: [IronPython] infinite import loop for nested packages (and fix) Message-ID: <1c3b28d20603012314m47571445qf7e03b29ac929d61@mail.gmail.com> If you have a directory on your python path like so: foo/ __init__.py: import foo.bar as bar bar/ __init__.py: import foo.bar.baz as baz baz.py: print 'Baz imported' testit.py: import foo.bar And you run testit.py, the import process will go into an infinite loop while importing 'foo.bar' because an effort is only made to see if the top-level package already exists. Although it will find 'foo' alright in that fashion, it will repeatedly look up 'foo.bar' because the name traversal logic in Importer::ImportModule finds 'foo' already exists, then goes to import foo.bar again. A solution that works follows. internal static object ImportModule(PythonModule mod, string fullName, bool bottom) { string[] names = fullName.Split('.'); object newmod = null; // Find the most specific already-existing module if we may. // Since the module import mechanism in CPython is not backtracking, // this is a safe behaviour. string nameRemaining = fullName; // (At the conclusion of this loop,) the index of the name thus looked up. In the // event our loop fails, iNameSatisfied will be zero. int iNameSatisfied = names.Length - 1; while(nameRemaining.LastIndexOf('.') >= 0) { if(TryGetExistingModule(nameRemaining, out newmod)) { break; } else { nameRemaining = nameRemaining.Substring(0, nameRemaining.LastIndexOf('.')); iNameSatisfied--; } } if(iNameSatisfied == 0) { newmod = ImportTopFrom(mod, names[0]); } else if (names.Length == 1) { // if we imported before having the assembly // loaded and then loaded the assembly we want // to make the assembly available now. PythonModule pm = newmod as PythonModule; if (pm.InnerModule != null) pm.PackageImported = true; } if (newmod == null) { newmod = ImportTop(mod, names[0]); if (newmod == null) return null; } object next = newmod; for (int i = iNameSatisfied + 1; i < names.Length; i++) { next = ImportFrom(next, names[i]); } return bottom ? next : newmod; } Andrew From Martin.Maly at microsoft.com Thu Mar 2 17:49:06 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Thu, 2 Mar 2006 08:49:06 -0800 Subject: [IronPython] infinite import loop for nested packages (and fix) In-Reply-To: <1c3b28d20603012314m47571445qf7e03b29ac929d61@mail.gmail.com> Message-ID: <5C0A6F919D675745BB1DBA7412DB68F501BA7C83@df-foxhound-msg.exchange.corp.microsoft.com> I believe we already have fix for this one. It will go out in the Beta 4 release next week. Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Andrew Sutherland Sent: Wednesday, March 01, 2006 11:14 PM To: users at lists.ironpython.com Subject: [IronPython] infinite import loop for nested packages (and fix) If you have a directory on your python path like so: foo/ __init__.py: import foo.bar as bar bar/ __init__.py: import foo.bar.baz as baz baz.py: print 'Baz imported' testit.py: import foo.bar And you run testit.py, the import process will go into an infinite loop while importing 'foo.bar' because an effort is only made to see if the top-level package already exists. Although it will find 'foo' alright in that fashion, it will repeatedly look up 'foo.bar' because the name traversal logic in Importer::ImportModule finds 'foo' already exists, then goes to import foo.bar again. A solution that works follows. internal static object ImportModule(PythonModule mod, string fullName, bool bottom) { string[] names = fullName.Split('.'); object newmod = null; // Find the most specific already-existing module if we may. // Since the module import mechanism in CPython is not backtracking, // this is a safe behaviour. string nameRemaining = fullName; // (At the conclusion of this loop,) the index of the name thus looked up. In the // event our loop fails, iNameSatisfied will be zero. int iNameSatisfied = names.Length - 1; while(nameRemaining.LastIndexOf('.') >= 0) { if(TryGetExistingModule(nameRemaining, out newmod)) { break; } else { nameRemaining = nameRemaining.Substring(0, nameRemaining.LastIndexOf('.')); iNameSatisfied--; } } if(iNameSatisfied == 0) { newmod = ImportTopFrom(mod, names[0]); } else if (names.Length == 1) { // if we imported before having the assembly // loaded and then loaded the assembly we want // to make the assembly available now. PythonModule pm = newmod as PythonModule; if (pm.InnerModule != null) pm.PackageImported = true; } if (newmod == null) { newmod = ImportTop(mod, names[0]); if (newmod == null) return null; } object next = newmod; for (int i = iNameSatisfied + 1; i < names.Length; i++) { next = ImportFrom(next, names[i]); } return bottom ? next : newmod; } Andrew _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From swheatley at gmail.com Fri Mar 3 21:46:19 2006 From: swheatley at gmail.com (Shawn Wheatley) Date: Fri, 3 Mar 2006 15:46:19 -0500 Subject: [IronPython] Two Questions: C# "using" statements & MSH/Monad Message-ID: Hi all, Thanks to Martin Maly, I got my first IronPython application up and running. However, I could not figure out how to translate a "using" statement into python syntax: using(some_object) { ... } where "some_object" is garbage collected when no longer used. I don't know of a similar construct in Python (except for "with", coming in Python 2.5, which obviously isn't supported in IronPy... it's not even out yet!) Any ideas? Question #2: Has anybody worked with the System.Management.Automation namespace in IronPython? I'd love to try to work in the power of the MSH cmdlets with the syntax of Python. I got a simple example from the MSH documentation online: http://tinyurl.com/lnqdt Unfortunately, there is no good documentation on the whole namespace, so I'm hacking around with it right now, trying to figure out how to create Commands and pass I/O back and forth. If anybody has tried this with IronPython, please let me know. Thanks! Shawn Wheatley From dinov at exchange.microsoft.com Fri Mar 3 21:57:48 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Fri, 3 Mar 2006 12:57:48 -0800 Subject: [IronPython] Two Questions: C# "using" statements & MSH/Monad In-Reply-To: Message-ID: <4039D552ADAB094BB1EA670F3E96214E01C8536B@df-foxhound-msg.exchange.corp.microsoft.com> Unfortunately on #1 you'll need to setup a try/finally block: try: # use some object finally: some_object.Dispose() I'm not sure about #2. Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Shawn Wheatley Sent: Friday, March 03, 2006 12:46 PM To: Discussion of IronPython Subject: [IronPython] Two Questions: C# "using" statements & MSH/Monad Hi all, Thanks to Martin Maly, I got my first IronPython application up and running. However, I could not figure out how to translate a "using" statement into python syntax: using(some_object) { ... } where "some_object" is garbage collected when no longer used. I don't know of a similar construct in Python (except for "with", coming in Python 2.5, which obviously isn't supported in IronPy... it's not even out yet!) Any ideas? Question #2: Has anybody worked with the System.Management.Automation namespace in IronPython? I'd love to try to work in the power of the MSH cmdlets with the syntax of Python. I got a simple example from the MSH documentation online: http://tinyurl.com/lnqdt Unfortunately, there is no good documentation on the whole namespace, so I'm hacking around with it right now, trying to figure out how to create Commands and pass I/O back and forth. If anybody has tried this with IronPython, please let me know. Thanks! Shawn Wheatley _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From joesox at gmail.com Fri Mar 3 22:07:14 2006 From: joesox at gmail.com (JoeSox) Date: Fri, 3 Mar 2006 13:07:14 -0800 Subject: [IronPython] unexpected token print at :1 Message-ID: <785694cd0603031307r76575850mbe31c14dfe361aad@mail.gmail.com> Can someone explain why I get this error when calling: .... tempobject = (object)global_eng.Evaluate("print \"hello\""); .... --- >>>print "hello" unexpected token print at :1 ---- I've tried stepping thru: public static object eval(ICallerContext context, string expression) { return eval(context, expression, globals(context)); and I just don't understand why it doesn't return "hello" Thanks. -- Joseph From dinov at exchange.microsoft.com Fri Mar 3 22:09:43 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Fri, 3 Mar 2006 13:09:43 -0800 Subject: [IronPython] unexpected token print at :1 In-Reply-To: <785694cd0603031307r76575850mbe31c14dfe361aad@mail.gmail.com> Message-ID: <4039D552ADAB094BB1EA670F3E96214E01C85394@df-foxhound-msg.exchange.corp.microsoft.com> Evaluate can only parse expressions, not statements (and print is a statement). If you have a statement you'd like to Execute you should use the Execute function on the engine instead. These correspond w/ Python's exec statement and the eval built-in function. Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of JoeSox Sent: Friday, March 03, 2006 1:07 PM To: Discussion of IronPython Subject: [IronPython] unexpected token print at :1 Can someone explain why I get this error when calling: .... tempobject = (object)global_eng.Evaluate("print \"hello\""); .... --- >>>print "hello" unexpected token print at :1 ---- I've tried stepping thru: public static object eval(ICallerContext context, string expression) { return eval(context, expression, globals(context)); and I just don't understand why it doesn't return "hello" Thanks. -- Joseph _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From joesox at gmail.com Fri Mar 3 22:41:24 2006 From: joesox at gmail.com (JoeSox) Date: Fri, 3 Mar 2006 13:41:24 -0800 Subject: [IronPython] unexpected token print at :1 In-Reply-To: <4039D552ADAB094BB1EA670F3E96214E01C85394@df-foxhound-msg.exchange.corp.microsoft.com> References: <785694cd0603031307r76575850mbe31c14dfe361aad@mail.gmail.com> <4039D552ADAB094BB1EA670F3E96214E01C85394@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <785694cd0603031341x1ea1caefs8e1ea57bebe54f24@mail.gmail.com> On 3/3/06, Dino Viehland wrote: > Evaluate can only parse expressions, not statements (and print is a statement). If you have a statement you'd like to Execute you should use the Execute function on the engine instead. > > These correspond w/ Python's exec statement and the eval built-in function. Ok, so my next question is global_eng.Execute("print \"hello\""); does not return a Stmt. How do I access it's value? If I am not mistaken, the return statement is held in the Stmt's value. -- Joseph From s.kobalczyk at softwaremind.pl Fri Mar 3 23:02:24 2006 From: s.kobalczyk at softwaremind.pl (Szymon Kobalczyk) Date: Fri, 03 Mar 2006 23:02:24 +0100 Subject: [IronPython] unexpected token print at :1 In-Reply-To: <785694cd0603031341x1ea1caefs8e1ea57bebe54f24@mail.gmail.com> References: <785694cd0603031307r76575850mbe31c14dfe361aad@mail.gmail.com> <4039D552ADAB094BB1EA670F3E96214E01C85394@df-foxhound-msg.exchange.corp.microsoft.com> <785694cd0603031341x1ea1caefs8e1ea57bebe54f24@mail.gmail.com> Message-ID: <4408BCF0.7090809@softwaremind.pl> JoeSox napisa?(a): > Ok, so my next question is > > global_eng.Execute("print \"hello\""); > > does not return a Stmt. How do I access it's value? > If I am not mistaken, the return statement is held in the Stmt's value. > > In Python the value of last statement is stored in special '_' variable. So to read it just use: engine.GetVariable("_"); Note that if you precompile your scripts you must set the last argument of Compile method to true in order for this to work: engine.Compile(script, true); Hope this helps, Szymon Kobalczyk www.geekswithblogs.net/kobush From joesox at gmail.com Fri Mar 3 23:12:16 2006 From: joesox at gmail.com (JoeSox) Date: Fri, 3 Mar 2006 14:12:16 -0800 Subject: [IronPython] unexpected token print at :1 In-Reply-To: <4408BCF0.7090809@softwaremind.pl> References: <785694cd0603031307r76575850mbe31c14dfe361aad@mail.gmail.com> <4039D552ADAB094BB1EA670F3E96214E01C85394@df-foxhound-msg.exchange.corp.microsoft.com> <785694cd0603031341x1ea1caefs8e1ea57bebe54f24@mail.gmail.com> <4408BCF0.7090809@softwaremind.pl> Message-ID: <785694cd0603031412y371ebd3bo250e23b3a05292c3@mail.gmail.com> On 3/3/06, Szymon Kobalczyk wrote: > JoeSox napisa?(a): > > Ok, so my next question is > > > > global_eng.Execute("print \"hello\""); > > > > does not return a Stmt. How do I access it's value? > > If I am not mistaken, the return statement is held in the Stmt's value. > > > > > In Python the value of last statement is stored in special '_' variable. > So to read it just use: > > engine.GetVariable("_"); > > Note that if you precompile your scripts you must set the last argument > of Compile method to true in order for this to work: > > engine.Compile(script, true); I must still be missing something because I received: [System.MissingMemberException] {"'module' object has no attribute '_'"} System.MissingMemberException exception. I am using IronPython 1x beta3 -- Joseph From arman at twinsun.com Sat Mar 4 02:17:13 2006 From: arman at twinsun.com (Arman Bostani) Date: Fri, 03 Mar 2006 17:17:13 -0800 Subject: [IronPython] thread pickling Message-ID: <4408EA99.2080601@twinsun.com> Hi all, A while ago, our company worked with Christian Tismer to implement thread picking using his stackless technology. Its quite nifty in the sense that it allows you to things like thread checkpointing and migration. Given my very limited knowledge of CLR and IronPython's implementation, I'm wondering if this sort of thing can be done (eventually) with IronPython. Basically, if you can properly pickle/unpickle a generator, the problem is solved. Any thoughts are very much appreciated, -arman From kfarmer at thuban.org Sat Mar 4 06:40:37 2006 From: kfarmer at thuban.org (Keith J. Farmer) Date: Fri, 3 Mar 2006 21:40:37 -0800 Subject: [IronPython] New VS SDK out Message-ID: Those interested in making language packages for Visual Studio will be interested in this: http://blogs.msdn.com/aaronmar/archive/2006/03/03/543265.aspx ----- Keith J. Farmer // kfarmer at thuban.org From rcs1000 at amoral.org Sat Mar 4 19:24:23 2006 From: rcs1000 at amoral.org (Robert Smithson) Date: Sat, 04 Mar 2006 18:24:23 +0000 Subject: [IronPython] System.XML and IronPython Message-ID: <4409DB57.1070705@amoral.org> Hi all, Am I being really dumb? I want to access .NET's XML libraries, and I try: from System import * from System.Xml import * and I get: "ImportError: cannot import Xml from System" What am I missing? Thanks, Robert From dinov at exchange.microsoft.com Sat Mar 4 19:57:57 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Sat, 4 Mar 2006 10:57:57 -0800 Subject: [IronPython] System.XML and IronPython In-Reply-To: <4409DB57.1070705@amoral.org> Message-ID: <4039D552ADAB094BB1EA670F3E96214E01D1E507@df-foxhound-msg.exchange.corp.microsoft.com> IronPython first needs to know about the System.Xml assembly. You can load the assembly with: import clr clr.AddReferenceByPartialName('System.xml') and then import System.Xml will succeed. Note there are other clr.AddReference* functions as well to do other loads, but some of them are broken in beta 3 (and will be fixed in beta 4). Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Robert Smithson Sent: Saturday, March 04, 2006 10:24 AM To: users at lists.ironpython.com Subject: [IronPython] System.XML and IronPython Hi all, Am I being really dumb? I want to access .NET's XML libraries, and I try: from System import * from System.Xml import * and I get: "ImportError: cannot import Xml from System" What am I missing? Thanks, Robert _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From jvm_cop at spamcop.net Sun Mar 5 00:42:18 2006 From: jvm_cop at spamcop.net (J. Merrill) Date: Sat, 04 Mar 2006 18:42:18 -0500 Subject: [IronPython] thread pickling In-Reply-To: <4408EA99.2080601@twinsun.com> Message-ID: <4.3.2.7.2.20060304184019.04a9be40@mail.comcast.net> Do you mean "pickle the values returned by invoking the generator until it stops" (e.g. with a for loop) and "unpickle those to a Python list"? Or do you mean something else that's more difficult? It's certainly easy enough to do those two things, isn't it? At 08:17 PM 3/3/2006, Arman Bostani wrote (in part) >Basically, if you can properly pickle/unpickle a generator, the problem is solved. J. Merrill / Analytical Software Corp From bob at redivi.com Sun Mar 5 02:24:09 2006 From: bob at redivi.com (Bob Ippolito) Date: Sat, 4 Mar 2006 17:24:09 -0800 Subject: [IronPython] thread pickling In-Reply-To: <4.3.2.7.2.20060304184019.04a9be40@mail.comcast.net> References: <4.3.2.7.2.20060304184019.04a9be40@mail.comcast.net> Message-ID: He means what he said -- he wants to pickle the generator. That involves saving the whole stack, the bytecode offset, and potentially the bytecode itself. In stackless, it's not restricted to just generators, so it's a bit more useful. In the stackless implementation, you can pickle a running tasklet, send it to another machine, and unpickle it and it will continue where it left off (with some restrictions, of course). You can also use that kind of facility to emulate a functional call/cc I guess, but that's probably a bad idea. -bob On Mar 4, 2006, at 3:42 PM, J. Merrill wrote: > Do you mean "pickle the values returned by invoking the generator > until it stops" (e.g. with a for loop) and "unpickle those to a > Python list"? Or do you mean something else that's more difficult? > > It's certainly easy enough to do those two things, isn't it? > > At 08:17 PM 3/3/2006, Arman Bostani wrote (in part) >> Basically, if you can properly pickle/unpickle a generator, the >> problem is solved. > > > J. Merrill / Analytical Software Corp > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From igouy2 at yahoo.com Sun Mar 5 09:03:13 2006 From: igouy2 at yahoo.com (Isaac Gouy) Date: Sun, 5 Mar 2006 00:03:13 -0800 (PST) Subject: [IronPython] IronPython 1.0 Beta 3 on Mono Message-ID: <20060305080313.73192.qmail@web60512.mail.yahoo.com> With Mono JIT compiler version 1.1.13.2 currently available in Gentoo packages http://packages.gentoo.org/ebuilds/?mono-1.1.13.2 this technique will compile IronPython 1.0 Beta 1 but not Beta 2 or Beta 3 http://shootout.alioth.debian.org/gp4sandbox/benchmark.php?test=all&lang=iron&lang2=iron best wishes, Isaac Sanghyeon Seo wrote: 1. Download and unzip IronPython 1.0 Beta 3. 2. Delete IronMath.dll, IronPython.dll, IronPythonConsole.exe. (We will rebuild.) 3. Change to Src directory. 4. Edit makefile. 4-1. Change "csc" to "gmcs". 4-2. Change "mkdir" to "mkdir -p". 5. Edit IronPython/Compiler/Options.cs. 5-1. Change OptimizeReflectCalls to false at line 43. 6. Type "make". __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From jelleferinga at gmail.com Sun Mar 5 18:47:43 2006 From: jelleferinga at gmail.com (Jelle Feringa / EZCT Architecture & Design Research) Date: Sun, 5 Mar 2006 18:47:43 +0100 Subject: [IronPython] Fwd: mimmicing vb assembly info In-Reply-To: <37fac3b90603050940i13185db8h2e12ee1db90efdf4@mail.gmail.com> References: <37fac3b90603050940i13185db8h2e12ee1db90efdf4@mail.gmail.com> Message-ID: <37fac3b90603050947w5171dee3q772118f55d251fef@mail.gmail.com> Dear Group, I'm making an effort building a simple .Net plugin via IronPython, just to see whether IP will suite my needs. Doing reasonable well, although I'm not sure how I could mimic the following VB.NET code: ---------- Imports System Imports System.Reflection Imports System.Runtime.InteropServices ' General Information about an assembly is controlled through the following ' set of attributes. Change these attribute values to modify the information ' associated with an assembly. ' Review the values of the assembly attributes 'The following GUID is used as the Rhino Plug-In unique ID ---------- This code is needed to have the plugin accepted by the application (rhino, an excellent cad modeller). I'd appreciate any ideas on this. Apologies for such a boring first post on this list... cheers, jelle -------------- next part -------------- An HTML attachment was scrubbed... URL: From jvm_cop at spamcop.net Sun Mar 5 22:49:00 2006 From: jvm_cop at spamcop.net (J. Merrill) Date: Sun, 05 Mar 2006 16:49:00 -0500 Subject: [IronPython] Fwd: mimmicing vb assembly info In-Reply-To: <37fac3b90603050947w5171dee3q772118f55d251fef@mail.gmail.co m> References: <37fac3b90603050940i13185db8h2e12ee1db90efdf4@mail.gmail.com> <37fac3b90603050940i13185db8h2e12ee1db90efdf4@mail.gmail.com> Message-ID: <4.3.2.7.2.20060305164104.0480cd68@mail.comcast.net> As of now, IP has no mechanism for generating attributes -- so you cannot do this purely in IP. What is the interface that Rhino expects a plugin to implement? You could build a VB.Net library that implements it, and does its work (when called) by calling IP code with the PythonEngine class. Good luck.... At 12:47 PM 3/5/2006, Jelle Feringa / EZCT Architecture & Design Research wrote >Dear Group, > > >I'm making an effort building a simple .Net plugin via IronPython, just to see whether IP will suite my needs. >Doing reasonable well, although I'm not sure how I could mimic the following > >VB.NET code: > >---------- > Imports System > Imports System.Reflection > Imports System.Runtime.InteropServices > > ' General Information about an assembly is controlled through the following > ' set of attributes. Change these attribute values to modify the information > > ' associated with an assembly. > ' Review the values of the assembly attributes > > > > > ("United States")> > > > _a_rh_plugin.com")> > > http://www.make_a_rh_plugin.com")> > (" >http://www.make_a_rh_plugin.com/myplugin")> > > > 'The following GUID is used as the Rhino Plug-In unique ID > > >---------- > >This code is needed to have the plugin accepted by the application (rhino, an excellent cad modeller). >I'd appreciate any ideas on this. > > >Apologies for such a boring first post on this list... > >cheers, > > >jelle > >_______________________________________________ >users mailing list >users at lists.ironpython.comhttp://lists.ironpython.com/listinfo.cgi/users-ironpython.com J. Merrill / Analytical Software Corp -------------- next part -------------- An HTML attachment was scrubbed... URL: From KBjorke at nvidia.com Wed Mar 8 22:24:01 2006 From: KBjorke at nvidia.com (Kevin Bjorke) Date: Wed, 8 Mar 2006 13:24:01 -0800 Subject: [IronPython] Embedded - how to deal with the broad lack of __doc__ strings? Message-ID: <590FCAE72E27D54CA1EADE7293BB444F044227D0@hqemmail04.nvidia.com> ...any prefered clean way (other than tr:except every time I look for a __doc__ string) or alternative source of __doc__-like info when accessing .NET assemblies? Thanks (especially if there's a super-obvious answer) KB NVIDIA From dinov at exchange.microsoft.com Thu Mar 9 00:32:09 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 8 Mar 2006 15:32:09 -0800 Subject: [IronPython] Embedded - how to deal with the broad lack of __doc__ strings? In-Reply-To: <590FCAE72E27D54CA1EADE7293BB444F044227D0@hqemmail04.nvidia.com> Message-ID: <4039D552ADAB094BB1EA670F3E96214E01DB40BE@df-foxhound-msg.exchange.corp.microsoft.com> What is throwing when you're trying to get __doc__ from it? In general all methods and types should have __doc__ strings. The methods should include all the possible overloads in the doc string. The types currently will generally only have 'no documentation available'. But one possibility to avoid the exception at least is: def getDoc(obj): if hasattr(obj, '__doc__'): return getattr(obj, '__doc__') return None which at least avoids the exception. Unfortunately there isn't a really good, easy to access, alternate source for the documentation right now. Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Kevin Bjorke Sent: Wednesday, March 08, 2006 1:24 PM To: Discussion of IronPython Subject: [IronPython] Embedded - how to deal with the broad lack of __doc__ strings? ...any prefered clean way (other than tr:except every time I look for a __doc__ string) or alternative source of __doc__-like info when accessing .NET assemblies? Thanks (especially if there's a super-obvious answer) KB NVIDIA _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From liangml at 6636.com Thu Mar 9 02:46:31 2006 From: liangml at 6636.com (liangml) Date: Thu, 9 Mar 2006 09:46:31 +0800 Subject: [IronPython] Default parameters problem In IronPython 1.0 Message-ID: <001401c6431b$4a3f05a0$5200a8c0@Liangml> Hi all: It seems that IronPython has a limit about default parameters. Please see this below, I don't know why the last tow tests work well, but the first one doesn't :( IronPython 1.0.2255 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import System >>> def foo(a,b,c,d=1,e=2): t=System.Text.Encoding.Default.GetBytes(c) >>> foo("aaaa","bbbb","cccc") Traceback (most recent call last): File , line 0, in input##1 File , line 0, in foo File , line 0, in foo Exception: Object reference not set to an instance of an object. >>> def foo(a,b,c,d=1): t=System.Text.Encoding.Default.GetBytes(c) >>> foo("aaaa","bbbb","cccc") >>> def foo(c,d=1,e=2): t=System.Text.Encoding.Default.GetBytes(c) >>> foo("cccc") >>> -------------- next part -------------- An HTML attachment was scrubbed... URL: From haiboluo at exchange.microsoft.com Thu Mar 9 03:16:18 2006 From: haiboluo at exchange.microsoft.com (Haibo Luo) Date: Wed, 8 Mar 2006 18:16:18 -0800 Subject: [IronPython] Default parameters problem In IronPython 1.0 In-Reply-To: <001401c6431b$4a3f05a0$5200a8c0@Liangml> Message-ID: Looks like this issue has been fixed in the coming beta4. Please wait for a few moments. ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of liangml Sent: Wednesday, March 08, 2006 5:47 PM To: users at lists.ironpython.com Subject: [IronPython] Default parameters problem In IronPython 1.0 Hi all: It seems that IronPython has a limit about default parameters. Please see this below, I don't know why the last tow tests work well, but the first one doesn't :( IronPython 1.0.2255 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import System >>> def foo(a,b,c,d=1,e=2): t=System.Text.Encoding.Default.GetBytes(c) >>> foo("aaaa","bbbb","cccc") Traceback (most recent call last): File , line 0, in input##1 File , line 0, in foo File , line 0, in foo Exception: Object reference not set to an instance of an object. >>> def foo(a,b,c,d=1): t=System.Text.Encoding.Default.GetBytes(c) >>> foo("aaaa","bbbb","cccc") >>> def foo(c,d=1,e=2): t=System.Text.Encoding.Default.GetBytes(c) >>> foo("cccc") >>> -------------- next part -------------- An HTML attachment was scrubbed... URL: From korpse-ironpython at kaydash.za.net Thu Mar 9 14:59:07 2006 From: korpse-ironpython at kaydash.za.net (Jonathan Jacobs) Date: Thu, 09 Mar 2006 15:59:07 +0200 Subject: [IronPython] IronPython's file object implementation Message-ID: <441034AB.6080207@kaydash.za.net> Hi, I've got a gripe with IronPython's file implementation. The following code produces two different results in CPython and IronPython: print ''.join('%02x' % ord(c) for c in file('some_binary_file').read(32)) CPython: 01044c1045a1470ec2011201000020000000ec0f0000030000006f1e0000fcc5 IronPython: 01044c1045470e0112010000200000000f0000030000006f1e000052441d3641 One of the causes of this appears to be the fact that PythonFile is implemented using a StreamReader, for binary mode, which attempts to decode data that is read from the underlying stream, which is not how Python's file object works. Another problem (that contributes to the confusion) is that IronPython represents Python's "str" type as .NET's "string" type which is described as something that "Represents text as a series of Unicode characters", whereas "str" is actually more like a byte[], while "unicode" is more like .NET's "string" type. -- Jonathan When you meet a master swordsman, show him your sword. When you meet a man who is not a poet, do not show him your poem. -- Rinzai, ninth century Zen master From chappyonice at hotmail.com Thu Mar 9 15:03:22 2006 From: chappyonice at hotmail.com (Todd M. Chapman) Date: Thu, 09 Mar 2006 07:03:22 -0700 Subject: [IronPython] Compatibility with .NET 1.1 Message-ID: I'm doing quite a bit of work with Microsoft CRM. CRM is based on .NET 1.1 and there's not much chance of that changing until the next major release in 2007 or so. I see some really solid benefits of using IP with CRM for administrative tasks, prototyping, etc. Although IP is currently based on .NET 2.0, is there any compatibility with previous versions? If not, what previous release of IP would you recommend for use with .NET 1.1? Thanks, Todd From egarcia at seismicmicro.com Thu Mar 9 16:17:34 2006 From: egarcia at seismicmicro.com (Eddie Garcia) Date: Thu, 9 Mar 2006 09:17:34 -0600 Subject: [IronPython] Microsoft's commitment to IP Message-ID: <4CA57A3E03365841BFEFEE00D8DE85DF01CE9F11@Socrates.SMTus.seismicmicro.com> Has anyone at MS made any specific commitments to Iron Python? I am trying to get my company to standardize on IP for our build scripting and configuration Management. It seems a natural fit since we are going the Team Foundation Server route. But I need to build a case and this will be one of the things that they are interested to learn more about. -E x3515 -------------- next part -------------- An HTML attachment was scrubbed... URL: From stan at phidani.be Thu Mar 9 17:44:11 2006 From: stan at phidani.be (Stanislas Pinte) Date: Thu, 9 Mar 2006 16:44:11 +0000 Subject: [IronPython] Compatibility with .NET 1.1 In-Reply-To: References: Message-ID: <1141922651.44105b5bd8461@webmail.raincode.com> Hi Todd, you may want to use PythonDotNet...still in 1.1, and working nicely. http://www.zope.org/Members/Brian/PythonNet/ Stan. Selon "Todd M. Chapman" : > I'm doing quite a bit of work with Microsoft CRM. CRM is based on .NET 1.1 > and there's not much chance of that changing until the next major release in > 2007 or so. I see some really solid benefits of using IP with CRM for > administrative tasks, prototyping, etc. Although IP is currently based on > NET 2.0, is there any compatibility with previous versions? If not, what > previous release of IP would you recommend for use with .NET 1.1? > > Thanks, > Todd > > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > From dinov at exchange.microsoft.com Thu Mar 9 17:23:36 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Thu, 9 Mar 2006 08:23:36 -0800 Subject: [IronPython] IronPython's file object implementation In-Reply-To: <441034AB.6080207@kaydash.za.net> Message-ID: <4039D552ADAB094BB1EA670F3E96214E01E2916E@df-foxhound-msg.exchange.corp.microsoft.com> The first bug will be fixed in beta 4 - we've done a bunch of cleanup around the file class to make it all around more compatible with CPython. That not only includes fixing binary mode but also fixing universal new line mode to be much more compatible. FYI beta 4 should be available real soon now. The string difference is more complicated. We do indeed represent all strings as Unicode and that's similar to other implementations of Python such as Jython as well. But we think that the cases where this incompatibility shines through are pretty rare (unfortunately it sounds like you hit one because you hit another incompatibility, but hopefully fixing the first one will make the 2nd one less of an issue for you). Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jonathan Jacobs Sent: Thursday, March 09, 2006 5:59 AM To: IronPython List Subject: [IronPython] IronPython's file object implementation Hi, I've got a gripe with IronPython's file implementation. The following code produces two different results in CPython and IronPython: print ''.join('%02x' % ord(c) for c in file('some_binary_file').read(32)) CPython: 01044c1045a1470ec2011201000020000000ec0f0000030000006f1e0000fcc5 IronPython: 01044c1045470e0112010000200000000f0000030000006f1e000052441d3641 One of the causes of this appears to be the fact that PythonFile is implemented using a StreamReader, for binary mode, which attempts to decode data that is read from the underlying stream, which is not how Python's file object works. Another problem (that contributes to the confusion) is that IronPython represents Python's "str" type as .NET's "string" type which is described as something that "Represents text as a series of Unicode characters", whereas "str" is actually more like a byte[], while "unicode" is more like .NET's "string" type. -- Jonathan When you meet a master swordsman, show him your sword. When you meet a man who is not a poet, do not show him your poem. -- Rinzai, ninth century Zen master _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Thu Mar 9 17:23:36 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Thu, 9 Mar 2006 08:23:36 -0800 Subject: [IronPython] IronPython's file object implementation In-Reply-To: <441034AB.6080207@kaydash.za.net> Message-ID: <4039D552ADAB094BB1EA670F3E96214E01E2916E@df-foxhound-msg.exchange.corp.microsoft.com> The first bug will be fixed in beta 4 - we've done a bunch of cleanup around the file class to make it all around more compatible with CPython. That not only includes fixing binary mode but also fixing universal new line mode to be much more compatible. FYI beta 4 should be available real soon now. The string difference is more complicated. We do indeed represent all strings as Unicode and that's similar to other implementations of Python such as Jython as well. But we think that the cases where this incompatibility shines through are pretty rare (unfortunately it sounds like you hit one because you hit another incompatibility, but hopefully fixing the first one will make the 2nd one less of an issue for you). Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jonathan Jacobs Sent: Thursday, March 09, 2006 5:59 AM To: IronPython List Subject: [IronPython] IronPython's file object implementation Hi, I've got a gripe with IronPython's file implementation. The following code produces two different results in CPython and IronPython: print ''.join('%02x' % ord(c) for c in file('some_binary_file').read(32)) CPython: 01044c1045a1470ec2011201000020000000ec0f0000030000006f1e0000fcc5 IronPython: 01044c1045470e0112010000200000000f0000030000006f1e000052441d3641 One of the causes of this appears to be the fact that PythonFile is implemented using a StreamReader, for binary mode, which attempts to decode data that is read from the underlying stream, which is not how Python's file object works. Another problem (that contributes to the confusion) is that IronPython represents Python's "str" type as .NET's "string" type which is described as something that "Represents text as a series of Unicode characters", whereas "str" is actually more like a byte[], while "unicode" is more like .NET's "string" type. -- Jonathan When you meet a master swordsman, show him your sword. When you meet a man who is not a poet, do not show him your poem. -- Rinzai, ninth century Zen master _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From korpse-ironpython at kaydash.za.net Thu Mar 9 17:58:26 2006 From: korpse-ironpython at kaydash.za.net (Jonathan Jacobs) Date: Thu, 09 Mar 2006 18:58:26 +0200 Subject: [IronPython] IronPython's file object implementation In-Reply-To: <4039D552ADAB094BB1EA670F3E96214E01E2916E@df-foxhound-msg.exchange.corp.microsoft.com> References: <4039D552ADAB094BB1EA670F3E96214E01E2916E@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <44105EB2.9090709@kaydash.za.net> Dino Viehland wrote: > The first bug will be fixed in beta 4 - we've done a bunch of cleanup around the file class to make it all around more compatible with CPython. That not only includes fixing binary mode but also fixing universal new line mode to be much more compatible. FYI beta 4 should be available real soon now. Thanks for the heads up, Dino. -- Jonathan From dinov at exchange.microsoft.com Thu Mar 9 19:11:31 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Thu, 9 Mar 2006 10:11:31 -0800 Subject: [IronPython] IronPython 1.0 Beta 4 is now available! Message-ID: <4039D552ADAB094BB1EA670F3E96214E01E29276@df-foxhound-msg.exchange.corp.microsoft.com> Hello IronPython Community, We have just released IronPython 1.0 Beta 4. This is yet another release focusing primarily on fixing bugs. Since the beta 3 release we've cut our active number of bugs in half. Unfortunately we didn't get to review the PythonEngine APIs in this release but will be getting this done for the next beta. Although major changes are few in this release some of the bigger changes include: Fix beta 3 assembly loading bug Auto-indentation support for the super console Support pep-263 file encodings AST visitor changes (*) A more complete list of changes follows at the end. You can download the release from: http://www.microsoft.com/downloads/details.aspx?FamilyID=ab942d78-b3df-428d-a2e7-f80949607c1a&displaylang=en We'd like to thank everyone in the community for your bug reports and suggestions that helped make this a better release: Alex Martelli, Anthony Tarlano, Chee Meng, Erin Renshaw, Giles Thomas, Greg Lee, grizupo, J. Merrill, Jeff Griffiths, Jon Kale, minwei, Neville Bagnall, Nicholas Jacobson, Paparipote, Richard Hsu, Richard Bothne, and Sanghyeon Seo. Thanks and keep in touch, The IronPython Team (*) The AST visitor changes in IronPython 1.0 Beta 4 are not compatible with the IronPython Visual Studio integration released in the March CTP of the Visual Studio SDK. Some code changes in the VS integration sample are required to use it with the latest IronPython 1.0 Beta 4. More complete list of changes and bug fixes: ============================================ Bugfix: Infinite recursion in import code Traceback support Support for methods only implemented via explicit interface implementation Bugfix: SubClass check throws ArgumentNull Exception Bugfix: Slice is (incorrectly) hashable WAS: dict[:] showing KeyError instead of TypeError Bugfix: tuple unpacking issues Bugfix: Calling __str__ on a Python exception class object causes an IndexError Bugfix: Trying to set methods on "built-in" classes fails silently Bugfix: Inheriting from an interface causes peverify warnings Bugfix: raise "foo" raises an exception, but is eaten by top-level rather than reported Bugfix: eval - locals can be any mapping object (formerly required to be a dictionary) Bugfix: Calling exc_info when there is no exception in the current stack causes a NullRef, rather than returning (None, None, None) Bugfix: Index out of bounds exception when importing minidom Bugfix: sequence.index(None) and sequence.count(None) should throw Type error instead of ArgNullExcep Bugfix: "abc".find(None) throws SystemError: "Object reference not set to an instance of an object." Bugfix: "except , " statement does not capture exception data; is just a copy of the exception Bugfix: sgmllib running on tutorial.htm throws Bugfix: Regular expressions: RE_Pattern instance method match(text, pos, endpos) not implemented Bugfix: multiline string does not return to primary interpreter prompt Bugfix: re.split with maxcount != 0 differs from specification Bugfix: Old class comparisons give wrong results, same as User Type Bugfix: IronPython won't call custom comparison operators on .NET types Bugfix: IronPython creates instance of class with __module__ set to contents of __name__ rather than the module name Bugfix: IP uses wrong slot to generate classe's module name Support for constructing Python file from .NET Stream Bugfix: Subclassing str & creating subclass fails Bugfix: Fix call to System.Double.ToString(1.0, 'f') (ReflectedOps types not storing both Python & non-Python names) Bugfix: -u command line option Bugfix: For an old-style class C, str(C) != C.__module__ + '.' + C.__main__ Bugfix: SyntaxError raised when a function defined to take kwargs is called with the name of the kwargs parameter as one of the keyword-specified argument Bugfix: Better formatting for System.Single Bugfix: Improve string formatting of floats for better compat with CPython Bugfix: sys.argv doesn't include executed python script Bugfix: IronPython builtin f.read() functionality differs from CPython builtin f.read() functionality Bugfix: CPython/IronPython discrepancy when comparing strings Bugfix: +=, ... also bind locals, fix binder Bugfix: CPython/IronPython discrepancy in behavior with respect to power operation Bugfix: ComplexOps.FloorDivide just does ordinary division Bugfix: Make PythonFile more robust WAS: sys.__stdin__.write("blah\n") causing NullReferenceException in IronPython Bugfix: Opening a file for writing and then attempting to read before closing the file causes a NullReferenceException Bugfix: Implement -c command line argument Bugfix: Add ability to compiler to generate 32 bit or 64 bit assemblies Bugfix: Fix compiler resource support Bugfix: from __future__ imports must occur at the beginning of the file, but can after the comments Bugfix: eval failed to find local name Bugfix: multiline string can't have blank lines Bugfix: better error message for functions with default arguments Bugfix: buffer() throws exception with message referring to method "ctor" instead of the expected "buffer" Bugfix: Encoding/Decoding tests in tests_str.py disabled Bugfix: In a Python subclass of a .NET class, inherited (but not overriden) methods are not shown as attributes of either class or instance Bugfix: Finish time module (day of year / week of year custom formatting) Bugfix: @accepts, @returns decorators not yet defined in clr module Bugfix: Can't inherit from interfaces with properties Bugfix: unicode(xxx ','raw-unicode-escape') issue Bugfix: The error message associated with incorrect usage of constructors of builtin types are confusing Bugfix: Method dispatch: skip generic method when bindmethod Bugfix: Investigate why CPython throws a syntax error for a compile statement that IronPython parses correctly Bugfix: NoneType arguments to coerce() causing unexpected SystemErrors Bugfix: Stack overflow adding reference to System.Xml Bugfix: re.compile does not accept "\\_" as a valid escape sequence Bugfix: re module - difference result of not matched group Bugfix: Interactive console not parsing certain 'if' statements correctly Implement -E command line parameter Implement -OO command line parameter Implement -S command line parameter Implement -t command line parameter Implement -V command line parameter Implement '-' command line parameter Bugfix: Pay customdict, frame, env refactoring debt Bugfix: Default parameters are not available for functions generated as DynamicMethod Bugfix: Method dispatch: the story of None as parameter Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -------------- next part -------------- An HTML attachment was scrubbed... URL: From chappyonice at hotmail.com Thu Mar 9 23:34:33 2006 From: chappyonice at hotmail.com (Todd M. Chapman) Date: Thu, 09 Mar 2006 15:34:33 -0700 Subject: [IronPython] Compatibility with .NET 1.1 In-Reply-To: <1141922651.44105b5bd8461@webmail.raincode.com> Message-ID: Thanks Stan, I'll give it a look. >From: Stanislas Pinte >To: Discussion of IronPython ,"Todd M. Chapman" > >CC: users at lists.ironpython.com >Subject: Re: [IronPython] Compatibility with .NET 1.1 >Date: Thu, 9 Mar 2006 16:44:11 +0000 > >Hi Todd, > >you may want to use PythonDotNet...still in 1.1, and working nicely. > >http://www.zope.org/Members/Brian/PythonNet/ > >Stan. > >Selon "Todd M. Chapman" : > > > I'm doing quite a bit of work with Microsoft CRM. CRM is based on .NET >1.1 > > and there's not much chance of that changing until the next major >release in > > 2007 or so. I see some really solid benefits of using IP with CRM for > > administrative tasks, prototyping, etc. Although IP is currently based >on > > NET 2.0, is there any compatibility with previous versions? If not, >what > > previous release of IP would you recommend for use with .NET 1.1? > > > > Thanks, > > Todd > > > > > > _______________________________________________ > > users mailing list > > users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > > > > > > > > From paparipote at hotmail.com Fri Mar 10 03:12:53 2006 From: paparipote at hotmail.com (Paparipote .) Date: Thu, 09 Mar 2006 22:12:53 -0400 Subject: [IronPython] How does the clr.AddReferences work? Message-ID: Hello, I have a doubt: In IP Beta 2, I was able to write: >>>import clr >>>clr.AddReferenceToFile("test.dll") >>>import test >>> but in Beta 4, if I write clr.AddReferenceToFile("test.dll") I get: Traceback (most recent call last): File , line 0, in input##678 File , line 0, in AddReference##657 RuntimeError: Could not add reference to assembly test.dll If I do with: >>>clr.AddReference("System.Xml") >>> It works well. If, in Beta 4, I write: >>>import System >>>import clr >>>aso = System.Reflection.Assembly.LoadFrom('test.dll') >>>clr.AddReference(aso) >>> It works well. Question is: Does it mean I should resign to the use of clr.AddReferenceToFile("test.dll") ??? Or what is bad with my understanding about clr ? Best regards _________________________________________________________________ Charla con tus amigos en l?nea mediante MSN Messenger: http://messenger.latam.msn.com/ From dinov at exchange.microsoft.com Fri Mar 10 03:25:32 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Thu, 9 Mar 2006 18:25:32 -0800 Subject: [IronPython] How does the clr.AddReferences work? In-Reply-To: Message-ID: <4039D552ADAB094BB1EA670F3E96214E01E298DD@df-foxhound-msg.exchange.corp.microsoft.com> Have you added the location of test.dll to your path yet? If not you need to do that first. We do not search the current directory, only the path. So if you want the CWD you'll need to do: import nt import clr clr.Path.append(nt.getcwd()) and then clr.AddReferenceToFile() should work fine. The finer points of clr.AddReferenceToFile are that the dependencies for the files added this way will be resolved by IronPython. When we try to get a dependency we'll search the clr.Path list and load the first assembly we find in the list. The upside to this is that if you're doing a compile, load into IP, debug cycle you can re-load your assembly even though it has the exact same filename. And as always we'd love to hear feedback about the design here. Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Paparipote . Sent: Thursday, March 09, 2006 6:13 PM To: users at lists.ironpython.com Subject: [IronPython] How does the clr.AddReferences work? Hello, I have a doubt: In IP Beta 2, I was able to write: >>>import clr >>>clr.AddReferenceToFile("test.dll") >>>import test >>> but in Beta 4, if I write clr.AddReferenceToFile("test.dll") I get: Traceback (most recent call last): File , line 0, in input##678 File , line 0, in AddReference##657 RuntimeError: Could not add reference to assembly test.dll If I do with: >>>clr.AddReference("System.Xml") >>> It works well. If, in Beta 4, I write: >>>import System >>>import clr >>>aso = System.Reflection.Assembly.LoadFrom('test.dll') >>>clr.AddReference(aso) >>> It works well. Question is: Does it mean I should resign to the use of clr.AddReferenceToFile("test.dll") ??? Or what is bad with my understanding about clr ? Best regards _________________________________________________________________ Charla con tus amigos en l?nea mediante MSN Messenger: http://messenger.latam.msn.com/ _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From eugene259 at internode.on.net Fri Mar 10 04:36:51 2006 From: eugene259 at internode.on.net (Eugene Rosenzweig) Date: Fri, 10 Mar 2006 14:36:51 +1100 Subject: [IronPython] Special method names? Message-ID: <4410F453.9080701@internode.on.net> I am relatively new to Python, I have been playing with a CPython and IronPython. Does IronPython support special methods? For example: >>> class C: ... v=0 ... def __init__(self,v): ... self.v=v ... def __int__(self): ... return int(self.v) ... >>> c=C(33) >>> print int(c) Traceback (most recent call last): File , line 0, in input##106 File , line 0, in Make##121 TypeError: expected int, found instance This doesn't present CPython with any problems and __int__() is in language reference manual, section 3.3.7 Eugene. From dinov at exchange.microsoft.com Fri Mar 10 04:45:24 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Thu, 9 Mar 2006 19:45:24 -0800 Subject: [IronPython] Special method names? In-Reply-To: <4410F453.9080701@internode.on.net> Message-ID: <4039D552ADAB094BB1EA670F3E96214E01E29950@df-foxhound-msg.exchange.corp.microsoft.com> We support some of these but not all of them right now. Currently these should work: __add__, __sub__, __pow__, __mul__, __floordiv__, __div__, __truediv__, __mod__, __lshift__, __rshift__, __and__, __or__, __xor__, __lt__, __gt__, __le__, __ge__, __eq__, and __ne__ and all of the r and i versions where applicable. We seem to be missing the other categories. I've opened a bug for this and expect we can get these added for beta 5. Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Eugene Rosenzweig Sent: Thursday, March 09, 2006 7:37 PM To: users at lists.ironpython.com Subject: [IronPython] Special method names? I am relatively new to Python, I have been playing with a CPython and IronPython. Does IronPython support special methods? For example: >>> class C: ... v=0 ... def __init__(self,v): ... self.v=v ... def __int__(self): ... return int(self.v) ... >>> c=C(33) >>> print int(c) Traceback (most recent call last): File , line 0, in input##106 File , line 0, in Make##121 TypeError: expected int, found instance This doesn't present CPython with any problems and __int__() is in language reference manual, section 3.3.7 Eugene. _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From kfarmer at thuban.org Fri Mar 10 05:37:36 2006 From: kfarmer at thuban.org (Keith J. Farmer) Date: Thu, 9 Mar 2006 20:37:36 -0800 Subject: [IronPython] IronPython and other scripting languages.. Message-ID: I apologize, Dino. I didn't take advantage of the moment during today's C# chat to plug the job req you've been advertising. Someone asked in the chat today about Microsoft's commitment to "lightweight programming frameworks". I mentioned the IP had hit 1.0b4 today, but didn't mention that y'all were hiring. ----- Keith J. Farmer // kfarmer at thuban.org -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE -11F0-45DF-8B78-DC1B43134038) From sanxiyn at gmail.com Fri Mar 10 12:58:15 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Fri, 10 Mar 2006 20:58:15 +0900 Subject: [IronPython] IronPython 1.0 Beta 4 on Mono Message-ID: <5b0248170603100358u5e7a3aebx@mail.gmail.com> The binary will run out of the box on Mono 1.1.13.2 release. IsDaylightSavingTime issue is still there, and in addition, string encoding and decoding won't work. IronPython now uses System.Text.GetEncodings (note the plural) method, new in .NET 2, which is not yet implemented on Mono. Will report more as I find out. Seo Sanghyeon From s.kobalczyk at softwaremind.pl Fri Mar 10 15:25:17 2006 From: s.kobalczyk at softwaremind.pl (Szymon Kobalczyk) Date: Fri, 10 Mar 2006 15:25:17 +0100 Subject: [IronPython] Line info in PythonSyntaxError Message-ID: <44118C4D.30309@softwaremind.pl> Hi, I found it quite convenient to be able to catch parsing error from the engine's Compile method and read the line and column number where the error occurred. In previous version this was simply displayed in the PythonSyntaxError's message. Currently it was removed and instead this exception carries this information in private fields so it can recreate PythonException. Do you have anything against exposing these fields as read-only properties? Regards, Szymon Kobalczyk From sanxiyn at gmail.com Fri Mar 10 17:19:16 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Sat, 11 Mar 2006 01:19:16 +0900 Subject: [IronPython] IronPython 1.0 Beta 4 on Mono In-Reply-To: <5b0248170603100358u5e7a3aebx@mail.gmail.com> References: <5b0248170603100358u5e7a3aebx@mail.gmail.com> Message-ID: <5b0248170603100819w21f0c90fq@mail.gmail.com> The source compiles fine with Mono SVN trunk, revision 57777. However, you need to edit the makefile. Apart from usual csc->gmcs and mkdir -p edit, you need to add two references. It seems that only project files were updated in Beta 4. Edit $(CSC) -t:library -r:../IronMath.dll -out:../IronPython.dll -recurse:IronPython/*.cs to $(CSC) -t:library -r:../IronMath.dll -r:System.Design.dll -r:System.Drawing.dll -out:../IronPython.dll -recurse:IronPython/*.cs After that, it should compile fine with zero errors. Seo Sanghyeon From dinov at exchange.microsoft.com Fri Mar 10 17:41:28 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Fri, 10 Mar 2006 08:41:28 -0800 Subject: [IronPython] IronPython 1.0 Beta 4 on Mono In-Reply-To: <5b0248170603100819w21f0c90fq@mail.gmail.com> Message-ID: <4039D552ADAB094BB1EA670F3E96214E01E29A96@df-foxhound-msg.exchange.corp.microsoft.com> I've opened a bug for us to update the makefiles for the next release. Thanks for pointing this out. Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Sanghyeon Seo Sent: Friday, March 10, 2006 8:19 AM To: Discussion of IronPython Subject: Re: [IronPython] IronPython 1.0 Beta 4 on Mono The source compiles fine with Mono SVN trunk, revision 57777. However, you need to edit the makefile. Apart from usual csc->gmcs and mkdir -p edit, you need to add two references. It seems that only project files were updated in Beta 4. Edit $(CSC) -t:library -r:../IronMath.dll -out:../IronPython.dll -recurse:IronPython/*.cs to $(CSC) -t:library -r:../IronMath.dll -r:System.Design.dll -r:System.Drawing.dll -out:../IronPython.dll -recurse:IronPython/*.cs After that, it should compile fine with zero errors. Seo Sanghyeon _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From daftspaniel at gmail.com Fri Mar 10 21:45:50 2006 From: daftspaniel at gmail.com (Davy Mitchell) Date: Fri, 10 Mar 2006 20:45:50 +0000 Subject: [IronPython] System.Convert Problem Message-ID: <20253b0c0603101245m38dacc1v75b5fbec6e355352@mail.gmail.com> Hi Folks, I am trying to get the following to work: print Convert.ToInt32('A') An error is thrown complaining: Input string was not in a correct format. Full stack trace below. Have a great weekend! Thanks, Davy Mitchell Mood News - BBC News Headlines Auto-Classified as Good, Bad or Neutral. http://www.latedecember.com/sites/moodnews/ See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box. ************** Exception Text ************** System.FormatException: Input string was not in a correct format. at IronPython.Runtime.BuiltinFunction.Invoke(MethodBinding binding) at IronPython.Runtime.ReflectedMethodBase.TryCallWorker(Object[] args, Object& ret) at IronPython.Runtime.ReflectedMethodBase.Call(Object[] args) at IronPython.Runtime.ReflectedMethodBase.Call(ICallerContext context, Object[] args) at IronPython.Runtime.ReflectedMethodBase.Call(ICallerContext context, Object arg0) at IronPython.Runtime.Ops.CallWithContext(ICallerContext context, Object func, Object arg0) at __main__.ASC_click$f0(Object f, Object a) in K:\Dev\IP\wfdemo.py:line 61 at IronPython.Runtime.Function2.Call(Object arg0, Object arg1) at IronPython.Runtime.Function2.Call(Object[] args) at IronPython.Runtime.Ops.Call(Object func, Object[] args) at IronPython.Runtime.ReflectedEvent.EventDispatcher.Call(Object[] args) at IronPython.Runtime.Ops.Call(Object func, Object arg0, Object arg1) at System.EventHandler##92(Object , Object , EventArgs ) at System.EventHandler.Invoke(Object sender, EventArgs e) at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) ************** Loaded Assemblies ************** mscorlib Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.42 (RTM.050727-4200) CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll ---------------------------------------- IronPythonConsole Assembly Version: 1.0.2258.21879 Win32 Version: 1.0.2258.21879 CodeBase: file:///C:/ip/IronPython-1.0-Beta4/IronPythonConsole.exe ---------------------------------------- IronPython Assembly Version: 1.0.2258.21878 Win32 Version: 1.0.2258.21878 CodeBase: file:///C:/ip/IronPython-1.0-Beta4/IronPython.DLL ---------------------------------------- snippets Assembly Version: 0.0.0.0 Win32 Version: 1.0.2258.21878 CodeBase: file:///C:/ip/IronPython-1.0-Beta4/IronPython.dll ---------------------------------------- IronMath Assembly Version: 1.0.2258.21878 Win32 Version: 1.0.2258.21878 CodeBase: file:///C:/ip/IronPython-1.0-Beta4/IronMath.DLL ---------------------------------------- System Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.42 (RTM.050727-4200) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll ---------------------------------------- System.Configuration Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.42 (RTM.050727-4200) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll ---------------------------------------- System.Xml Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.42 (RTM.050727-4200) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll ---------------------------------------- site Assembly Version: 0.0.0.0 Win32 Version: 1.0.2258.21878 CodeBase: file:///C:/ip/IronPython-1.0-Beta4/IronPython.dll ---------------------------------------- ISymWrapper Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.42 (RTM.050727-4200) CodeBase: file:///C:/WINDOWS/assembly/GAC_32/ISymWrapper/2.0.0.0__b03f5f7f11d50a3a/ISymWrapper.dll ---------------------------------------- wfdemo Assembly Version: 0.0.0.0 Win32 Version: 1.0.2258.21878 CodeBase: file:///C:/ip/IronPython-1.0-Beta4/IronPython.dll ---------------------------------------- System.Windows.Forms Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.42 (RTM.050727-4200) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll ---------------------------------------- System.Drawing Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.42 (RTM.050727-4200) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll ---------------------------------------- Accessibility Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.42 (RTM.050727-4200) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll ---------------------------------------- ************** JIT Debugging ************** To enable just-in-time (JIT) debugging, the .config file for this application or computer (machine.config) must have the jitDebugging value set in the system.windows.forms section. The application must also be compiled with debugging enabled. For example: When JIT debugging is enabled, any unhandled exception will be sent to the JIT debugger registered on the computer rather than be handled by this dialog box. From Nathan.Ernst at citadelgroup.com Fri Mar 10 21:50:01 2006 From: Nathan.Ernst at citadelgroup.com (Ernst, Nathan) Date: Fri, 10 Mar 2006 14:50:01 -0600 Subject: [IronPython] System.Convert Problem Message-ID: This makes perfect sense. "A" cannot be converted to an integer - unless you specify a base, e.g. 16 to treat this as a hex digit. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Davy Mitchell Sent: Friday, March 10, 2006 2:46 PM To: Discussion of IronPython Subject: [IronPython] System.Convert Problem Hi Folks, I am trying to get the following to work: print Convert.ToInt32('A') An error is thrown complaining: Input string was not in a correct format. Full stack trace below. Have a great weekend! Thanks, Davy Mitchell Mood News - BBC News Headlines Auto-Classified as Good, Bad or Neutral. http://www.latedecember.com/sites/moodnews/ See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box. ************** Exception Text ************** System.FormatException: Input string was not in a correct format. at IronPython.Runtime.BuiltinFunction.Invoke(MethodBinding binding) at IronPython.Runtime.ReflectedMethodBase.TryCallWorker(Object[] args, Object& ret) at IronPython.Runtime.ReflectedMethodBase.Call(Object[] args) at IronPython.Runtime.ReflectedMethodBase.Call(ICallerContext context, Object[] args) at IronPython.Runtime.ReflectedMethodBase.Call(ICallerContext context, Object arg0) at IronPython.Runtime.Ops.CallWithContext(ICallerContext context, Object func, Object arg0) at __main__.ASC_click$f0(Object f, Object a) in K:\Dev\IP\wfdemo.py:line 61 at IronPython.Runtime.Function2.Call(Object arg0, Object arg1) at IronPython.Runtime.Function2.Call(Object[] args) at IronPython.Runtime.Ops.Call(Object func, Object[] args) at IronPython.Runtime.ReflectedEvent.EventDispatcher.Call(Object[] args) at IronPython.Runtime.Ops.Call(Object func, Object arg0, Object arg1) at System.EventHandler##92(Object , Object , EventArgs ) at System.EventHandler.Invoke(Object sender, EventArgs e) at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) ************** Loaded Assemblies ************** mscorlib Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.42 (RTM.050727-4200) CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll ---------------------------------------- IronPythonConsole Assembly Version: 1.0.2258.21879 Win32 Version: 1.0.2258.21879 CodeBase: file:///C:/ip/IronPython-1.0-Beta4/IronPythonConsole.exe ---------------------------------------- IronPython Assembly Version: 1.0.2258.21878 Win32 Version: 1.0.2258.21878 CodeBase: file:///C:/ip/IronPython-1.0-Beta4/IronPython.DLL ---------------------------------------- snippets Assembly Version: 0.0.0.0 Win32 Version: 1.0.2258.21878 CodeBase: file:///C:/ip/IronPython-1.0-Beta4/IronPython.dll ---------------------------------------- IronMath Assembly Version: 1.0.2258.21878 Win32 Version: 1.0.2258.21878 CodeBase: file:///C:/ip/IronPython-1.0-Beta4/IronMath.DLL ---------------------------------------- System Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.42 (RTM.050727-4200) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/Sy stem.dll ---------------------------------------- System.Configuration Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.42 (RTM.050727-4200) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5 f7f11d50a3a/System.Configuration.dll ---------------------------------------- System.Xml Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.42 (RTM.050727-4200) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e08 9/System.Xml.dll ---------------------------------------- site Assembly Version: 0.0.0.0 Win32 Version: 1.0.2258.21878 CodeBase: file:///C:/ip/IronPython-1.0-Beta4/IronPython.dll ---------------------------------------- ISymWrapper Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.42 (RTM.050727-4200) CodeBase: file:///C:/WINDOWS/assembly/GAC_32/ISymWrapper/2.0.0.0__b03f5f7f11d50a3a /ISymWrapper.dll ---------------------------------------- wfdemo Assembly Version: 0.0.0.0 Win32 Version: 1.0.2258.21878 CodeBase: file:///C:/ip/IronPython-1.0-Beta4/IronPython.dll ---------------------------------------- System.Windows.Forms Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.42 (RTM.050727-4200) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5 c561934e089/System.Windows.Forms.dll ---------------------------------------- System.Drawing Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.42 (RTM.050727-4200) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d 50a3a/System.Drawing.dll ---------------------------------------- Accessibility Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.42 (RTM.050727-4200) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d5 0a3a/Accessibility.dll ---------------------------------------- ************** JIT Debugging ************** To enable just-in-time (JIT) debugging, the .config file for this application or computer (machine.config) must have the jitDebugging value set in the system.windows.forms section. The application must also be compiled with debugging enabled. For example: When JIT debugging is enabled, any unhandled exception will be sent to the JIT debugger registered on the computer rather than be handled by this dialog box. _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From daftspaniel at gmail.com Fri Mar 10 22:10:17 2006 From: daftspaniel at gmail.com (Davy Mitchell) Date: Fri, 10 Mar 2006 21:10:17 +0000 Subject: [IronPython] System.Convert Problem In-Reply-To: References: Message-ID: <20253b0c0603101310o4c20cb3aj1c27f75e6e51cc43@mail.gmail.com> On 3/10/06, Ernst, Nathan wrote: > This makes perfect sense. "A" cannot be converted to an integer - > unless you specify a base, e.g. 16 to treat this as a hex digit. Thanks for the quick response Nathan. It now makes sense to me too :-) BTW I switched from System.Convert to the VB Strings Class which made things much easier as this is a port from VB.NET :-) Regards, Davy Mitchell Mood News - BBC News Headlines Auto-Classified as Good, Bad or Neutral. http://www.latedecember.com/sites/moodnews/ From Nathan.Ernst at citadelgroup.com Fri Mar 10 22:19:27 2006 From: Nathan.Ernst at citadelgroup.com (Ernst, Nathan) Date: Fri, 10 Mar 2006 15:19:27 -0600 Subject: [IronPython] System.Convert Problem Message-ID: If you're trying to convert strings to ints in IronPython, the pythonic way of doing it would be to use the built-in "int": >>> int("A") Traceback (most recent call last): File "", line 1, in ? ValueError: invalid literal for int(): A >>> int("A", 16) 10 -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Davy Mitchell Sent: Friday, March 10, 2006 3:10 PM To: Discussion of IronPython Subject: Re: [IronPython] System.Convert Problem On 3/10/06, Ernst, Nathan wrote: > This makes perfect sense. "A" cannot be converted to an integer - > unless you specify a base, e.g. 16 to treat this as a hex digit. Thanks for the quick response Nathan. It now makes sense to me too :-) BTW I switched from System.Convert to the VB Strings Class which made things much easier as this is a port from VB.NET :-) Regards, Davy Mitchell Mood News - BBC News Headlines Auto-Classified as Good, Bad or Neutral. http://www.latedecember.com/sites/moodnews/ _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From kfarmer at thuban.org Fri Mar 10 23:49:23 2006 From: kfarmer at thuban.org (Keith J. Farmer) Date: Fri, 10 Mar 2006 14:49:23 -0800 Subject: [IronPython] System.Convert Problem References: Message-ID: I think System.Int32.TryParse is the preferred API now. It allows you to not rely on exceptions to determine that the input string won't parse. ________________________________ From: users-bounces at lists.ironpython.com on behalf of Ernst, Nathan Sent: Fri 3/10/2006 1:19 PM To: Discussion of IronPython Subject: Re: [IronPython] System.Convert Problem If you're trying to convert strings to ints in IronPython, the pythonic way of doing it would be to use the built-in "int": >>> int("A") Traceback (most recent call last): File "", line 1, in ? ValueError: invalid literal for int(): A >>> int("A", 16) 10 -------------- next part -------------- A non-text attachment was scrubbed... Name: winmail.dat Type: application/ms-tnef Size: 3720 bytes Desc: not available URL: From sanxiyn at gmail.com Sat Mar 11 15:59:14 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Sat, 11 Mar 2006 23:59:14 +0900 Subject: [IronPython] Console problem Message-ID: <5b0248170603110659t50388964w@mail.gmail.com> IronPython 1.0.2258 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> class C: ... x = 1 ... Traceback (most recent call last): SystemError: Object reference not set to an instance of an object >>> Seo Sanghyeon From sanxiyn at gmail.com Sat Mar 11 17:00:43 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Sun, 12 Mar 2006 01:00:43 +0900 Subject: [IronPython] atexit module doesn't work Message-ID: <5b0248170603110800q6d3a23f8x@mail.gmail.com> IronPython 1.0.2258 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import sys, atexit >>> def bye(): ... print 'Bye!' ... >>> atexit.register(bye) >>> sys.exit() This should print 'Bye!' at exit. Seo Sanghyeon From sanxiyn at gmail.com Sat Mar 11 17:54:06 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Sun, 12 Mar 2006 01:54:06 +0900 Subject: [IronPython] file object lacks tell method Message-ID: <5b0248170603110854i5367770t@mail.gmail.com> What the title says. I don't see an easy way to implement this... FileStream.Position looks useless. I can't think of any way other than maintaining current position throughout in PythonFile.cs. Any idea? Seo Sanghyeon From Martin.Maly at microsoft.com Sat Mar 11 17:52:18 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Sat, 11 Mar 2006 08:52:18 -0800 Subject: [IronPython] Console problem In-Reply-To: <5b0248170603110659t50388964w@mail.gmail.com> Message-ID: <5C0A6F919D675745BB1DBA7412DB68F501DA28FA@df-foxhound-msg.exchange.corp.microsoft.com> Hi, I tried to look into this, but cannot reproduce the exception no matter how hard I try. Are you running IronPython with any command line parameters? Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Sanghyeon Seo Sent: Saturday, March 11, 2006 6:59 AM To: Discussion of IronPython Subject: [IronPython] Console problem IronPython 1.0.2258 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> class C: ... x = 1 ... Traceback (most recent call last): SystemError: Object reference not set to an instance of an object >>> Seo Sanghyeon _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From sanxiyn at gmail.com Sun Mar 12 01:42:43 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Sun, 12 Mar 2006 09:42:43 +0900 Subject: [IronPython] Console problem In-Reply-To: <5C0A6F919D675745BB1DBA7412DB68F501DA28FA@df-foxhound-msg.exchange.corp.microsoft.com> References: <5b0248170603110659t50388964w@mail.gmail.com> <5C0A6F919D675745BB1DBA7412DB68F501DA28FA@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <5b0248170603111642q2de0f7f5m@mail.gmail.com> 2006/3/12, Martin Maly : > I tried to look into this, but cannot reproduce the exception no matter > how hard I try. Are you running IronPython with any command line parameters? I am running IronPython with Mono (latest dev version). Perhaps that matters. This bug happens only on interactive console. Running script is fine. Here's the transcript with -X:ExceptionDetail: IronPython 1.0.2258 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> class C: ... x = 1 ... Object reference not set to an instance of an object in <0x00060> System.Reflection.Emit.ILGenerator:Emit (OpCode opcode, System.Reflection.MethodInfo method) in <0x00024> IronPython.Compiler.CodeGen:Emit (OpCode opcode, System.Reflection.MethodInfo meth) in <0x0008b> IronPython.Compiler.CodeGen:EmitCall (System.Reflection.MethodInfo mi) in <0x000f9> IronPython.Compiler.ClassDef:Emit (IronPython.Compiler.CodeGen cg) in <0x0001f> IronPython.Compiler.GlobalSuite:Emit (IronPython.Compiler.CodeGen cg) in <0x001c5> IronPython.Compiler.OutputGenerator:GenerateSnippet (IronPython.Compiler.CompilerContext context, IronPython.Compiler.Stmt body, System.String name, Boolean printExprStmts) in <0x000bf> IronPython.Hosting.PythonEngine:DoOneInteractive (IronPython.Runtime.Frame topFrame) in <0x0002f> IronPython.Hosting.PythonEngine:RunInteractiveLoop () SystemError: Object reference not set to an instance of an object >>> Mono people? Any idea? Seo Sanghyeon From mailinglist.account at gmail.com Sun Mar 12 12:46:29 2006 From: mailinglist.account at gmail.com (Anthony Tarlano) Date: Sun, 12 Mar 2006 12:46:29 +0100 Subject: [IronPython] Console problem In-Reply-To: <5b0248170603111642q2de0f7f5m@mail.gmail.com> References: <5b0248170603110659t50388964w@mail.gmail.com> <5C0A6F919D675745BB1DBA7412DB68F501DA28FA@df-foxhound-msg.exchange.corp.microsoft.com> <5b0248170603111642q2de0f7f5m@mail.gmail.com> Message-ID: Seo, As you probably already know the Mono CLR may have many interesting bugs that may not show up on the MS .NET CLR. Thus, you should probably verify whether your bugs are isolated to a specific CLR in order to determine which mailing list to send your bug reports. The IronPython developers primary target is the MS .NET CLR and I am sure they don't want to be chasing bugs that aren't even dealing with their software. Don't you agree? Anthony On 3/12/06, Sanghyeon Seo wrote: > 2006/3/12, Martin Maly : > > I tried to look into this, but cannot reproduce the exception no matter > > how hard I try. Are you running IronPython with any command line parameters? > > I am running IronPython with Mono (latest dev version). Perhaps that matters. > > This bug happens only on interactive console. Running script is fine. > > Here's the transcript with -X:ExceptionDetail: > > IronPython 1.0.2258 (Beta) on .NET 2.0.50727.42 > Copyright (c) Microsoft Corporation. All rights reserved. > >>> class C: > ... x = 1 > ... > Object reference not set to an instance of an object > in <0x00060> System.Reflection.Emit.ILGenerator:Emit (OpCode opcode, > System.Reflection.MethodInfo method) > in <0x00024> IronPython.Compiler.CodeGen:Emit (OpCode opcode, > System.Reflection.MethodInfo meth) > in <0x0008b> IronPython.Compiler.CodeGen:EmitCall > (System.Reflection.MethodInfo mi) > in <0x000f9> IronPython.Compiler.ClassDef:Emit (IronPython.Compiler.CodeGen cg) > in <0x0001f> IronPython.Compiler.GlobalSuite:Emit > (IronPython.Compiler.CodeGen cg) > in <0x001c5> IronPython.Compiler.OutputGenerator:GenerateSnippet > (IronPython.Compiler.CompilerContext context, IronPython.Compiler.Stmt > body, System.String name, Boolean printExprStmts) > in <0x000bf> IronPython.Hosting.PythonEngine:DoOneInteractive > (IronPython.Runtime.Frame topFrame) > in <0x0002f> IronPython.Hosting.PythonEngine:RunInteractiveLoop () > SystemError: Object reference not set to an instance of an object > >>> > > Mono people? Any idea? > > Seo Sanghyeon > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From sanxiyn at gmail.com Sun Mar 12 14:42:30 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Sun, 12 Mar 2006 22:42:30 +0900 Subject: [IronPython] Console problem In-Reply-To: References: <5b0248170603110659t50388964w@mail.gmail.com> <5C0A6F919D675745BB1DBA7412DB68F501DA28FA@df-foxhound-msg.exchange.corp.microsoft.com> <5b0248170603111642q2de0f7f5m@mail.gmail.com> Message-ID: <5b0248170603120542x13c7a3d6t@mail.gmail.com> 2006/3/12, Anthony Tarlano : > As you probably already know the Mono CLR may have many interesting > bugs that may not show up on the MS .NET CLR. Thus, you should > probably verify whether your bugs are isolated to a specific CLR in > order to determine which mailing list to send your bug reports. I don't have an easy access to a machine with Windows installed at the moment. As most of my past problems with IronPython wasn't Mono specific, I just assumed this one was too. Sorry for sending a bug report to the wrong list. Seo Sanghyeon From sanxiyn at gmail.com Sun Mar 12 15:23:39 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Sun, 12 Mar 2006 23:23:39 +0900 Subject: [IronPython] -i option doesn't go interactive when exception is raised Message-ID: <5b0248170603120623r670d7a39j@mail.gmail.com> One use of -i option is to inspect stack trace when exception is raised. # test.py 1/0 $ python -i test.py ... ZeroDivisionError >>> This way one can inspect variables at the time exception was raised. Sure, debuggers can do that, but simple -i option is sometimes handy. IronPython implements -i option, but it doesn't go interactive when exception is raised. Seo Sanghyeon From sanxiyn at gmail.com Mon Mar 13 08:30:07 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Mon, 13 Mar 2006 16:30:07 +0900 Subject: [IronPython] Creating Python file from .NET stream Message-ID: <5b0248170603122330y4c34d107m@mail.gmail.com> Beta 4 changelogs have: "Support for constructing Python file from .NET Stream" But I still can't figure out how to do this. Any example will be greatly appreciated. For example, how do I create Python file from NetworkStream? Seo Sanghyeon From henryshow at gmail.com Mon Mar 13 09:42:53 2006 From: henryshow at gmail.com (henry show) Date: Mon, 13 Mar 2006 16:42:53 +0800 Subject: [IronPython] atexit module doesn't work In-Reply-To: <5b0248170603110800q6d3a23f8x@mail.gmail.com> References: <5b0248170603110800q6d3a23f8x@mail.gmail.com> Message-ID: <50d607c60603130042t78c81080t@mail.gmail.com> i am new to ironpython, so my question might be silly: why i can not even import os and atexit? IronPython 1.0.2258 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import sys,atexit Traceback (most recent call last): File , line 0, in input##74 ImportError: No module named atexit >>> import os Traceback (most recent call last): File , line 0, in input##75 ImportError: No module named os >>> 2006/3/12, Sanghyeon Seo : > > IronPython 1.0.2258 (Beta) on .NET 2.0.50727.42 > Copyright (c) Microsoft Corporation. All rights reserved. > >>> import sys, atexit > >>> def bye(): > ... print 'Bye!' > ... > >>> atexit.register(bye) > >>> sys.exit() > > This should print 'Bye!' at exit. > > Seo Sanghyeon > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sanxiyn at gmail.com Mon Mar 13 09:49:14 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Mon, 13 Mar 2006 17:49:14 +0900 Subject: [IronPython] atexit module doesn't work In-Reply-To: <50d607c60603130042t78c81080t@mail.gmail.com> References: <5b0248170603110800q6d3a23f8x@mail.gmail.com> <50d607c60603130042t78c81080t@mail.gmail.com> Message-ID: <5b0248170603130049t143b73a2x@mail.gmail.com> 2006/3/13, henry show : > i am new to ironpython, so my question might be silly: > why i can not even import os and atexit? You need to copy Lib directory from CPython 2.4 distribution. (And delete site.py after copying.) To import os module, you need os, ntpath or posixpath, stat, copy_reg, and types module. Seo Sanghyeon From henryshow at gmail.com Mon Mar 13 10:08:50 2006 From: henryshow at gmail.com (henry show) Date: Mon, 13 Mar 2006 17:08:50 +0800 Subject: [IronPython] atexit module doesn't work In-Reply-To: <5b0248170603130049t143b73a2x@mail.gmail.com> References: <5b0248170603110800q6d3a23f8x@mail.gmail.com> <50d607c60603130042t78c81080t@mail.gmail.com> <5b0248170603130049t143b73a2x@mail.gmail.com> Message-ID: <50d607c60603130108w363074fau@mail.gmail.com> I C, thx a lot. then i can repro your bug on my computer. and cPython did print a 'Bye' runing your piece of code. btw:what's so special with site.py? why we have to replace the original one with a empty one for ironpython? 2006/3/13, Sanghyeon Seo : > > 2006/3/13, henry show : > > i am new to ironpython, so my question might be silly: > > why i can not even import os and atexit? > > You need to copy Lib directory from CPython 2.4 distribution. (And > delete site.py after copying.) > > To import os module, you need os, ntpath or posixpath, stat, copy_reg, > and types module. > > Seo Sanghyeon > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Mon Mar 13 18:02:47 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 13 Mar 2006 09:02:47 -0800 Subject: [IronPython] Creating Python file from .NET stream In-Reply-To: <5b0248170603122330y4c34d107m@mail.gmail.com> Message-ID: <4039D552ADAB094BB1EA670F3E96214E01EB69EF@df-foxhound-msg.exchange.corp.microsoft.com> You should be able to do: >>> import System >>> a = System.IO.FileStream('abc', System.IO.FileMode.Create) >>> file(a) That should work w/ a network stream as well, but the filename will show up as "nul" in that case. Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Sanghyeon Seo Sent: Sunday, March 12, 2006 11:30 PM To: Discussion of IronPython Subject: [IronPython] Creating Python file from .NET stream Beta 4 changelogs have: "Support for constructing Python file from .NET Stream" But I still can't figure out how to do this. Any example will be greatly appreciated. For example, how do I create Python file from NetworkStream? Seo Sanghyeon _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Mon Mar 13 18:04:24 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 13 Mar 2006 09:04:24 -0800 Subject: [IronPython] -i option doesn't go interactive when exception is raised In-Reply-To: <5b0248170603120623r670d7a39j@mail.gmail.com> Message-ID: <4039D552ADAB094BB1EA670F3E96214E01EB69F4@df-foxhound-msg.exchange.corp.microsoft.com> Thanks for the bug report Seo, we'll look into getting it fixed for beta 5. Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Sanghyeon Seo Sent: Sunday, March 12, 2006 6:24 AM To: Discussion of IronPython Subject: [IronPython] -i option doesn't go interactive when exception is raised One use of -i option is to inspect stack trace when exception is raised. # test.py 1/0 $ python -i test.py ... ZeroDivisionError >>> This way one can inspect variables at the time exception was raised. Sure, debuggers can do that, but simple -i option is sometimes handy. IronPython implements -i option, but it doesn't go interactive when exception is raised. Seo Sanghyeon _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Mon Mar 13 18:05:26 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 13 Mar 2006 09:05:26 -0800 Subject: [IronPython] atexit module doesn't work In-Reply-To: <50d607c60603130108w363074fau@mail.gmail.com> Message-ID: <4039D552ADAB094BB1EA670F3E96214E01EB69F7@df-foxhound-msg.exchange.corp.microsoft.com> Strange, we pass the atexit test... I'll open a bug on this for us to look into. Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of henry show Sent: Monday, March 13, 2006 1:09 AM To: Discussion of IronPython Subject: Re: [IronPython] atexit module doesn't work I C, thx a lot. then i can repro your bug on my computer. and cPython did print a 'Bye' runing your piece of code. btw:what's so special with site.py? why we have to replace the original one with a empty one for ironpython? 2006/3/13, Sanghyeon Seo >: 2006/3/13, henry show >: > i am new to ironpython, so my question might be silly: > why i can not even import os and atexit? You need to copy Lib directory from CPython 2.4 distribution. (And delete site.py after copying.) To import os module, you need os, ntpath or posixpath, stat, copy_reg, and types module. Seo Sanghyeon _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From psheill at hotmail.com Mon Mar 13 19:07:06 2006 From: psheill at hotmail.com (Pete Sheill) Date: Mon, 13 Mar 2006 10:07:06 -0800 Subject: [IronPython] pasting into interactive console Message-ID: In Beta3, I recall being able to copy and paste large class definitions from my editor to the interactive console. In Beta4, I get some strange indenting behavior that breaks that usage. Example: class Item(UserControl): def __init__(self, id, beetle): self.id = id self.Height = 50; When pasted becomes... >>> class Item(UserControl):... def __init__(self, id, beetle):... self.id = id... self.Height = 50 and I get a SyntaxError. My class definition has spaces, not tabs. Is there some workaround? Thanks. -Pete _________________________________________________________________ It's the future, it's here, and it's free: Windows Live Mail beta http://www2.imagine-msn.com/minisites/mail/Default.aspx?locale=en-us -------------- next part -------------- An HTML attachment was scrubbed... URL: From haiboluo at exchange.microsoft.com Mon Mar 13 19:27:44 2006 From: haiboluo at exchange.microsoft.com (Haibo Luo) Date: Mon, 13 Mar 2006 10:27:44 -0800 Subject: [IronPython] Creating Python file from .NET stream In-Reply-To: <4039D552ADAB094BB1EA670F3E96214E01EB69EF@df-foxhound-msg.exchange.corp.microsoft.com> References: <5b0248170603122330y4c34d107m@mail.gmail.com> <4039D552ADAB094BB1EA670F3E96214E01EB69EF@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: We have a bug which allows FileStream only. We will fix it in next release. As workaround, you can update (in line~746 PythonFile.cs) as follows and rebuild: public static PythonFile Make(object cls, FileStream filestream) { to public static PythonFile Make(object cls, Stream filestream) { Thanks! -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Monday, March 13, 2006 9:03 AM To: Discussion of IronPython Subject: Re: [IronPython] Creating Python file from .NET stream You should be able to do: >>> import System >>> a = System.IO.FileStream('abc', System.IO.FileMode.Create) >>> file(a) That should work w/ a network stream as well, but the filename will show up as "nul" in that case. Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Sanghyeon Seo Sent: Sunday, March 12, 2006 11:30 PM To: Discussion of IronPython Subject: [IronPython] Creating Python file from .NET stream Beta 4 changelogs have: "Support for constructing Python file from .NET Stream" But I still can't figure out how to do this. Any example will be greatly appreciated. For example, how do I create Python file from NetworkStream? Seo Sanghyeon _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Shri.Borde at microsoft.com Tue Mar 14 08:50:46 2006 From: Shri.Borde at microsoft.com (Shri Borde) Date: Mon, 13 Mar 2006 23:50:46 -0800 Subject: [IronPython] pasting into interactive console cause double-indentation In-Reply-To: Message-ID: "IronPythonConsole.exe -X:TabCompletion" supports auto-indentation so that you do not have to type the indentation for multi-line statements. This works nicely for interactive manual typing. However, if you paste text blocks (which will already have indentation in them), it will lead to double indentation as the console cannot detect if the text was typed in or pasted as a block. The workaround is not to use -X:TabCompletion when you will be pasting in text. We could support an option to enable or disable auto-indentation, but that would be yet another knob you have to deal with. ________ Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Pete Sheill Sent: Monday, March 13, 2006 10:07 AM To: users at lists.ironpython.com Subject: [IronPython] pasting into interactive console In Beta3, I recall being able to copy and paste large class definitions from my editor to the interactive console. In Beta4, I get some strange indenting behavior that breaks that usage. Example: class Item(UserControl): def __init__(self, id, beetle): self.id = id self.Height = 50; When pasted becomes... >>> class Item(UserControl): ... def __init__(self, id, beetle): ... self.id = id ... self.Height = 50 and I get a SyntaxError. My class definition has spaces, not tabs. Is there some workaround? Thanks. -Pete ________________________________ Crush! Zap! Destroy! Junk e-mail trembles before the might of Windows Live(tm) Mail beta. Windows Live(tm) Mail beta -------------- next part -------------- An HTML attachment was scrubbed... URL: From rjaduthie at gmail.com Tue Mar 14 09:57:18 2006 From: rjaduthie at gmail.com (Roger Duthie) Date: Tue, 14 Mar 2006 08:57:18 +0000 Subject: [IronPython] pasting into interactive console Message-ID: <95ee8a7b0603140057p54e05551u@mail.gmail.com> Pete Is it anything to do with something as simple as the ; omission?? Roger -------------- next part -------------- An HTML attachment was scrubbed... URL: From SrinivasaRao_k at apollolife.com Tue Mar 14 10:04:33 2006 From: SrinivasaRao_k at apollolife.com (Srinivasa Rao) Date: Tue, 14 Mar 2006 14:34:33 +0530 Subject: [IronPython] pasting into interactive console In-Reply-To: <95ee8a7b0603140057p54e05551u@mail.gmail.com> Message-ID: thank for giving me the good information Thanks & Regards Srinivasa Rao. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com]On Behalf Of Roger Duthie Sent: Tuesday, March 14, 2006 2:27 PM To: users at lists.ironpython.com Subject: Re: [IronPython] pasting into interactive console Pete Is it anything to do with something as simple as the ; omission?? Roger -------------- next part -------------- An HTML attachment was scrubbed... URL: From psheill at gmail.com Tue Mar 14 17:03:21 2006 From: psheill at gmail.com (Pete Sheill) Date: Tue, 14 Mar 2006 08:03:21 -0800 Subject: [IronPython] pasting into interactive console cause double-indentation In-Reply-To: References: Message-ID: Thanks for clearing that up. Now I have a dilemma. I love tab completion, but not auto-indent. I also tend to run the same few commands every time I start up the interactive console to test something or other. E.g "import winforms". One reason people love emacs and vim is that they are extremely configurable. You can put your settings and startup commands in a config file (.emacs or .vimrc) that is loaded automatically. I would like the same in the interactive console. Thanks, Pete On 3/13/06, Shri Borde wrote: > > "IronPythonConsole.exe -X:TabCompletion" supports auto-indentation so > that you do not have to type the indentation for multi-line statements. This > works nicely for interactive manual typing. However, if you paste text > blocks (which will already have indentation in them), it will lead to double > indentation as the console cannot detect if the text was typed in or pasted > as a block. > > > > The workaround is not to use -X:TabCompletion when you will be pasting in > text. > > > > We could support an option to enable or disable auto-indentation, but that > would be yet another knob you have to deal with. > > > > *________* > > Do you want to help develop Dynamic languages on CLR? > ( > http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038 > ) > ------------------------------ > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Pete Sheill > *Sent:* Monday, March 13, 2006 10:07 AM > *To:* users at lists.ironpython.com > *Subject:* [IronPython] pasting into interactive console > > > > > > In Beta3, I recall being able to copy and paste large class definitions > from my editor to the interactive console. In Beta4, I get some strange > indenting behavior that breaks that usage. Example: > > > > class Item(UserControl): > def __init__(self, id, beetle): > self.id = id > self.Height = 50; > > > > When pasted becomes... > > > >>> class Item(UserControl): > ... def __init__(self, id, beetle): > ... self.id = id > ... self.Height = 50 > > > > and I get a SyntaxError. > > > > My class definition has spaces, not tabs. Is there some workaround? > > > > Thanks. > > -Pete > > > ------------------------------ > > Crush! Zap! Destroy! Junk e-mail trembles before the might of Windows > Live(tm) Mail beta. Windows Live(tm) Mail beta > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pchilds at gmail.com Tue Mar 14 17:52:11 2006 From: pchilds at gmail.com (Paul Childs) Date: Tue, 14 Mar 2006 12:52:11 -0400 Subject: [IronPython] CLR Debugger - No source code available for the current location. Message-ID: Hello, I have been trying out IronPython and working on the supplied tutorial. I can't seem to get the debugging part of the tutorial to work. See steps below. I have followed the instructions several times and every time I hit F11 at the break point placed on the line: print first.add(1, 2) I get a dialogue box with the message "No source code available for the current location." I am VERY sure that I have followed the instructions to the letter. If anyone can help me out I would really appreciate it. Thanks in advance, Paul Points: IronPython Beta 4 Windows XP SP 1 I made sure I was using the CLR debugger for .NET 2.0 Here are the steps I followed from the tutorial... Task 1: Debugging IronPython program using Microsoft CLR Debugger 1. Launch Microsoft CLR Debugger. 2. From the debugger Menu, select Debug / Program to Debug ... 3. For Program, browse to the IronPythonConsole.exe (located in the installation directory) 4. For Arguments, type in debugging.py 5. Change Working directory to the Tutorial directory 6. Click OK 7. From Menu, select File / Open / File. Browse to the Tutorial directory and select two files to open: debugging.py first.py 8. Place breakpoint at the following line of the debugging.py file (Place cursor on the line and pres F9): print first.add(1, 2) 9. Press F5 - Start Debugging. 10. IronPython will compile the debugging.py file and start executing it. You will hit the breakpoint at the line 3. Note: If you get poor performance starting the debugging session, exit the debugger, open the Windows Explorer and delete the following directory: %USERPROFILE%\Application Data\Microsoft\DbgClr 10. Pressing F11, step through the execution of the program, explore variables (even change the values of the variables in the watch window) and explore the call stack. 11. End the debugging session and exit the debugger. From Jim.Hugunin at microsoft.com Tue Mar 14 19:59:01 2006 From: Jim.Hugunin at microsoft.com (Jim Hugunin) Date: Tue, 14 Mar 2006 10:59:01 -0800 Subject: [IronPython] pasting into interactive console cause double-indentation In-Reply-To: Message-ID: Two things that I use to help with this are site.py and execfile. Site.py is a Python file that will be automatically executed when you start IronPython. It's a standard Python feature. I use this to add the standard Python 2.4 directory to my path as well as to add refererences (using clr.AddReference) to frequently used assemblies. Execfile will execute a file as if it was typed at the interactive prompt. So you want have your standard code in a startup.py fille that you execute. Let us know how these suggestions work out for you - Jim ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Pete Sheill Sent: Tuesday, March 14, 2006 8:03 AM To: Discussion of IronPython Subject: Re: [IronPython] pasting into interactive console cause double-indentation Thanks for clearing that up. Now I have a dilemma. I love tab completion, but not auto-indent. I also tend to run the same few commands every time I start up the interactive console to test something or other. E.g "import winforms". One reason people love emacs and vim is that they are extremely configurable. You can put your settings and startup commands in a config file (.emacs or .vimrc) that is loaded automatically. I would like the same in the interactive console. Thanks, Pete On 3/13/06, Shri Borde > wrote: "IronPythonConsole.exe -X:TabCompletion" supports auto-indentation so that you do not have to type the indentation for multi-line statements. This works nicely for interactive manual typing. However, if you paste text blocks (which will already have indentation in them), it will lead to double indentation as the console cannot detect if the text was typed in or pasted as a block. The workaround is not to use -X:TabCompletion when you will be pasting in text. We could support an option to enable or disable auto-indentation, but that would be yet another knob you have to deal with. ________ Do you want to help develop Dynamic languages on CLR? ( http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Pete Sheill Sent: Monday, March 13, 2006 10:07 AM To: users at lists.ironpython.com Subject: [IronPython] pasting into interactive console In Beta3, I recall being able to copy and paste large class definitions from my editor to the interactive console. In Beta4, I get some strange indenting behavior that breaks that usage. Example: class Item(UserControl): def __init__(self, id, beetle): self.id = id self.Height = 50; When pasted becomes... >>> class Item(UserControl): ... def __init__(self, id, beetle): ... self.id = id ... self.Height = 50 and I get a SyntaxError. My class definition has spaces, not tabs. Is there some workaround? Thanks. -Pete ________________________________ Crush! Zap! Destroy! Junk e-mail trembles before the might of Windows Live(tm) Mail beta. Windows Live(tm) Mail beta _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From dblank at brynmawr.edu Tue Mar 14 20:34:13 2006 From: dblank at brynmawr.edu (Douglas S. Blank) Date: Tue, 14 Mar 2006 14:34:13 -0500 Subject: [IronPython] pasting into interactive console cause double-indentation In-Reply-To: References: Message-ID: <1142364853.30677.86.camel@mightymouse.brynmawr.edu> Jim, This sounds more like a job for PYTHONSTARTUP. Does IronPython support that? For those that will be using IronPython with other users, you might not want to (or might not be able to) change the site-wide settings. Also, are you saying that "-X:TabCompletion" adds indents in addition to completing tabs? That sounds like two unrelated things that should have two flags. Finally, is it possible to set items like TabCompletion in site.py? Or is that a command-line only option? It would be great if it was settable. I am hoping that IronPython will behave very similarly to CPython (and Jython for that matter) so that educators will be able to move between them. Is there any commitment or coordination into compatibility between the versions? I certainly don't want to see the language bogged down by a standards committee, but I also don't want to see the language (and related bits) fragment. Thanks for the progress on this nice contribution to the community, -Doug On Tue, 2006-03-14 at 10:59 -0800, Jim Hugunin wrote: > Two things that I use to help with this are site.py and execfile. > > Site.py is a Python file that will be automatically executed when you > start IronPython. It?s a standard Python feature. I use this to add > the standard Python 2.4 directory to my path as well as to add > refererences (using clr.AddReference) to frequently used assemblies. > > Execfile will execute a file as if it was typed at the interactive > prompt. So you want have your standard code in a startup.py fille > that you execute. > > Let us know how these suggestions work out for you - Jim > > -- Douglas S. Blank Computer Science Assistant Professor Bryn Mawr College (610)526-6501 http://cs.brynmawr.edu/~dblank From donnalcwalter at yahoo.com Wed Mar 15 14:50:07 2006 From: donnalcwalter at yahoo.com (Donnal Walter) Date: Wed, 15 Mar 2006 05:50:07 -0800 (PST) Subject: [IronPython] Visual Studio Express Editions Message-ID: <20060315135007.18621.qmail@web35411.mail.mud.yahoo.com> I have downloaded VB 2005 Express Edition and Visual C# 2005 Express Edition in order to learn about .NET, but I really miss Python. Can I use IronPython with one of these Express Editions of Visual Studio? From joesox at gmail.com Wed Mar 15 15:16:01 2006 From: joesox at gmail.com (JoeSox) Date: Wed, 15 Mar 2006 06:16:01 -0800 Subject: [IronPython] Visual Studio Express Editions In-Reply-To: <20060315135007.18621.qmail@web35411.mail.mud.yahoo.com> References: <20060315135007.18621.qmail@web35411.mail.mud.yahoo.com> Message-ID: <785694cd0603150616nebef5bcmc07af94937fecc1e@mail.gmail.com> On 3/15/06, Donnal Walter wrote: > I have downloaded VB 2005 Express Edition and Visual C# 2005 Express Edition in order to learn about .NET, but I really miss Python. Can I use IronPython with one of these Express Editions of Visual Studio? > Hi Donnal. I am also new to IronPython but have spent about a month with the library. IronPython is written in C# so you may use it in Visual C# 2005. I believe you may also use it in VB 2005 Express if you reference the dll files as COM objects. But I haven't tested it in VB so you may not want to rely on my word. There is a Studio Solution file included with IronPython so you can rebuild it in Visual C# 2005 if you need to, or just browse the classes. For what I was working on, I decided not to use the console interface and to make things somewhat easier for myself I developed a TextBox based control that attempt to simulate a console. I just posted an article and the source project files are available here: http://codeproject.com/useritems/irontextbox.asp I had to stop development on that control a little shorter than I would have liked, because of time constrants, but its good enough for some users to play around with. -- Joseph From kfarmer at thuban.org Wed Mar 15 20:59:40 2006 From: kfarmer at thuban.org (Keith J. Farmer) Date: Wed, 15 Mar 2006 11:59:40 -0800 Subject: [IronPython] Visual Studio Express Editions References: <20060315135007.18621.qmail@web35411.mail.mud.yahoo.com> <785694cd0603150616nebef5bcmc07af94937fecc1e@mail.gmail.com> Message-ID: Here's a way to get VS Standard for free: http://www.learn2asp.net/campaign.aspx I'm not certain, but this SKU might be sufficient for the IronPython-for-VS prototype. I think it may also be sufficient for the Linq preview bits. -------------- next part -------------- A non-text attachment was scrubbed... Name: winmail.dat Type: application/ms-tnef Size: 3312 bytes Desc: not available URL: From Shri.Borde at microsoft.com Wed Mar 15 21:17:54 2006 From: Shri.Borde at microsoft.com (Shri Borde) Date: Wed, 15 Mar 2006 12:17:54 -0800 Subject: [IronPython] pasting into interactive console causes double-indentation In-Reply-To: <1142364853.30677.86.camel@mightymouse.brynmawr.edu> Message-ID: IronPython supports IRONPYTHONSTARTUP. "ironpythonconsole.exe -?" lists all the supported environment variables. A new option sounds like the best approach for auto-indentation so everyone gets just what they ask for. I shall take a look at this for the next beta. Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Douglas S. Blank Sent: Tuesday, March 14, 2006 11:34 AM To: Discussion of IronPython Subject: Re: [IronPython] pasting into interactive console cause double-indentation Jim, This sounds more like a job for PYTHONSTARTUP. Does IronPython support that? For those that will be using IronPython with other users, you might not want to (or might not be able to) change the site-wide settings. Also, are you saying that "-X:TabCompletion" adds indents in addition to completing tabs? That sounds like two unrelated things that should have two flags. Finally, is it possible to set items like TabCompletion in site.py? Or is that a command-line only option? It would be great if it was settable. I am hoping that IronPython will behave very similarly to CPython (and Jython for that matter) so that educators will be able to move between them. Is there any commitment or coordination into compatibility between the versions? I certainly don't want to see the language bogged down by a standards committee, but I also don't want to see the language (and related bits) fragment. Thanks for the progress on this nice contribution to the community, -Doug On Tue, 2006-03-14 at 10:59 -0800, Jim Hugunin wrote: > Two things that I use to help with this are site.py and execfile. > > Site.py is a Python file that will be automatically executed when you > start IronPython. It's a standard Python feature. I use this to add > the standard Python 2.4 directory to my path as well as to add > refererences (using clr.AddReference) to frequently used assemblies. > > Execfile will execute a file as if it was typed at the interactive > prompt. So you want have your standard code in a startup.py fille > that you execute. > > Let us know how these suggestions work out for you - Jim > > -- Douglas S. Blank Computer Science Assistant Professor Bryn Mawr College (610)526-6501 http://cs.brynmawr.edu/~dblank _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Detlef.Stute at al-lighting.com Thu Mar 16 07:59:37 2006 From: Detlef.Stute at al-lighting.com (Stute, Detlef ALRT/EEG4) Date: Thu, 16 Mar 2006 07:59:37 +0100 Subject: [IronPython] Visual Studio Express Editions Message-ID: Hi Donnal, I'm using IronPython with C# Express. Right now, everything works fine. Mit freundlichen Gr??en/ kind regards/ Cordiali Saluti Detlef Stute SEATEC GmbH www.seatec-gmbh.com From mailinglist.account at gmail.com Thu Mar 16 22:24:03 2006 From: mailinglist.account at gmail.com (Anthony Tarlano) Date: Thu, 16 Mar 2006 22:24:03 +0100 Subject: [IronPython] Generator Performance (IronPython vs. CPython( Message-ID: Hi, I investigating the use of lightweight threads, so I was reading "Charming Python #b7: Implementing weightless threads with Python generators. by David Mertz, Ph.D." The first example microthreads.py is about the simplest weightless thread scheduler one could choose. Here is the code: ------------------------------------------------------------------------------------------------------------------- # microthreads.py import sys, time threads = [] TOTALSWITCHES = 10**6 NUMTHREADS = 10**5 def null_factory(): def empty(): while 1: yield None return empty() def quitter(): for n in xrange(TOTALSWITCHES/NUMTHREADS): yield None def scheduler(): global threads try: while 1: for thread in threads: thread.next() except StopIteration: pass if __name__ == "__main__": for i in range(NUMTHREADS): threads.append(null_factory()) threads.append(quitter()) starttime = time.clock() scheduler() print "TOTAL TIME: ", time.clock()-starttime print "TOTAL SWITCHES:", TOTALSWITCHES print "TOTAL THREADS: ", NUMTHREADS ------------------------------------------------------------------------------------------------------------------- After running the example on CPython the following results are printed: sh-2.04$ python microthreads.py TOTAL TIME: 0.718205526121 TOTAL SWITCHES: 1000000 TOTAL THREADS: 100000 After running the example on IronPython the following results are printed: sh-2.04$ IronPythonConsole microthreads.py TOTAL TIME: 1.49999237061 TOTAL SWITCHES: 1000000 TOTAL THREADS: 100000 This shows that IronPython took 0.781786844489 more then CPython to do the same switching between generators in this example. I was quites surprise to see this since that's more then double the time of CPython. Thus, the question is whether this performance result is acceptable to the IronPython team. Thanks, Anthony From dinov at exchange.microsoft.com Thu Mar 16 23:05:38 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Thu, 16 Mar 2006 14:05:38 -0800 Subject: [IronPython] Generator Performance (IronPython vs. CPython( In-Reply-To: Message-ID: <4039D552ADAB094BB1EA670F3E96214E01FECAAF@df-foxhound-msg.exchange.corp.microsoft.com> Thanks for the report of the perf issue. We are actually actively working on improving the perf of IronPython for the next release so I've gone ahead and filed a bug to make sure we look into this issue. Hopefully we'll have something more concrete to let you know about this scenario soon, but unfortunately it's not one of the issues we've fixed so far. Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Anthony Tarlano Sent: Thursday, March 16, 2006 1:24 PM To: Discussion of IronPython Subject: [IronPython] Generator Performance (IronPython vs. CPython( Hi, I investigating the use of lightweight threads, so I was reading "Charming Python #b7: Implementing weightless threads with Python generators. by David Mertz, Ph.D." The first example microthreads.py is about the simplest weightless thread scheduler one could choose. Here is the code: ------------------------------------------------------------------------------------------------------------------- # microthreads.py import sys, time threads = [] TOTALSWITCHES = 10**6 NUMTHREADS = 10**5 def null_factory(): def empty(): while 1: yield None return empty() def quitter(): for n in xrange(TOTALSWITCHES/NUMTHREADS): yield None def scheduler(): global threads try: while 1: for thread in threads: thread.next() except StopIteration: pass if __name__ == "__main__": for i in range(NUMTHREADS): threads.append(null_factory()) threads.append(quitter()) starttime = time.clock() scheduler() print "TOTAL TIME: ", time.clock()-starttime print "TOTAL SWITCHES:", TOTALSWITCHES print "TOTAL THREADS: ", NUMTHREADS ------------------------------------------------------------------------------------------------------------------- After running the example on CPython the following results are printed: sh-2.04$ python microthreads.py TOTAL TIME: 0.718205526121 TOTAL SWITCHES: 1000000 TOTAL THREADS: 100000 After running the example on IronPython the following results are printed: sh-2.04$ IronPythonConsole microthreads.py TOTAL TIME: 1.49999237061 TOTAL SWITCHES: 1000000 TOTAL THREADS: 100000 This shows that IronPython took 0.781786844489 more then CPython to do the same switching between generators in this example. I was quites surprise to see this since that's more then double the time of CPython. Thus, the question is whether this performance result is acceptable to the IronPython team. Thanks, Anthony _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From henryshow at gmail.com Fri Mar 17 07:26:56 2006 From: henryshow at gmail.com (henry show) Date: Fri, 17 Mar 2006 14:26:56 +0800 Subject: [IronPython] Visual Studio Express Editions In-Reply-To: References: Message-ID: <50d607c60603162226vdda0325n@mail.gmail.com> why should we have a VS or something to run IP? we are runing IP, not compling . i think a .net sdk is enough, isnt it? 2006/3/16, Stute, Detlef ALRT/EEG4 : > > Hi Donnal, > I'm using IronPython with C# Express. Right now, everything works fine. > > Mit freundlichen Gr??en/ kind regards/ Cordiali Saluti > > Detlef Stute > SEATEC GmbH > www.seatec-gmbh.com > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglist.account at gmail.com Fri Mar 17 07:30:56 2006 From: mailinglist.account at gmail.com (Anthony Tarlano) Date: Fri, 17 Mar 2006 07:30:56 +0100 Subject: [IronPython] Visual Studio Express Editions In-Reply-To: <50d607c60603162226vdda0325n@mail.gmail.com> References: <50d607c60603162226vdda0325n@mail.gmail.com> Message-ID: Yes, a .NET SDK is enough, but some people like to use VS as an IDE. Anthony On 3/17/06, henry show wrote: > > why should we have a VS or something to run IP? we are runing IP, not > compling . > i think a .net sdk is enough, isnt it? > > > 2006/3/16, Stute, Detlef ALRT/EEG4 : > > Hi Donnal, > > I'm using IronPython with C# Express. Right now, everything works fine. > > > > Mit freundlichen Gr??en/ kind regards/ Cordiali Saluti > > > > Detlef Stute > > SEATEC GmbH > > www.seatec-gmbh.com > > _______________________________________________ > > users mailing list > > users at lists.ironpython.com > > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > From Martin.Maly at microsoft.com Fri Mar 17 07:59:23 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Thu, 16 Mar 2006 22:59:23 -0800 Subject: [IronPython] Visual Studio Express Editions In-Reply-To: Message-ID: <5C0A6F919D675745BB1DBA7412DB68F501F023E3@df-foxhound-msg.exchange.corp.microsoft.com> Actually, to run IronPython, all you need is the .NET 2.0 runtime. .NET SDK (an additional download) is enough to compile/develop IronPython. Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Anthony Tarlano Sent: Thursday, March 16, 2006 10:31 PM To: Discussion of IronPython Subject: Re: [IronPython] Visual Studio Express Editions Yes, a .NET SDK is enough, but some people like to use VS as an IDE. Anthony On 3/17/06, henry show wrote: > > why should we have a VS or something to run IP? we are runing IP, not > compling . > i think a .net sdk is enough, isnt it? > > > 2006/3/16, Stute, Detlef ALRT/EEG4 : > > Hi Donnal, > > I'm using IronPython with C# Express. Right now, everything works fine. > > > > Mit freundlichen Gr??en/ kind regards/ Cordiali Saluti > > > > Detlef Stute > > SEATEC GmbH > > www.seatec-gmbh.com > > _______________________________________________ > > users mailing list > > users at lists.ironpython.com > > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From mailinglist.account at gmail.com Fri Mar 17 08:44:53 2006 From: mailinglist.account at gmail.com (Anthony Tarlano) Date: Fri, 17 Mar 2006 08:44:53 +0100 Subject: [IronPython] Generator Performance (IronPython vs. CPython( In-Reply-To: <4039D552ADAB094BB1EA670F3E96214E01FECAAF@df-foxhound-msg.exchange.corp.microsoft.com> References: <4039D552ADAB094BB1EA670F3E96214E01FECAAF@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: Dino, Here is another performance example to provide more "food for thought". This is the second example from the article. In this example a comparison between a for loop and another generator based thread scheduler performing the same operations is made. Here is the code: # overhead.py import time TIMES = 100000 threads = list() def stringops(): for n in xrange(TIMES): s = "Mary had a little lamb" s = s.upper() s = "Mary had a little lamb" s = s.lower() s = "Mary had a little lamb" s = s.replace('a','A') def scheduler(): for n in xrange(TIMES): for thread in threads: thread.next() def upper(): while 1: s = "Mary had a little lamb" s = s.upper() yield None def lower(): while 1: s = "Mary had a little lamb" s = s.lower() yield None def replace(): while 1: s = "Mary had a little lamb" s = s.replace('a','A') yield None if __name__=='__main__': start = time.clock() stringops() looptime = time.clock()-start print "LOOP TIME:", looptime threads.append(upper()) threads.append(lower()) threads.append(replace()) start = time.clock() scheduler() threadtime = time.clock()-start print "THREAD TIME:", threadtime And here are the pitiful results for IronPython vs CPython: sh-2.04$ python overhead.py LOOP TIME: 0.326167711259 THREAD TIME: 0.548508818858 sh-2.04$ IronPythonConsole overhead.py LOOP TIME: 0.734375 THREAD TIME: 1.046875 Anthony On 3/16/06, Dino Viehland wrote: > Thanks for the report of the perf issue. > > We are actually actively working on improving the perf of IronPython for the next release so I've gone ahead and filed a bug to make sure we look into this issue. Hopefully we'll have something more concrete to let you know about this scenario soon, but unfortunately it's not one of the issues we've fixed so far. > > > > Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Anthony Tarlano > Sent: Thursday, March 16, 2006 1:24 PM > To: Discussion of IronPython > Subject: [IronPython] Generator Performance (IronPython vs. CPython( > > Hi, > > I investigating the use of lightweight threads, so I was reading > "Charming Python #b7: Implementing weightless threads with Python > generators. by David Mertz, Ph.D." > > The first example microthreads.py is about the simplest weightless > thread scheduler one could choose. Here is the code: > > ------------------------------------------------------------------------------------------------------------------- > # microthreads.py > > import sys, time > > threads = [] > TOTALSWITCHES = 10**6 > NUMTHREADS = 10**5 > > def null_factory(): > def empty(): > while 1: yield None > return empty() > > def quitter(): > for n in xrange(TOTALSWITCHES/NUMTHREADS): > yield None > > def scheduler(): > global threads > try: > while 1: > for thread in threads: thread.next() > except StopIteration: > pass > > if __name__ == "__main__": > for i in range(NUMTHREADS): > threads.append(null_factory()) > threads.append(quitter()) > starttime = time.clock() > scheduler() > print "TOTAL TIME: ", time.clock()-starttime > print "TOTAL SWITCHES:", TOTALSWITCHES > print "TOTAL THREADS: ", NUMTHREADS > > ------------------------------------------------------------------------------------------------------------------- > > After running the example on CPython the following results are printed: > > sh-2.04$ python microthreads.py > TOTAL TIME: 0.718205526121 > TOTAL SWITCHES: 1000000 > TOTAL THREADS: 100000 > > After running the example on IronPython the following results are printed: > > sh-2.04$ IronPythonConsole microthreads.py > TOTAL TIME: 1.49999237061 > TOTAL SWITCHES: 1000000 > TOTAL THREADS: 100000 > > This shows that IronPython took 0.781786844489 more then CPython to do > the same switching between generators in this example. I was quites > surprise to see this since that's more then double the time of > CPython. > > Thus, the question is whether this performance result is acceptable to > the IronPython team. > > Thanks, > > Anthony > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From ramdaz at gmail.com Fri Mar 17 09:07:27 2006 From: ramdaz at gmail.com (Ramdas S) Date: Fri, 17 Mar 2006 13:37:27 +0530 Subject: [IronPython] How do I mask dynamic URLs in Django Message-ID: <6e38f9f00603170007i12cf4d99xa5644b897309950@mail.gmail.com> Hi, How do I mask dyanmically generated URLs in Django? This is to secure some speciifca pages Ramdas -------------- next part -------------- An HTML attachment was scrubbed... URL: From sanxiyn at gmail.com Fri Mar 17 09:53:48 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Fri, 17 Mar 2006 17:53:48 +0900 Subject: [IronPython] socket for IronPython update Message-ID: <5b0248170603170053o2db76780n@mail.gmail.com> I updated my socket module for IronPython: http://sparcs.kaist.ac.kr/~tinuviel/fepy/lib/ You need to edit IronPython source and rebuild as detailed below: http://lists.ironpython.com/pipermail/users-ironpython.com/2006-March/001944.html According to IronPython team, this will be fixed in the next release. This version can be used to import poplib module in the standard library, and it runs the example code included in poplib module without problem! Well, I was impressed. Seo Sanghyeon From egarcia at seismicmicro.com Fri Mar 17 16:25:10 2006 From: egarcia at seismicmicro.com (Eddie Garcia) Date: Fri, 17 Mar 2006 09:25:10 -0600 Subject: [IronPython] IronPython and other scripting languages.. Message-ID: <4CA57A3E03365841BFEFEE00D8DE85DF01D0B78B@Socrates.SMTus.seismicmicro.com> Actually, what is the official commitment to Iron Python? I am setting up Team Foundation Server in house. I want to standardize on our scripting tools and we are also looking to add scripting to our product line. Which way would MS recommend going? Iron Pythyon? Is it really going to be around for a long time? Or Monad? How will these 2 interact? What is the story around Iron Python and Monad? Our fear is that Iron Python might be just a proof of concept for Microsoft and that they may not really put full support behind it. Will it be around in 5 years? 10? -E x3515 -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Keith J. Farmer Sent: Thursday, March 09, 2006 10:38 PM To: Discussion of IronPython Subject: [IronPython] IronPython and other scripting languages.. I apologize, Dino. I didn't take advantage of the moment during today's C# chat to plug the job req you've been advertising. Someone asked in the chat today about Microsoft's commitment to "lightweight programming frameworks". I mentioned the IP had hit 1.0b4 today, but didn't mention that y'all were hiring. ----- Keith J. Farmer // kfarmer at thuban.org -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE -11F0-45DF-8B78-DC1B43134038) _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Fri Mar 17 17:38:52 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Fri, 17 Mar 2006 08:38:52 -0800 Subject: [IronPython] Generator Performance (IronPython vs. CPython( In-Reply-To: Message-ID: <4039D552ADAB094BB1EA670F3E96214E01FECF67@df-foxhound-msg.exchange.corp.microsoft.com> The good news this is basically the same issue. The better news is I've got a fix that gets us performance that's pretty much equal to CPython that will be in Beta 5 for both this and the other generator case. Thanks for reporting these. If you (or anyone else) has other issues they'd like to point out now's a great time, keep them coming! Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Anthony Tarlano Sent: Thursday, March 16, 2006 11:45 PM To: Discussion of IronPython Subject: Re: [IronPython] Generator Performance (IronPython vs. CPython( Dino, Here is another performance example to provide more "food for thought". This is the second example from the article. In this example a comparison between a for loop and another generator based thread scheduler performing the same operations is made. Here is the code: # overhead.py import time TIMES = 100000 threads = list() def stringops(): for n in xrange(TIMES): s = "Mary had a little lamb" s = s.upper() s = "Mary had a little lamb" s = s.lower() s = "Mary had a little lamb" s = s.replace('a','A') def scheduler(): for n in xrange(TIMES): for thread in threads: thread.next() def upper(): while 1: s = "Mary had a little lamb" s = s.upper() yield None def lower(): while 1: s = "Mary had a little lamb" s = s.lower() yield None def replace(): while 1: s = "Mary had a little lamb" s = s.replace('a','A') yield None if __name__=='__main__': start = time.clock() stringops() looptime = time.clock()-start print "LOOP TIME:", looptime threads.append(upper()) threads.append(lower()) threads.append(replace()) start = time.clock() scheduler() threadtime = time.clock()-start print "THREAD TIME:", threadtime And here are the pitiful results for IronPython vs CPython: sh-2.04$ python overhead.py LOOP TIME: 0.326167711259 THREAD TIME: 0.548508818858 sh-2.04$ IronPythonConsole overhead.py LOOP TIME: 0.734375 THREAD TIME: 1.046875 Anthony On 3/16/06, Dino Viehland wrote: > Thanks for the report of the perf issue. > > We are actually actively working on improving the perf of IronPython for the next release so I've gone ahead and filed a bug to make sure we look into this issue. Hopefully we'll have something more concrete to let you know about this scenario soon, but unfortunately it's not one of the issues we've fixed so far. > > > > Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Anthony Tarlano > Sent: Thursday, March 16, 2006 1:24 PM > To: Discussion of IronPython > Subject: [IronPython] Generator Performance (IronPython vs. CPython( > > Hi, > > I investigating the use of lightweight threads, so I was reading > "Charming Python #b7: Implementing weightless threads with Python > generators. by David Mertz, Ph.D." > > The first example microthreads.py is about the simplest weightless > thread scheduler one could choose. Here is the code: > > ------------------------------------------------------------------------------------------------------------------- > # microthreads.py > > import sys, time > > threads = [] > TOTALSWITCHES = 10**6 > NUMTHREADS = 10**5 > > def null_factory(): > def empty(): > while 1: yield None > return empty() > > def quitter(): > for n in xrange(TOTALSWITCHES/NUMTHREADS): > yield None > > def scheduler(): > global threads > try: > while 1: > for thread in threads: thread.next() > except StopIteration: > pass > > if __name__ == "__main__": > for i in range(NUMTHREADS): > threads.append(null_factory()) > threads.append(quitter()) > starttime = time.clock() > scheduler() > print "TOTAL TIME: ", time.clock()-starttime > print "TOTAL SWITCHES:", TOTALSWITCHES > print "TOTAL THREADS: ", NUMTHREADS > > ------------------------------------------------------------------------------------------------------------------- > > After running the example on CPython the following results are printed: > > sh-2.04$ python microthreads.py > TOTAL TIME: 0.718205526121 > TOTAL SWITCHES: 1000000 > TOTAL THREADS: 100000 > > After running the example on IronPython the following results are printed: > > sh-2.04$ IronPythonConsole microthreads.py > TOTAL TIME: 1.49999237061 > TOTAL SWITCHES: 1000000 > TOTAL THREADS: 100000 > > This shows that IronPython took 0.781786844489 more then CPython to do > the same switching between generators in this example. I was quites > surprise to see this since that's more then double the time of > CPython. > > Thus, the question is whether this performance result is acceptable to > the IronPython team. > > Thanks, > > Anthony > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From troy at therabbitwarren.org Fri Mar 17 21:41:48 2006 From: troy at therabbitwarren.org (Troy McKee) Date: Fri, 17 Mar 2006 12:41:48 -0800 Subject: [IronPython] Visual Studio Express Editions Message-ID: <481CCD612BB6754EA3DF4D4E7008B38E15692A@quetzl.therabbitwarren.org> Is there a proper IDE for IronPython? I have been playing with Komodo, and I don't know how well that replicates the capabilities of IronPython. -Michael Troy McKee- MIT, BA, AS -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Martin Maly Sent: Thursday, March 16, 2006 10:59 PM To: Discussion of IronPython Subject: Re: [IronPython] Visual Studio Express Editions Actually, to run IronPython, all you need is the .NET 2.0 runtime. .NET SDK (an additional download) is enough to compile/develop IronPython. Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Anthony Tarlano Sent: Thursday, March 16, 2006 10:31 PM To: Discussion of IronPython Subject: Re: [IronPython] Visual Studio Express Editions Yes, a .NET SDK is enough, but some people like to use VS as an IDE. Anthony On 3/17/06, henry show wrote: > > why should we have a VS or something to run IP? we are runing IP, not > compling . i think a .net sdk is enough, isnt it? > > > 2006/3/16, Stute, Detlef ALRT/EEG4 : > > Hi Donnal, > > I'm using IronPython with C# Express. Right now, everything works > > fine. > > > > Mit freundlichen Gr??en/ kind regards/ Cordiali Saluti > > > > Detlef Stute > > SEATEC GmbH > > www.seatec-gmbh.com _______________________________________________ > > users mailing list > > users at lists.ironpython.com > > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From kfarmer at thuban.org Fri Mar 17 23:27:37 2006 From: kfarmer at thuban.org (Keith J. Farmer) Date: Fri, 17 Mar 2006 14:27:37 -0800 Subject: [IronPython] Visual Studio Express Editions References: <481CCD612BB6754EA3DF4D4E7008B38E15692A@quetzl.therabbitwarren.org> Message-ID: Hey, Troy.. In the Visual Studio SDK is a sample Language Pack for IronPython. It's just a sample at this point, but is pretty cool to see at a demo. The IP folks should be able to talk more about it than I can, but I would expect Intellisense and the like to be available, as well as the usual VS features (object browser, multi-language solutions, etc). Komodo, as far as I know, only groks CPython. IP does have some IP-specific language differences to support such things as generics. I don't know whether it'd complain if you tried to create a List[int] (== List in C#). If you catch me on IM tonight, I can see about hooking you up. I can't remember what you've got available to work with. ________________________________ From: users-bounces at lists.ironpython.com on behalf of Troy McKee Sent: Fri 3/17/2006 12:41 PM To: Discussion of IronPython Subject: Re: [IronPython] Visual Studio Express Editions Is there a proper IDE for IronPython? I have been playing with Komodo, and I don't know how well that replicates the capabilities of IronPython. -Michael Troy McKee- MIT, BA, AS -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Martin Maly Sent: Thursday, March 16, 2006 10:59 PM To: Discussion of IronPython Subject: Re: [IronPython] Visual Studio Express Editions Actually, to run IronPython, all you need is the .NET 2.0 runtime. .NET SDK (an additional download) is enough to compile/develop IronPython. Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Anthony Tarlano Sent: Thursday, March 16, 2006 10:31 PM To: Discussion of IronPython Subject: Re: [IronPython] Visual Studio Express Editions Yes, a .NET SDK is enough, but some people like to use VS as an IDE. Anthony On 3/17/06, henry show wrote: > > why should we have a VS or something to run IP? we are runing IP, not > compling . i think a .net sdk is enough, isnt it? > > > 2006/3/16, Stute, Detlef ALRT/EEG4 : > > Hi Donnal, > > I'm using IronPython with C# Express. Right now, everything works > > fine. > > > > Mit freundlichen Gr??en/ kind regards/ Cordiali Saluti > > > > Detlef Stute > > SEATEC GmbH > > www.seatec-gmbh.com _______________________________________________ > > users mailing list > > users at lists.ironpython.com > > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -------------- next part -------------- A non-text attachment was scrubbed... Name: winmail.dat Type: application/ms-tnef Size: 6248 bytes Desc: not available URL: From kfarmer at thuban.org Fri Mar 17 23:29:11 2006 From: kfarmer at thuban.org (Keith J. Farmer) Date: Fri, 17 Mar 2006 14:29:11 -0800 Subject: [IronPython] IronPython and other scripting languages.. References: <4CA57A3E03365841BFEFEE00D8DE85DF01D0B78B@Socrates.SMTus.seismicmicro.com> Message-ID: Re Monad: Monad's part of WinFX (runtime or SDK, I can't remember which), and ships as part of Exchange 12. So there's a significant amount of commitment evidenced if they're going to allow customers to create enterprise-level dependencies. ________________________________ From: users-bounces at lists.ironpython.com on behalf of Eddie Garcia Sent: Fri 3/17/2006 7:25 AM To: Discussion of IronPython Subject: Re: [IronPython] IronPython and other scripting languages.. Actually, what is the official commitment to Iron Python? I am setting up Team Foundation Server in house. I want to standardize on our scripting tools and we are also looking to add scripting to our product line. Which way would MS recommend going? Iron Pythyon? Is it really going to be around for a long time? Or Monad? How will these 2 interact? What is the story around Iron Python and Monad? Our fear is that Iron Python might be just a proof of concept for Microsoft and that they may not really put full support behind it. Will it be around in 5 years? 10? -E x3515 -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Keith J. Farmer Sent: Thursday, March 09, 2006 10:38 PM To: Discussion of IronPython Subject: [IronPython] IronPython and other scripting languages.. I apologize, Dino. I didn't take advantage of the moment during today's C# chat to plug the job req you've been advertising. Someone asked in the chat today about Microsoft's commitment to "lightweight programming frameworks". I mentioned the IP had hit 1.0b4 today, but didn't mention that y'all were hiring. ----- Keith J. Farmer // kfarmer at thuban.org -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE -11F0-45DF-8B78-DC1B43134038) _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From richard.hsu at gmail.com Sat Mar 18 03:57:20 2006 From: richard.hsu at gmail.com (richard hsu) Date: Fri, 17 Mar 2006 21:57:20 -0500 Subject: [IronPython] sgmllib.py still not compiling Message-ID: Beta 4 release notes says that this is fixed, however it still gives errors. I tried to parse FAQ.html* [distributed with IronPython] with sgmllib.py and i got the following error message:- >ironpythonconsole sgmllib.py Traceback (most recent call last): File C:\\MyScripts\sgmllib.py, line 510, in Initialize File C:\MyScripts\sgmllib.py, line 505, in test File C:\MyScripts\sgmllib.py, line 95, in feed File C:\MyScripts\sgmllib.py, line 129, in goahead File C:\MyScripts\sgmllib.py, line 249, in parse_starttag File , line 0, in search##99 File System, line unknown, in Match File System, line unknown, in Run File System, line unknown, in Scan File System, line unknown, in FindFirstChar File System, line unknown, in Forwardcharnext IndexError: Index was outside the bounds of the array. I am running IronPython 1.0.2267 (Beta) on .NET 2.0.50727.42 Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sanxiyn at gmail.com Sat Mar 18 04:49:41 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Sat, 18 Mar 2006 12:49:41 +0900 Subject: [IronPython] hasattr raises Message-ID: <5b0248170603171949y25db93dfl@mail.gmail.com> hasattr() should not raise. A simple testcase: class NoAttribute(object): def __getattr__(self, name): raise AttributeError obj = NoAttribute() print hasattr(obj, 'attribute') Seo Sanghyeon From sanxiyn at gmail.com Sat Mar 18 12:20:03 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Sat, 18 Mar 2006 20:20:03 +0900 Subject: [IronPython] socket for IronPython update In-Reply-To: <5b0248170603170053o2db76780n@mail.gmail.com> References: <5b0248170603170053o2db76780n@mail.gmail.com> Message-ID: <5b0248170603180320p156dc4f1l@mail.gmail.com> I (again) updated my socket module for IronPython: http://sparcs.kaist.ac.kr/~tinuviel/fepy/lib/ Changes are: * Use array slicing, as this is now implemented in IronPython * Implemented recvfrom * Implemented getsockopt/setsockopt * Implemented getfqdn With these changes, you can now import and start SimpleHTTPServer. It doesn't actually function because of small details, but... Seo Sanghyeon From sanxiyn at gmail.com Sat Mar 18 17:16:55 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Sun, 19 Mar 2006 01:16:55 +0900 Subject: [IronPython] How to run SimpleHTTPServer on IronPython on Mono Message-ID: <5b0248170603180816v67906ea3r@mail.gmail.com> I took some time to write this HOWTO: http://sparcs.kaist.ac.kr/~tinuviel/fepy/howto/simplehttpserver-ironpython-mono-howto.html IronPython seems to get much less interest than it deserves. This howto shows how to setup IronPython to use with Mono on Linux and how to rebuild IronPython from source. It also discusses various patches to current problems. It also shows that IronPython can run SimpleHTTPServer today, not a trivial achievement. Hopefully, more Pythonistas on comp.lang.python will have a look at IronPython. Here's the excerpt from the howto: The purpose of this document is twofold: to show how to run SimpleHTTPServer on IronPython on Mono, and to debunk some myths like: * IronPython doesn't run on Mono * IronPython doesn't support Python standard library * IronPython is a toy Enjoy! Seo Sanghyeon From sanxiyn at gmail.com Sun Mar 19 06:58:24 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Sun, 19 Mar 2006 14:58:24 +0900 Subject: [IronPython] TypeError: readonly attribute Message-ID: <5b0248170603182158h228f4ca4u@mail.gmail.com> >>> import sys >>> sys.exc_traceback = None Traceback (most recent call last): TypeError: readonly attribute Above code is used in SocketServer module, line 524. Seo Sanghyeon From sanxiyn at gmail.com Sun Mar 19 07:14:38 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Sun, 19 Mar 2006 15:14:38 +0900 Subject: [IronPython] file object lacks closed attribute Message-ID: <5b0248170603182214o6be1080n@mail.gmail.com> Here's how I patched this: http://sparcs.kaist.ac.kr/~tinuviel/fepy/howto/simplehttpserver-ironpython-mono-howto.html#file-closed-patch Seo Sanghyeon From henryshow at gmail.com Sun Mar 19 13:55:09 2006 From: henryshow at gmail.com (henry show) Date: Sun, 19 Mar 2006 20:55:09 +0800 Subject: [IronPython] Generator Performance (IronPython vs. CPython( In-Reply-To: <4039D552ADAB094BB1EA670F3E96214E01FECF67@df-foxhound-msg.exchange.corp.microsoft.com> References: <4039D552ADAB094BB1EA670F3E96214E01FECF67@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <50d607c60603190455i6525a848x@mail.gmail.com> can't wait to try beta5 out. 2006/3/18, Dino Viehland : > > The good news this is basically the same issue. The better news is I've > got a fix that gets us performance that's pretty much equal to CPython that > will be in Beta 5 for both this and the other generator case. > > Thanks for reporting these. If you (or anyone else) has other issues > they'd like to point out now's a great time, keep them coming! > > > Do you want to help develop Dynamic languages on CLR? ( > http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038 > ) > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] On Behalf Of Anthony Tarlano > Sent: Thursday, March 16, 2006 11:45 PM > To: Discussion of IronPython > Subject: Re: [IronPython] Generator Performance (IronPython vs. CPython( > > Dino, > > Here is another performance example to provide more "food for thought". > > This is the second example from the article. In this example a > comparison between a for loop and another generator based thread > scheduler performing the same operations is made. > > Here is the code: > > # overhead.py > > import time > > TIMES = 100000 > > threads = list() > > def stringops(): > for n in xrange(TIMES): > s = "Mary had a little lamb" > s = s.upper() > s = "Mary had a little lamb" > s = s.lower() > s = "Mary had a little lamb" > s = s.replace('a','A') > > def scheduler(): > for n in xrange(TIMES): > for thread in threads: thread.next() > > def upper(): > while 1: > s = "Mary had a little lamb" > s = s.upper() > yield None > > def lower(): > while 1: > s = "Mary had a little lamb" > s = s.lower() > yield None > > def replace(): > while 1: > s = "Mary had a little lamb" > s = s.replace('a','A') > yield None > > if __name__=='__main__': > start = time.clock() > stringops() > looptime = time.clock()-start > print "LOOP TIME:", looptime > > threads.append(upper()) > threads.append(lower()) > threads.append(replace()) > start = time.clock() > scheduler() > threadtime = time.clock()-start > print "THREAD TIME:", threadtime > > > And here are the pitiful results for IronPython vs CPython: > > sh-2.04$ python overhead.py > LOOP TIME: 0.326167711259 > THREAD TIME: 0.548508818858 > > sh-2.04$ IronPythonConsole overhead.py > LOOP TIME: 0.734375 > THREAD TIME: 1.046875 > > Anthony > > On 3/16/06, Dino Viehland wrote: > > Thanks for the report of the perf issue. > > > > We are actually actively working on improving the perf of IronPython for > the next release so I've gone ahead and filed a bug to make sure we look > into this issue. Hopefully we'll have something more concrete to let you > know about this scenario soon, but unfortunately it's not one of the issues > we've fixed so far. > > > > > > > > Do you want to help develop Dynamic languages on CLR? ( > http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038 > ) > > -----Original Message----- > > From: users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] On Behalf Of Anthony Tarlano > > Sent: Thursday, March 16, 2006 1:24 PM > > To: Discussion of IronPython > > Subject: [IronPython] Generator Performance (IronPython vs. CPython( > > > > Hi, > > > > I investigating the use of lightweight threads, so I was reading > > "Charming Python #b7: Implementing weightless threads with Python > > generators. by David Mertz, Ph.D." > > > > The first example microthreads.py is about the simplest weightless > > thread scheduler one could choose. Here is the code: > > > > > ------------------------------------------------------------------------------------------------------------------- > > # microthreads.py > > > > import sys, time > > > > threads = [] > > TOTALSWITCHES = 10**6 > > NUMTHREADS = 10**5 > > > > def null_factory(): > > def empty(): > > while 1: yield None > > return empty() > > > > def quitter(): > > for n in xrange(TOTALSWITCHES/NUMTHREADS): > > yield None > > > > def scheduler(): > > global threads > > try: > > while 1: > > for thread in threads: thread.next() > > except StopIteration: > > pass > > > > if __name__ == "__main__": > > for i in range(NUMTHREADS): > > threads.append(null_factory()) > > threads.append(quitter()) > > starttime = time.clock() > > scheduler() > > print "TOTAL TIME: ", time.clock()-starttime > > print "TOTAL SWITCHES:", TOTALSWITCHES > > print "TOTAL THREADS: ", NUMTHREADS > > > > > ------------------------------------------------------------------------------------------------------------------- > > > > After running the example on CPython the following results are printed: > > > > sh-2.04$ python microthreads.py > > TOTAL TIME: 0.718205526121 > > TOTAL SWITCHES: 1000000 > > TOTAL THREADS: 100000 > > > > After running the example on IronPython the following results are > printed: > > > > sh-2.04$ IronPythonConsole microthreads.py > > TOTAL TIME: 1.49999237061 > > TOTAL SWITCHES: 1000000 > > TOTAL THREADS: 100000 > > > > This shows that IronPython took 0.781786844489 more then CPython to do > > the same switching between generators in this example. I was quites > > surprise to see this since that's more then double the time of > > CPython. > > > > Thus, the question is whether this performance result is acceptable to > > the IronPython team. > > > > Thanks, > > > > Anthony > > _______________________________________________ > > users mailing list > > users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ > > users mailing list > > users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sanxiyn at gmail.com Sun Mar 19 14:14:05 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Sun, 19 Mar 2006 22:14:05 +0900 Subject: [IronPython] Website update Message-ID: <5b0248170603190514gdaabb8fr@mail.gmail.com> I think the website, http://www.ironpython.com/, is in need of update. At the very least, it should link to gotdotnet.com workspace. Seo Sanghyeon From haiboluo at exchange.microsoft.com Sun Mar 19 20:24:19 2006 From: haiboluo at exchange.microsoft.com (Haibo Luo) Date: Sun, 19 Mar 2006 11:24:19 -0800 Subject: [IronPython] TypeError: readonly attribute In-Reply-To: <5b0248170603182158h228f4ca4u@mail.gmail.com> References: <5b0248170603182158h228f4ca4u@mail.gmail.com> Message-ID: Thanks for reporting this. Both this issue and hasattr issue have been logged in our bug db. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Sanghyeon Seo Sent: Saturday, March 18, 2006 9:58 PM To: Discussion of IronPython Subject: [IronPython] TypeError: readonly attribute >>> import sys >>> sys.exc_traceback = None Traceback (most recent call last): TypeError: readonly attribute Above code is used in SocketServer module, line 524. Seo Sanghyeon _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From sanxiyn at gmail.com Mon Mar 20 03:58:59 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Mon, 20 Mar 2006 11:58:59 +0900 Subject: [IronPython] TypeError: readonly attribute In-Reply-To: References: <5b0248170603182158h228f4ca4u@mail.gmail.com> Message-ID: <5b0248170603191858w6a6267e0v@mail.gmail.com> 2006/3/20, Haibo Luo : > Thanks for reporting this. > Both this issue and hasattr issue have been logged in our bug db. Thanks! Is there any change this bug DB will be available to the public? Seo Sanghyeon From joesox at gmail.com Mon Mar 20 04:08:42 2006 From: joesox at gmail.com (JoeSox) Date: Sun, 19 Mar 2006 19:08:42 -0800 Subject: [IronPython] TypeError: unbound method open must be called with .... Message-ID: <785694cd0603191908i2fad6ab5o987c291ac933c20c@mail.gmail.com> Hi, Can someone possibly explain to me what is going on with the TypeError below? I've tried the same calls in IDLE and it works. Correct me if I am wrong but webbrowser.py only uses os and sys. I don't understand what means. Thanks. ====== IronPython 1.0.2262 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import sys >>> sys.path.append("C:\Python24\Tools\Scripts") >>> sys.path.append("C:\Python24\Lib") >>> import webbrowser >>> webbrowser.WindowsDefault.open("http://www.microsoft.com") Traceback (most recent call last): File , line 0, in input##399 TypeError: unbound method open must be called with instance as first argument (got str instance instead) >>> ====== -- Joseph From giles.thomas at resolversystems.com Mon Mar 20 11:37:21 2006 From: giles.thomas at resolversystems.com (Giles Thomas) Date: Mon, 20 Mar 2006 10:37:21 +0000 Subject: [IronPython] Website update In-Reply-To: <5b0248170603190514gdaabb8fr@mail.gmail.com> References: <5b0248170603190514gdaabb8fr@mail.gmail.com> Message-ID: <441E85E1.5080809@resolversystems.com> Can I second this? Google returns http://www.ironpython.com/ as its first hit for IronPython... As a result, several people who we've told that we're using IP here have come back to us looking perplexed that we would be working in a language whose last release was 0.6 on July 28, 2004. Of course, it's easy to explain the true situation, but one has to wonder how many people are put off the language because of similar misunderstandings. (Or is this a deliberate attempt to stop the number of beta users from getting out of hand? ;-) Cheers, Giles -- Giles Thomas Resolver Systems giles.thomas at resolversystems.com We're hiring! http://www.resolversystems.com/jobs/ Sanghyeon Seo wrote: >I think the website, http://www.ironpython.com/, is in need of update. >At the very least, it should link to gotdotnet.com workspace. > >Seo Sanghyeon >_______________________________________________ >users mailing list >users at lists.ironpython.com >http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > From dinov at exchange.microsoft.com Mon Mar 20 17:14:07 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 20 Mar 2006 08:14:07 -0800 Subject: [IronPython] TypeError: readonly attribute In-Reply-To: <5b0248170603191858w6a6267e0v@mail.gmail.com> Message-ID: <4039D552ADAB094BB1EA670F3E96214E020895F0@df-foxhound-msg.exchange.corp.microsoft.com> Ultimately we want to replace gotdotnet.com w/ something that will enable this but unfortunately we're still a couple of months away from doing that (at the earliest). Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Sanghyeon Seo Sent: Sunday, March 19, 2006 6:59 PM To: Discussion of IronPython Subject: Re: [IronPython] TypeError: readonly attribute 2006/3/20, Haibo Luo : > Thanks for reporting this. > Both this issue and hasattr issue have been logged in our bug db. Thanks! Is there any change this bug DB will be available to the public? Seo Sanghyeon _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Mon Mar 20 17:15:23 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 20 Mar 2006 08:15:23 -0800 Subject: [IronPython] Website update In-Reply-To: <441E85E1.5080809@resolversystems.com> Message-ID: <4039D552ADAB094BB1EA670F3E96214E020895F1@df-foxhound-msg.exchange.corp.microsoft.com> We do actually want to do a site redesign (and it's a known issue in our bug database :) ) but it's just a matter of getting the resources to do so. We'll get it updated before 1.0, but I'm not sure how much before 1.0 we'll get it done. Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Giles Thomas Sent: Monday, March 20, 2006 2:37 AM To: Discussion of IronPython Subject: Re: [IronPython] Website update Can I second this? Google returns http://www.ironpython.com/ as its first hit for IronPython... As a result, several people who we've told that we're using IP here have come back to us looking perplexed that we would be working in a language whose last release was 0.6 on July 28, 2004. Of course, it's easy to explain the true situation, but one has to wonder how many people are put off the language because of similar misunderstandings. (Or is this a deliberate attempt to stop the number of beta users from getting out of hand? ;-) Cheers, Giles -- Giles Thomas Resolver Systems giles.thomas at resolversystems.com We're hiring! http://www.resolversystems.com/jobs/ Sanghyeon Seo wrote: >I think the website, http://www.ironpython.com/, is in need of update. >At the very least, it should link to gotdotnet.com workspace. > >Seo Sanghyeon >_______________________________________________ >users mailing list >users at lists.ironpython.com >http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Mon Mar 20 17:27:24 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 20 Mar 2006 08:27:24 -0800 Subject: [IronPython] TypeError: unbound method open must be called with .... In-Reply-To: <785694cd0603191908i2fad6ab5o987c291ac933c20c@mail.gmail.com> Message-ID: <4039D552ADAB094BB1EA670F3E96214E020895FC@df-foxhound-msg.exchange.corp.microsoft.com> If I do this in CPython I get the same result: Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import webbrowser >>> webbrowser.WindowsDefault.open("http://www.microsoft.com") Traceback (most recent call last): File "", line 1, in ? TypeError: unbound method open() must be called with WindowsDefault instance as first argument (got str instance instead) What is happening is that you're performing an instance call w/o an instance. What I belive you want is: webbrowser.open("http://www.microsoft.com") which also doesn't work in IronPython but for a different reason: Traceback (most recent call last): File , line 0, in input##631 File C:\Python24\Lib\webbrowser.py, line 46, in open_new File C:\Python24\Lib\webbrowser.py, line 38, in get Error: could not locate runnable browser That happens because cli isn't a recognized module name (and therefore we don't register WindowsDefault)... You can fix that: webbrowser._tryorder = ["windows-default"] webbrowser.register('windows-default',webbrowser.WindowsDefault) but then we finally blow up because we don't support startfile on the os module: >>> webbrowser.open_new('http://www.microsoft.com') Traceback (most recent call last): File , line 0, in input##669 File C:\Python24\Lib\webbrowser.py, line 46, in open_new File C:\Python24\Lib\webbrowser.py, line 250, in open AttributeError: 'module' object has no attribute 'startfile' -------------- I'll open a bug that we need to support startfile... the platform issue is a more difficult one as our platform is really "cli". So what to do for this one isn't entirely clear... Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of JoeSox Sent: Sunday, March 19, 2006 7:09 PM To: Discussion of IronPython Subject: [IronPython] TypeError: unbound method open must be called with .... Hi, Can someone possibly explain to me what is going on with the TypeError below? I've tried the same calls in IDLE and it works. Correct me if I am wrong but webbrowser.py only uses os and sys. I don't understand what means. Thanks. ====== IronPython 1.0.2262 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import sys >>> sys.path.append("C:\Python24\Tools\Scripts") >>> sys.path.append("C:\Python24\Lib") >>> import webbrowser >>> webbrowser.WindowsDefault.open("http://www.microsoft.com") Traceback (most recent call last): File , line 0, in input##399 TypeError: unbound method open must be called with instance as first argument (got str instance instead) >>> ====== -- Joseph _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From curt at hagenlocher.org Mon Mar 20 18:27:56 2006 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Mon, 20 Mar 2006 09:27:56 -0800 Subject: [IronPython] Website update Message-ID: <200603201727.JAA23552@dopey.hagenlocher.org> > We do actually want to do a site redesign (and it's a known > issue in our bug database :) ) but it's just a matter of getting > the resources to do so. Can't this at least temporarily be addressed with a 404 redirect to the gotdotnet.com site? -- Curt Hagenlocher curt at hagenlocher.org From jvm_cop at spamcop.net Mon Mar 20 18:00:54 2006 From: jvm_cop at spamcop.net (J. Merrill) Date: Mon, 20 Mar 2006 12:00:54 -0500 Subject: [IronPython] Website update In-Reply-To: <4039D552ADAB094BB1EA670F3E96214E020895F1@df-foxhound-msg.e xchange.corp.microsoft.com> References: <441E85E1.5080809@resolversystems.com> Message-ID: <4.3.2.7.2.20060320115838.048f7c30@mail.comcast.net> How hard would it be to just add a snippet at the top that explains that the page is out of date and gives them a link to the gotdetnet page? Or redirect them there automatically? I smell a distinct failure to be agile here! At 11:15 AM 3/20/2006, Dino Viehland wrote >We do actually want to do a site redesign (and it's a known issue in our bug database :) ) but it's just a matter of getting the resources to do so. > >We'll get it updated before 1.0, but I'm not sure how much before 1.0 we'll get it done. > >Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) > >-----Original Message----- >From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Giles Thomas >Sent: Monday, March 20, 2006 2:37 AM >To: Discussion of IronPython >Subject: Re: [IronPython] Website update > >Can I second this? Google returns http://www.ironpython.com/ as its >first hit for IronPython... As a result, several people who we've told >that we're using IP here have come back to us looking perplexed that we >would be working in a language whose last release was 0.6 on July 28, >2004. Of course, it's easy to explain the true situation, but one has >to wonder how many people are put off the language because of similar >misunderstandings. > >(Or is this a deliberate attempt to stop the number of beta users from >getting out of hand? ;-) > > >Cheers, > >Giles > >-- >Giles Thomas >Resolver Systems >giles.thomas at resolversystems.com >We're hiring! http://www.resolversystems.com/jobs/ > > > > >Sanghyeon Seo wrote: > >>I think the website, http://www.ironpython.com/, is in need of update. >>At the very least, it should link to gotdotnet.com workspace. >> >>Seo Sanghyeon J. Merrill / Analytical Software Corp From joesox at gmail.com Mon Mar 20 18:12:25 2006 From: joesox at gmail.com (JoeSox) Date: Mon, 20 Mar 2006 09:12:25 -0800 Subject: [IronPython] TypeError: unbound method open must be called with .... In-Reply-To: <4039D552ADAB094BB1EA670F3E96214E020895FC@df-foxhound-msg.exchange.corp.microsoft.com> References: <785694cd0603191908i2fad6ab5o987c291ac933c20c@mail.gmail.com> <4039D552ADAB094BB1EA670F3E96214E020895FC@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <785694cd0603200912h47086d88j406f651757df0f87@mail.gmail.com> On 3/20/06, Dino Viehland wrote: > but then we finally blow up because we don't support startfile on the os module: > Thanks Dino. I was wondering about that. > >>> webbrowser.open_new('http://www.microsoft.com') > Traceback (most recent call last): > File , line 0, in input##669 > File C:\Python24\Lib\webbrowser.py, line 46, in open_new > File C:\Python24\Lib\webbrowser.py, line 250, in open > AttributeError: 'module' object has no attribute 'startfile' > > -------------- > > I'll open a bug that we need to support startfile... the platform issue is a more difficult one as our platform is really "cli". So what to do for this one isn't entirely clear... > Would something like calling... System.Diagnostics.Process.Start("http://www.microsoft.com"); be a solution for IronPython's startfile()? -- Joseph From dinov at exchange.microsoft.com Mon Mar 20 18:19:49 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 20 Mar 2006 09:19:49 -0800 Subject: [IronPython] TypeError: unbound method open must be called with .... In-Reply-To: <785694cd0603200912h47086d88j406f651757df0f87@mail.gmail.com> Message-ID: <4039D552ADAB094BB1EA670F3E96214E02089661@df-foxhound-msg.exchange.corp.microsoft.com> Yes, calling System.Diagnostics.Process.Start is the solution - the one catch here is we need to set UseShellExecute = true (I'm not sure if that's the default or not, I belive the setting is in ProcessStartInfo as well). Given the simplicity of the fix it should be there in beta 5... Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of JoeSox Sent: Monday, March 20, 2006 9:12 AM To: Discussion of IronPython Subject: Re: [IronPython] TypeError: unbound method open must be called with .... On 3/20/06, Dino Viehland wrote: > but then we finally blow up because we don't support startfile on the os module: > Thanks Dino. I was wondering about that. > >>> webbrowser.open_new('http://www.microsoft.com') > Traceback (most recent call last): > File , line 0, in input##669 > File C:\Python24\Lib\webbrowser.py, line 46, in open_new > File C:\Python24\Lib\webbrowser.py, line 250, in open > AttributeError: 'module' object has no attribute 'startfile' > > -------------- > > I'll open a bug that we need to support startfile... the platform issue is a more difficult one as our platform is really "cli". So what to do for this one isn't entirely clear... > Would something like calling... System.Diagnostics.Process.Start("http://www.microsoft.com"); be a solution for IronPython's startfile()? -- Joseph _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From joesox at gmail.com Mon Mar 20 18:39:01 2006 From: joesox at gmail.com (JoeSox) Date: Mon, 20 Mar 2006 09:39:01 -0800 Subject: [IronPython] TypeError: unbound method open must be called with .... In-Reply-To: <4039D552ADAB094BB1EA670F3E96214E02089661@df-foxhound-msg.exchange.corp.microsoft.com> References: <785694cd0603200912h47086d88j406f651757df0f87@mail.gmail.com> <4039D552ADAB094BB1EA670F3E96214E02089661@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <785694cd0603200939h7a14097ah9690b9c4c52e81d6@mail.gmail.com> On 3/20/06, Dino Viehland wrote: > Yes, calling System.Diagnostics.Process.Start is the solution - the one catch here is we need to set UseShellExecute = true (I'm not sure if that's the default or not, I belive the setting is in ProcessStartInfo as well). > > Given the simplicity of the fix it should be there in beta 5... Sounds great. I'd rebuild my IronPython.dll and try it out but I fear it would take me too much time to figure out where to place the fix. Just makes sense to wait for beta 5. -- Joseph From kfarmer at thuban.org Mon Mar 20 18:41:28 2006 From: kfarmer at thuban.org (Keith J. Farmer) Date: Mon, 20 Mar 2006 09:41:28 -0800 Subject: [IronPython] Website update Message-ID: Site redesign, arguably, should take a back seat to site accuracy. I second/third/etc the idea of posting a simple notice at the top of the page directing users to the gdn site. ----- Keith J. Farmer // kfarmer at thuban.org -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Monday, 20 March 2006 08:15 To: Discussion of IronPython Subject: Re: [IronPython] Website update We do actually want to do a site redesign (and it's a known issue in our bug database :) ) but it's just a matter of getting the resources to do so. We'll get it updated before 1.0, but I'm not sure how much before 1.0 we'll get it done. Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE -11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Giles Thomas Sent: Monday, March 20, 2006 2:37 AM To: Discussion of IronPython Subject: Re: [IronPython] Website update Can I second this? Google returns http://www.ironpython.com/ as its first hit for IronPython... As a result, several people who we've told that we're using IP here have come back to us looking perplexed that we would be working in a language whose last release was 0.6 on July 28, 2004. Of course, it's easy to explain the true situation, but one has to wonder how many people are put off the language because of similar misunderstandings. (Or is this a deliberate attempt to stop the number of beta users from getting out of hand? ;-) Cheers, Giles -- Giles Thomas Resolver Systems giles.thomas at resolversystems.com We're hiring! http://www.resolversystems.com/jobs/ Sanghyeon Seo wrote: >I think the website, http://www.ironpython.com/, is in need of update. >At the very least, it should link to gotdotnet.com workspace. > >Seo Sanghyeon >_______________________________________________ >users mailing list >users at lists.ironpython.com >http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From mailinglist.account at gmail.com Mon Mar 20 22:13:37 2006 From: mailinglist.account at gmail.com (Anthony Tarlano) Date: Mon, 20 Mar 2006 22:13:37 +0100 Subject: [IronPython] BUG: subclassing tuple not working Message-ID: Here is the CPython behavior: Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> class myTuple(tuple): ... pass ... >>> t = myTuple() >>> t () >>> Here is the IronPython behavior: IronPython 1.0.2258 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> class myTuple(tuple): ... pass ... ... >>> t = myTuple() Traceback (most recent call last): File , line 0, in input##99 File , line 0, in PythonNew##76 TypeError: myTuple() takes exactly 2 arguments (1 given) >>> From Philosopher.Coder at gmail.com Tue Mar 21 02:36:11 2006 From: Philosopher.Coder at gmail.com (Ray Vernagus) Date: Mon, 20 Mar 2006 20:36:11 -0500 Subject: [IronPython] IronPython IDE Message-ID: <4412df1c0603201736wae84cd1o449d2a56a6a10fdb@mail.gmail.com> Recently there was some discussion about which IDE's people were using for programming in IronPython. I apologize if this is already well-known or if it has been mentioned before but I wanted to share a discovery that I made today. I use Eclipse ( http://www.eclipse.org/ ) and PyDev ( http://www.fabioz.com/pydev/ ) for my CPython programming and until Beta4, I was unable to use this setup for IronPython. It was either an update to PyDev or the Beta4 of IronPython that gave me the ability to use IronPythonConsole.exe as my Python interpreter. If you were running into the trouble that I had run into, you should update PyDev and try using Eclipse as your IDE. Code completion is a bit laggy at times and you may end up just turning it off. But all in all, IronPython in Eclipse is an enjoyable experience. -- Ray Vernagus -------------- next part -------------- An HTML attachment was scrubbed... URL: From sanxiyn at gmail.com Thu Mar 23 03:20:48 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Thu, 23 Mar 2006 11:20:48 +0900 Subject: [IronPython] Creating Python file from .NET stream with Python file mode Message-ID: <5b0248170603221820x19bc912bp@mail.gmail.com> I now installed Windows, and tried to run SimpleHTTPServer as I did with Mono. While doing that I found a problem. Currently there is no way to specify Python file mode, especially binary mode, when creating Python file object from .NET stream. I solved this by adding following method, below "public static PythonFile Make(object cls, Stream stream) {" in PythonFile.cs: [PythonName("__new__")] public static PythonFile Make(object cls, Stream stream, string mode) { return new PythonFile(stream, mode); } That way, socket.makefile("rb") works as expected, not translating \r\n\r\n with \r\r\n\r\r\n or any such things. Seo Sanghyeon From sanxiyn at gmail.com Thu Mar 23 09:32:03 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Thu, 23 Mar 2006 17:32:03 +0900 Subject: [IronPython] Python DB-API wrapper for ADO.NET for IronPython Message-ID: <5b0248170603230032n7747cf9fp@mail.gmail.com> Hello, I took a stub at writing Python DB-API (PEP 249) wrapper for ADO.NET to be used with IronPython. Currently I am testing this with MySQL Connector/Net and is trying to be compatible with MySQLdb module. You can download MySQL Connector/Net from: http://www.mysql.com/products/connector/net/ Unzip the download and copy MySql.Data.dll to the same directory as your script. Other files are not needed. Wrapper itself is here: http://sparcs.kaist.ac.kr/~tinuviel/fepy/lib/dbapi.py Currently implemented are connect() module level function, cursor() and close() on connection class, and execute() and fetchall() on cursor class. That's all. I would appreciate your comments. Thanks! Seo Sanghyeon From sanxiyn at gmail.com Thu Mar 23 11:20:03 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Thu, 23 Mar 2006 19:20:03 +0900 Subject: [IronPython] Python DB-API wrapper for ADO.NET for IronPython In-Reply-To: <5b0248170603230032n7747cf9fp@mail.gmail.com> References: <5b0248170603230032n7747cf9fp@mail.gmail.com> Message-ID: <5b0248170603230220s41fb05act@mail.gmail.com> 2006/3/23, Sanghyeon Seo : > I took a stub at writing Python DB-API (PEP 249) wrapper for ADO.NET > to be used with IronPython. Currently I am testing this with MySQL > Connector/Net and is trying to be compatible with MySQLdb module. I now added connect() wrapper compatible with psycopg module, using Npgsql .NET data provider: http://sparcs.kaist.ac.kr/~tinuviel/fepy/lib/dbapi.py For Npgsql, visit: http://freshmeat.net/projects/npgsql/ I also made an example you can run with both Python and IronPython: http://sparcs.kaist.ac.kr/~tinuviel/fepy/example/database_access.py Enjoy! Seo Sanghyeon From sanxiyn at gmail.com Thu Mar 23 14:41:01 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Thu, 23 Mar 2006 22:41:01 +0900 Subject: [IronPython] IronPython use in LabVIEW Message-ID: <5b0248170603230541v6c79cce2i@mail.gmail.com> I came across this link. You may want to have a look: http://detritus.blogs.com/lycangeek/2006/03/text_programmin.html Seo Sanghyeon From sanxiyn at gmail.com Fri Mar 24 07:01:36 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Fri, 24 Mar 2006 15:01:36 +0900 Subject: [IronPython] Python DB-API wrapper for ADO.NET for IronPython In-Reply-To: <5b0248170603230032n7747cf9fp@mail.gmail.com> References: <5b0248170603230032n7747cf9fp@mail.gmail.com> Message-ID: <5b0248170603232201l1d62c247t@mail.gmail.com> 2006/3/23, Sanghyeon Seo : > I took a stub at writing Python DB-API (PEP 249) wrapper for ADO.NET > to be used with IronPython. Currently I am testing this with MySQL > Connector/Net and is trying to be compatible with MySQLdb module. I now added connect() wrapper for pysqlite 1 using Mono ADO.NET provider for SQLite: http://www.mono-project.com/SQLite Module and examle updated: http://sparcs.kaist.ac.kr/~tinuviel/fepy/lib/dbapi.py http://sparcs.kaist.ac.kr/~tinuviel/fepy/example/database_access.py Seo Sanghyeon From sanxiyn at gmail.com Sun Mar 26 13:01:16 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Sun, 26 Mar 2006 20:01:16 +0900 Subject: [IronPython] NameError Message-ID: <5b0248170603260301y3a05cc17r@mail.gmail.com> Following script raises NameError, but it shouldn't. x = '' class C: x = x Seo Sanghyeon From rjaduthie at gmail.com Sun Mar 26 21:45:10 2006 From: rjaduthie at gmail.com (Roger Duthie) Date: Sun, 26 Mar 2006 20:45:10 +0100 Subject: [IronPython] IronMath Complex64 Compile?? Message-ID: <95ee8a7b0603261145q6ac8fe1es@mail.gmail.com> I have embarked on the python tutorial from python.org, and I've come across the fact that IronPython has no Complex64 divide routine: so I thought I'd write one having done one for Java. The doctoring of the Complex64 .cs file was easy; however, how does one compile the file for use in the IronMath package?? Roger -------------- next part -------------- An HTML attachment was scrubbed... URL: From sanxiyn at gmail.com Mon Mar 27 10:26:11 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Mon, 27 Mar 2006 17:26:11 +0900 Subject: [IronPython] Updating globals() Message-ID: <5b0248170603270026q38993b99r@mail.gmail.com> Updating module-level globals() raises AttributeError. vars = {'a': 1, 'b': 2} globals().update(vars) print a, b Seo Sanghyeon From sanxiyn at gmail.com Mon Mar 27 10:27:52 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Mon, 27 Mar 2006 17:27:52 +0900 Subject: [IronPython] Updating globals() In-Reply-To: <5b0248170603270026q38993b99r@mail.gmail.com> References: <5b0248170603270026q38993b99r@mail.gmail.com> Message-ID: <5b0248170603270027x71a53aebo@mail.gmail.com> 2006/3/27, Sanghyeon Seo : > Updating module-level globals() raises AttributeError. This happens only when run from the file. Interactive console is fine. Seo Sanghyeon From rene.olsthoorn at gmail.com Mon Mar 27 10:51:40 2006 From: rene.olsthoorn at gmail.com (Rene Olsthoorn) Date: Mon, 27 Mar 2006 10:51:40 +0200 Subject: [IronPython] Updating globals() In-Reply-To: <5b0248170603270026q38993b99r@mail.gmail.com> References: <5b0248170603270026q38993b99r@mail.gmail.com> Message-ID: <6bae3bf30603270051g52c834deo6e89c4a3672b5e8a@mail.gmail.com> Hello Seo, On Windows XP, it runs without a problem. Greets, Rene Olsthoorn. On 3/27/06, Sanghyeon Seo wrote: > Updating module-level globals() raises AttributeError. > > vars = {'a': 1, 'b': 2} > globals().update(vars) > print a, b > > Seo Sanghyeon > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From sanxiyn at gmail.com Mon Mar 27 11:32:24 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Mon, 27 Mar 2006 18:32:24 +0900 Subject: [IronPython] Updating globals() In-Reply-To: <6bae3bf30603270051g52c834deo6e89c4a3672b5e8a@mail.gmail.com> References: <5b0248170603270026q38993b99r@mail.gmail.com> <6bae3bf30603270051g52c834deo6e89c4a3672b5e8a@mail.gmail.com> Message-ID: <5b0248170603270132m60d4521bi@mail.gmail.com> 2006/3/27, Rene Olsthoorn : > On Windows XP, it runs without a problem. Strange, I can reproduce this on Windows XP too. Seo Sanghyeon From andrzej.krzywda at resolversystems.com Mon Mar 27 14:54:38 2006 From: andrzej.krzywda at resolversystems.com (Andrzej Krzywda) Date: Mon, 27 Mar 2006 13:54:38 +0100 Subject: [IronPython] .NET Attributes Message-ID: <4427E08E.8090001@resolversystems.com> Hi, When there will be support for .NET Attributes in IronPython? Is there any way currently to mark my class as Serializable? -- Andrzej From dinov at exchange.microsoft.com Mon Mar 27 18:30:01 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 27 Mar 2006 08:30:01 -0800 Subject: [IronPython] Updating globals() In-Reply-To: <5b0248170603270026q38993b99r@mail.gmail.com> Message-ID: <4039D552ADAB094BB1EA670F3E96214E022B3B39@df-foxhound-msg.exchange.corp.microsoft.com> Thanks for the bug report Seo. I can repro this on our current builds and have filed the bug. I think we'll be able to get this one fixed for beta 5. Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Sanghyeon Seo Sent: Monday, March 27, 2006 12:26 AM To: Discussion of IronPython Subject: [IronPython] Updating globals() Updating module-level globals() raises AttributeError. vars = {'a': 1, 'b': 2} globals().update(vars) print a, b Seo Sanghyeon _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Mon Mar 27 18:31:17 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 27 Mar 2006 08:31:17 -0800 Subject: [IronPython] Updating globals() In-Reply-To: <6bae3bf30603270051g52c834deo6e89c4a3672b5e8a@mail.gmail.com> Message-ID: <4039D552ADAB094BB1EA670F3E96214E022B3B3D@df-foxhound-msg.exchange.corp.microsoft.com> Did you run it at the console or from a file you imported? IronPython will actually use different underlying CLR dictionary objects depending on how the code gets compiled (which is the reason why this compiles in one spot but not another). Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Rene Olsthoorn Sent: Monday, March 27, 2006 12:52 AM To: Discussion of IronPython Subject: Re: [IronPython] Updating globals() Hello Seo, On Windows XP, it runs without a problem. Greets, Rene Olsthoorn. On 3/27/06, Sanghyeon Seo wrote: > Updating module-level globals() raises AttributeError. > > vars = {'a': 1, 'b': 2} > globals().update(vars) > print a, b > > Seo Sanghyeon > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Mon Mar 27 18:45:40 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 27 Mar 2006 08:45:40 -0800 Subject: [IronPython] .NET Attributes In-Reply-To: <4427E08E.8090001@resolversystems.com> Message-ID: <4039D552ADAB094BB1EA670F3E96214E022B3B56@df-foxhound-msg.exchange.corp.microsoft.com> This is a tough problem... There are two issues here. But the executive summary here is I'd say the earliest you should *expect* to see this is 1.1, but if (somehow) we end up with some extra time we might have something in the 1.0 timeframe (but don't hold your breath!). The first issue here is that when your code gets compiled we don't create what are truly .NET classes. Let's forget about old-style classes for a second (as those are REALLY not .NET classes, and never will be) and instead focus on new-style classes. When you define a class we'll see if anyone else has inherited from the same set of base-types (including .NET interfaces). If someone has then we'll use that class instead of creating a new class. If they haven't we'll derive a new class from your base-class set, overriding all of the virtual methods, and creating some new fields like __dict__ and __class__. Those fields allow us to both allow you to change the type of your classes at runtime as well as attach new properties to instances. They also allow us to create a limited number of CLR types (which aren't garbage collected) which means long-running programs creating lots of types don't leak. In the end there's not really anything good for us to attach the attributes to. To get that we'd need to move to a more static-compilation model while at the same time retaining the ability to do all the great dynamic stuff with Python. It's a hard problem and one that we simply haven't solved yet. The second problem is also just as tough, but it's completely different. How do you even express an attribute on a class? There's no Python syntax for this so we'd have to add something new. It'd be great if we could use decorators here, but they don't apply to classes. So maybe that's something like __attributes__ = [Serializable, ...] or something along those lines but it's not clear what's the best way to go here... Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Andrzej Krzywda Sent: Monday, March 27, 2006 4:55 AM To: users at lists.ironpython.com Subject: [IronPython] .NET Attributes Hi, When there will be support for .NET Attributes in IronPython? Is there any way currently to mark my class as Serializable? -- Andrzej _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From ionrock at gmail.com Mon Mar 27 19:10:41 2006 From: ionrock at gmail.com (Eric Larson) Date: Mon, 27 Mar 2006 11:10:41 -0600 Subject: [IronPython] .NET Attributes In-Reply-To: <4039D552ADAB094BB1EA670F3E96214E022B3B56@df-foxhound-msg.exchange.corp.microsoft.com> References: <4427E08E.8090001@resolversystems.com> <4039D552ADAB094BB1EA670F3E96214E022B3B56@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <6e46dd1e0603270910m242ba1c5ic3e0cd1807b2b58a@mail.gmail.com> On the topic of decorators and integrating with .NET, it seems that in order to keep IronPython as close to CPython, it would be a good idea to consider adding .NET specific pieces as a "library" instead of an addition to the language. That way people could write python code that works in IronPython and CPython equally well without changing radically how the code is written. For example, if I wanted to make a class serializable, it seems logical to inherit from some serializable base class. from clr.netisms import IPSerializable class MyClass(IPSerializable): .... This may be an obvious solution, but it seems to make more sense to add IronPython specific libraries to help integrate with .NET than to pollute the language. I mention this because one of the great things about Python is the "batteries included" mentality. There are many great libraries that would be excellent to run using IronPython (ZODB for example) that may conflict if the language gets massaged to fit into .NET perfectly. Often times writing to the lowest common denominator can be bad (SQL portability for example), but I believe in the case of Python, whatever can be done to work with the massive amount of libraries will be the most beneficial. I apologize if this is already addressed. I am thinking about issues such as these from a python programmer's perspective. Great work! Eric On 3/27/06, Dino Viehland wrote: > > This is a tough problem... There are two issues here. But the executive > summary here is I'd say the earliest you should *expect* to see this is > 1.1, but if (somehow) we end up with some extra time we might have > something in the 1.0 timeframe (but don't hold your breath!). > > The first issue here is that when your code gets compiled we don't create > what are truly .NET classes. Let's forget about old-style classes for a > second (as those are REALLY not .NET classes, and never will be) and instead > focus on new-style classes. > > When you define a class we'll see if anyone else has inherited from the > same set of base-types (including .NET interfaces). If someone has then > we'll use that class instead of creating a new class. If they haven't we'll > derive a new class from your base-class set, overriding all of the virtual > methods, and creating some new fields like __dict__ and __class__. Those > fields allow us to both allow you to change the type of your classes at > runtime as well as attach new properties to instances. They also allow us > to create a limited number of CLR types (which aren't garbage collected) > which means long-running programs creating lots of types don't leak. > > In the end there's not really anything good for us to attach the > attributes to. To get that we'd need to move to a more static-compilation > model while at the same time retaining the ability to do all the great > dynamic stuff with Python. It's a hard problem and one that we simply > haven't solved yet. > > The second problem is also just as tough, but it's completely > different. How do you even express an attribute on a class? There's no > Python syntax for this so we'd have to add something new. It'd be great if > we could use decorators here, but they don't apply to classes. So maybe > that's something like __attributes__ = [Serializable, ...] or something > along those lines but it's not clear what's the best way to go here... > > > > Do you want to help develop Dynamic languages on CLR? ( > http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038 > ) > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] On Behalf Of Andrzej Krzywda > Sent: Monday, March 27, 2006 4:55 AM > To: users at lists.ironpython.com > Subject: [IronPython] .NET Attributes > > Hi, > > When there will be support for .NET Attributes in IronPython? > Is there any way currently to mark my class as Serializable? > > -- > Andrzej > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Mon Mar 27 19:14:45 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 27 Mar 2006 09:14:45 -0800 Subject: [IronPython] .NET Attributes In-Reply-To: <6e46dd1e0603270910m242ba1c5ic3e0cd1807b2b58a@mail.gmail.com> Message-ID: <4039D552ADAB094BB1EA670F3E96214E022B3B9B@df-foxhound-msg.exchange.corp.microsoft.com> This is great feedback.... And yet another way we could consider doing this would be something whacky with metaclasses where we had an "attribute-aware" metaclass or something like that... But it demonstrates the difficulty in adding support for features like this and the reason we need to tread lightly here. Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Eric Larson Sent: Monday, March 27, 2006 9:11 AM To: Discussion of IronPython Subject: Re: [IronPython] .NET Attributes On the topic of decorators and integrating with .NET, it seems that in order to keep IronPython as close to CPython, it would be a good idea to consider adding .NET specific pieces as a "library" instead of an addition to the language. That way people could write python code that works in IronPython and CPython equally well without changing radically how the code is written. For example, if I wanted to make a class serializable, it seems logical to inherit from some serializable base class. from clr.netisms import IPSerializable class MyClass(IPSerializable): .... This may be an obvious solution, but it seems to make more sense to add IronPython specific libraries to help integrate with .NET than to pollute the language. I mention this because one of the great things about Python is the "batteries included" mentality. There are many great libraries that would be excellent to run using IronPython (ZODB for example) that may conflict if the language gets massaged to fit into .NET perfectly. Often times writing to the lowest common denominator can be bad (SQL portability for example), but I believe in the case of Python, whatever can be done to work with the massive amount of libraries will be the most beneficial. I apologize if this is already addressed. I am thinking about issues such as these from a python programmer's perspective. Great work! Eric On 3/27/06, Dino Viehland > wrote: This is a tough problem... There are two issues here. But the executive summary here is I'd say the earliest you should *expect* to see this is 1.1, but if (somehow) we end up with some extra time we might have something in the 1.0 timeframe (but don't hold your breath!). The first issue here is that when your code gets compiled we don't create what are truly .NET classes. Let's forget about old-style classes for a second (as those are REALLY not .NET classes, and never will be) and instead focus on new-style classes. When you define a class we'll see if anyone else has inherited from the same set of base-types (including .NET interfaces). If someone has then we'll use that class instead of creating a new class. If they haven't we'll derive a new class from your base-class set, overriding all of the virtual methods, and creating some new fields like __dict__ and __class__. Those fields allow us to both allow you to change the type of your classes at runtime as well as attach new properties to instances. They also allow us to create a limited number of CLR types (which aren't garbage collected) which means long-running programs creating lots of types don't leak. In the end there's not really anything good for us to attach the attributes to. To get that we'd need to move to a more static-compilation model while at the same time retaining the ability to do all the great dynamic stuff with Python. It's a hard problem and one that we simply haven't solved yet. The second problem is also just as tough, but it's completely different. How do you even express an attribute on a class? There's no Python syntax for this so we'd have to add something new. It'd be great if we could use decorators here, but they don't apply to classes. So maybe that's something like __attributes__ = [Serializable, ...] or something along those lines but it's not clear what's the best way to go here... Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038 ) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com ] On Behalf Of Andrzej Krzywda Sent: Monday, March 27, 2006 4:55 AM To: users at lists.ironpython.com Subject: [IronPython] .NET Attributes Hi, When there will be support for .NET Attributes in IronPython? Is there any way currently to mark my class as Serializable? -- Andrzej _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From kfarmer at thuban.org Mon Mar 27 23:44:48 2006 From: kfarmer at thuban.org (Keith J. Farmer) Date: Mon, 27 Mar 2006 13:44:48 -0800 Subject: [IronPython] .NET Attributes References: <4039D552ADAB094BB1EA670F3E96214E022B3B9B@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: For the purposes of consistency, the attribute decorators would need to apply everywhere an attribute is able to exist in .NET: types, members, etc. In the case of Serializable, merely subclassing ISerializable isn't necessarily the best way, since a class can be decorated with SerializableAttribute instead. Would magic comments be sufficient? eg // ATTRIBUTE: Serializeable class MyClass(FooBase): // ATTRIBUTE: MyMemberAttribute def Foo(): .... (Forgive my Python -- it's a little rusty...) Actually, wasn't there a PEP regarding decorators? -------------- next part -------------- A non-text attachment was scrubbed... Name: winmail.dat Type: application/ms-tnef Size: 4305 bytes Desc: not available URL: From myeates at jpl.nasa.gov Mon Mar 27 23:47:19 2006 From: myeates at jpl.nasa.gov (Mathew Yeates) Date: Mon, 27 Mar 2006 13:47:19 -0800 Subject: [IronPython] what version of IronPython works with mono 1.1.13.4? Message-ID: <44285D67.30407@jpl.nasa.gov> Hi I'm using mono 1.1.13.4 and calls to IronPython 1.0 Beta 4 cause a segv. What version of IronPython works?? Mathew ** (/home/myeates/mono-1.1.13.4/lib/xsp/1.0/xsp.exe:20873): WARNING **: The class System.Collections.Generic.IDictionary`2 could not be loaded, used in mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ================================================================= Got a SIGSEGV while executing native code. This usually indicates a fatal error in the mono runtime or one of the native libraries used by your application. ================================================================= Stacktrace: in WebService100.Service1:HelloWorld (int) <0xffffffff> in WebService100.Service1:HelloWorld (int) <0x24> in (wrapper runtime-invoke) System.Object:runtime_invoke_string_int (object,intptr,intptr,intptr) <0x74eaf9f> in (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[]) <0x4> in (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[]) <0xffdf651d> in System.Reflection.MonoMethod:Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) <0x8d> in System.Reflection.MethodBase:Invoke (object,object[]) <0x1a> in System.Web.Services.Protocols.LogicalMethodInfo:Invoke (object,object[]) <0x88> in System.Web.Services.Protocols.HttpSimpleWebServiceHandler:Invoke (System.Web.Services.Protocols.LogicalMethodInfo,object[]) <0x41> in System.Web.Services.Protocols.HttpSimpleWebServiceHandler:ProcessRequest (System.Web.HttpContext) <0x143> in __1:MoveNext () <0x10a0> in System.Web.HttpApplication:Tick () <0x1f> in System.Web.HttpApplication:Start (object) <0x37> in System.Web.HttpApplication:System.Web.IHttpAsyncHandler.BeginProcessRequest (System.Web.HttpContext,System.AsyncCallback,object) <0x68> in System.Web.HttpRuntime:RealProcessRequest (object) <0x1ab> in Mono.WebServer.BaseApplicationHost:ProcessRequest (Mono.WebServer.MonoWorkerRequest) <0x43> in Mono.WebServer.XSPApplicationHost:ProcessRequest (int,long,int,long,int,string,string,string,string,byte[],string,intptr,Mono.WebServer.SslInformations) <0x37f> in (wrapper remoting-invoke-with-check) Mono.WebServer.XSPApplicationHost:ProcessRequest (int,long,int,long,int,string,string,string,string,byte[],string,intptr,Mono.WebServer.SslInformations) <0xfffffa6c> in (wrapper xdomain-dispatch) Mono.WebServer.XSPApplicationHost:ProcessRequest (object,byte[]&,byte[]&,int,long,int,long,int,string,string,string,string,byte[],string) <0x3ce4cb> in (wrapper xdomain-invoke) Mono.WebServer.XSPApplicationHost:ProcessRequest (int,long,int,long,int,string,string,string,string,byte[],string,intptr,Mono.WebServer.SslInformations) <0xffc216c5> in (wrapper remoting-invoke-with-check) Mono.WebServer.XSPApplicationHost:ProcessRequest (int,long,int,long,int,string,string,string,string,byte[],string,intptr,Mono.WebServer.SslInformations) <0x3eb0b> in Mono.WebServer.XSPWorker:InnerRun (object) <0x563> in Mono.WebServer.XSPWorker:Run (object) <0x22> in (wrapper delegate-invoke) System.MulticastDelegate:invoke_void_object (object) <0xffffff95> in (wrapper runtime-invoke) System.Object:runtime_invoke_void_object (object,intptr,intptr,intptr) <0x78d82bf> From vargaz at gmail.com Tue Mar 28 00:12:25 2006 From: vargaz at gmail.com (Zoltan Varga) Date: Tue, 28 Mar 2006 00:12:25 +0200 Subject: [IronPython] what version of IronPython works with mono 1.1.13.4? In-Reply-To: <44285D67.30407@jpl.nasa.gov> References: <44285D67.30407@jpl.nasa.gov> Message-ID: <295e750a0603271412s186b2accx8fc4bbea7cc63859@mail.gmail.com> 1.1.13.4 should work with IronPython, but you seem to be running it inside xsp, which is a net 1.1 app. Try using 'xsp2'. Zoltan On 3/27/06, Mathew Yeates wrote: > Hi > I'm using mono 1.1.13.4 and calls to IronPython 1.0 Beta 4 cause a segv. > What version of IronPython works?? > Mathew > > > ** (/home/myeates/mono-1.1.13.4/lib/xsp/1.0/xsp.exe:20873): WARNING **: > The class System.Collections.Generic.IDictionary`2 could not be loaded, > used in mscorlib, Version=2.0.0.0, Culture=neutral, > PublicKeyToken=b77a5c561934e089 > > ================================================================= > Got a SIGSEGV while executing native code. This usually indicates > a fatal error in the mono runtime or one of the native libraries > used by your application. > ================================================================= > > Stacktrace: > in WebService100.Service1:HelloWorld (int) <0xffffffff> > in WebService100.Service1:HelloWorld (int) <0x24> > in (wrapper runtime-invoke) System.Object:runtime_invoke_string_int > (object,intptr,intptr,intptr) <0x74eaf9f> > in (wrapper managed-to-native) > System.Reflection.MonoMethod:InternalInvoke (object,object[]) <0x4> > in (wrapper managed-to-native) > System.Reflection.MonoMethod:InternalInvoke (object,object[]) <0xffdf651d> > in System.Reflection.MonoMethod:Invoke > (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) > <0x8d> > in System.Reflection.MethodBase:Invoke (object,object[]) <0x1a> > in System.Web.Services.Protocols.LogicalMethodInfo:Invoke > (object,object[]) <0x88> > in System.Web.Services.Protocols.HttpSimpleWebServiceHandler:Invoke > (System.Web.Services.Protocols.LogicalMethodInfo,object[]) <0x41> > in > System.Web.Services.Protocols.HttpSimpleWebServiceHandler:ProcessRequest > (System.Web.HttpContext) <0x143> > in __1:MoveNext () <0x10a0> > in System.Web.HttpApplication:Tick () <0x1f> > in System.Web.HttpApplication:Start (object) <0x37> > in > System.Web.HttpApplication:System.Web.IHttpAsyncHandler.BeginProcessRequest > (System.Web.HttpContext,System.AsyncCallback,object) <0x68> > in System.Web.HttpRuntime:RealProcessRequest (object) <0x1ab> > in Mono.WebServer.BaseApplicationHost:ProcessRequest > (Mono.WebServer.MonoWorkerRequest) <0x43> > in Mono.WebServer.XSPApplicationHost:ProcessRequest > (int,long,int,long,int,string,string,string,string,byte[],string,intptr,Mono.WebServer.SslInformations) > <0x37f> > in (wrapper remoting-invoke-with-check) > Mono.WebServer.XSPApplicationHost:ProcessRequest > (int,long,int,long,int,string,string,string,string,byte[],string,intptr,Mono.WebServer.SslInformations) > <0xfffffa6c> > in (wrapper xdomain-dispatch) > Mono.WebServer.XSPApplicationHost:ProcessRequest > (object,byte[]&,byte[]&,int,long,int,long,int,string,string,string,string,byte[],string) > <0x3ce4cb> > in (wrapper xdomain-invoke) > Mono.WebServer.XSPApplicationHost:ProcessRequest > (int,long,int,long,int,string,string,string,string,byte[],string,intptr,Mono.WebServer.SslInformations) > <0xffc216c5> > in (wrapper remoting-invoke-with-check) > Mono.WebServer.XSPApplicationHost:ProcessRequest > (int,long,int,long,int,string,string,string,string,byte[],string,intptr,Mono.WebServer.SslInformations) > <0x3eb0b> > in Mono.WebServer.XSPWorker:InnerRun (object) <0x563> > in Mono.WebServer.XSPWorker:Run (object) <0x22> > in (wrapper delegate-invoke) System.MulticastDelegate:invoke_void_object > (object) <0xffffff95> > in (wrapper runtime-invoke) System.Object:runtime_invoke_void_object > (object,intptr,intptr,intptr) <0x78d82bf> > > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From ionrock at gmail.com Tue Mar 28 06:25:12 2006 From: ionrock at gmail.com (Eric Larson) Date: Mon, 27 Mar 2006 22:25:12 -0600 Subject: [IronPython] .NET Attributes In-Reply-To: References: <4039D552ADAB094BB1EA670F3E96214E022B3B9B@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <6e46dd1e0603272025k43ac2044sf4af052d63174a64@mail.gmail.com> My only point is that new decorators shouldn't be included unless they are available in the language. I know Guido said something about them at PyCon but I can't remember what :) I have no problems with decorators by the way. Cherrypy (a web framework/library) uses a decorator-ish syntax, so if implementing a library for working around .NET details and IronPython is needed, it would not be out of line to use a decorator. I just think the close CPython and IronPython can be, the better it is for everyone. Eric On 3/27/06, Keith J. Farmer wrote: > > For the purposes of consistency, the attribute decorators would need to > apply everywhere an attribute is able to exist in .NET: types, members, > etc. > > In the case of Serializable, merely subclassing ISerializable isn't > necessarily the best way, since a class can be decorated with > SerializableAttribute instead. > > Would magic comments be sufficient? eg > > // ATTRIBUTE: Serializeable > class MyClass(FooBase): > // ATTRIBUTE: MyMemberAttribute > def Foo(): > .... > > (Forgive my Python -- it's a little rusty...) > > Actually, wasn't there a PEP regarding decorators? > > > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sanxiyn at gmail.com Tue Mar 28 06:49:27 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Tue, 28 Mar 2006 13:49:27 +0900 Subject: [IronPython] .NET Attributes In-Reply-To: <4039D552ADAB094BB1EA670F3E96214E022B3B56@df-foxhound-msg.exchange.corp.microsoft.com> References: <4427E08E.8090001@resolversystems.com> <4039D552ADAB094BB1EA670F3E96214E022B3B56@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <5b0248170603272049g7339180dlf54033368318b969@mail.gmail.com> 2006/3/28, Dino Viehland : The second problem is also just as tough, but it's completely different. How do you even express an attribute on a class? There's no Python syntax for this so we'd have to add something new. It'd be great if we could use decorators here, but they don't apply to classes. So maybe that's something like __attributes__ = [Serializable, ...] or something along those lines but it's not clear what's the best way to go here... * * * I like __attributes__ solution. Seo Sanghyeon From sanxiyn at gmail.com Tue Mar 28 06:58:59 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Tue, 28 Mar 2006 13:58:59 +0900 Subject: [IronPython] .NET Attributes In-Reply-To: <5b0248170603272049g7339180dlf54033368318b969@mail.gmail.com> References: <4427E08E.8090001@resolversystems.com> <4039D552ADAB094BB1EA670F3E96214E022B3B56@df-foxhound-msg.exchange.corp.microsoft.com> <5b0248170603272049g7339180dlf54033368318b969@mail.gmail.com> Message-ID: <5b0248170603272058jdda7452u83cbaa62a775766d@mail.gmail.com> 2006/3/28, Sanghyeon Seo : > I like __attributes__ solution. As pointed out already, decorators can't be used with classes as of 2.4. But __attributes__ can be attached to classes or functions. I agree that decorators would be nice. Perhaps something like the following in clr module? def f(arg): pass f.__attributes__ = [Foo(), Bar(1)] equivalent to: @attributes(Foo(), Bar(1)) def f(arg): pass where cool_attributes = attributes(Foo(), Bar(1)) @cool_attributes def f(arg): pass @cool_attributes def g(arg): pass is possible. Just my 2c. Seo Sanghyeon From dinov at exchange.microsoft.com Tue Mar 28 07:44:56 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 27 Mar 2006 21:44:56 -0800 Subject: [IronPython] .NET Attributes In-Reply-To: <5b0248170603272058jdda7452u83cbaa62a775766d@mail.gmail.com> References: <4427E08E.8090001@resolversystems.com> <4039D552ADAB094BB1EA670F3E96214E022B3B56@df-foxhound-msg.exchange.corp.microsoft.com> <5b0248170603272049g7339180dlf54033368318b969@mail.gmail.com>, <5b0248170603272058jdda7452u83cbaa62a775766d@mail.gmail.com> Message-ID: <4039D552ADAB094BB1EA670F3E96214E235C50@df-foxhound-msg.exchange.corp.microsoft.com> I like this too... It's interesting that while the syntax isn't exactly the same for giving both classes & functions attributes they are both getting that information in the same way. I was previously worried about the differences between classes & functions but I think this brings it all together. ________________________________________ From: users-bounces at lists.ironpython.com On Behalf Of Sanghyeon Seo Sent: Monday, March 27, 2006 8:58 PM To: Discussion of IronPython Subject: Re: [IronPython] .NET Attributes 2006/3/28, Sanghyeon Seo : > I like __attributes__ solution. As pointed out already, decorators can't be used with classes as of 2.4. But __attributes__ can be attached to classes or functions. I agree that decorators would be nice. Perhaps something like the following in clr module? def f(arg): pass f.__attributes__ = [Foo(), Bar(1)] equivalent to: @attributes(Foo(), Bar(1)) def f(arg): pass where cool_attributes = attributes(Foo(), Bar(1)) @cool_attributes def f(arg): pass @cool_attributes def g(arg): pass is possible. Just my 2c. Seo Sanghyeon _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Nathan.Ernst at citadelgroup.com Tue Mar 28 15:42:24 2006 From: Nathan.Ernst at citadelgroup.com (Ernst, Nathan) Date: Tue, 28 Mar 2006 07:42:24 -0600 Subject: [IronPython] .NET Attributes Message-ID: I wouldn't give up completely on using decorators for classes. True, Python 2.4 doesn't support them on classes, only functions. I think consistency should be sought here. After reading PEP 318 (http://www.python.org/dev/peps/pep-0318/) a little closer, I noticed that there *are* some examples of using decorators on classes. (See examples 2 and 5 at the end of the PEP). While not included in 2.4, I could not find if it has been ruled out as a later enhancement. Note that there may be a potential problem using decorator syntax for attributes. In CPython, a decorator is merely a syntactical shortcut for applying a function to a function definition. It could be said that, in IronPython, the attribute is being applied to a function. To me, this seems kind of confused, as the attribute descriptor now becomes a special case descriptor for the interpreter to have to handle because the descriptor is not being called with the function/class definition as an argument. Instead, the attributes must be compiled into the generated code. It is probably not that large of a deal, though. (Just playing devil's advocate here). Despite this, I still like the decorator syntax. -Nathan -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Monday, March 27, 2006 11:45 PM To: Discussion of IronPython Subject: Re: [IronPython] .NET Attributes I like this too... It's interesting that while the syntax isn't exactly the same for giving both classes & functions attributes they are both getting that information in the same way. I was previously worried about the differences between classes & functions but I think this brings it all together. ------------------------------------------------------------------------------------------------- ------------------------- CONFIDENTIALITY AND SECURITY NOTICE This e-mail contains information that may be confidential and proprietary. It is to be read and used solely by the intended recipient(s). Citadel and its affiliates retain all proprietary rights they may have in the information. If you are not an intended recipient, please notify us immediately either by reply e-mail or by telephone at 312-395-2100 and delete this e-mail (including any attachments hereto) immediately without reading, disseminating, distributing or copying. We cannot give any assurances that this e-mail and any attachments are free of viruses and other harmful code. Citadel reserves the right to monitor, intercept and block all communications involving its computer systems. From lfranklin at texaslife.com Tue Mar 28 18:09:14 2006 From: lfranklin at texaslife.com (Lewis Franklin) Date: Tue, 28 Mar 2006 10:09:14 -0600 Subject: [IronPython] String Replacement Message-ID: <44295FAA.8050706@texaslife.com> I encountered a problem working with IronPython the other day and wanted to post to see if anyone else has experienced this problem and if it may be a bug: >>> '%02d' % 1 '01' >>> '%02d' % 12 '012' Expected Result: >>> '%02d' % 12 '12' Lewis Franklin From dinov at exchange.microsoft.com Tue Mar 28 18:32:00 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 28 Mar 2006 08:32:00 -0800 Subject: [IronPython] String Replacement In-Reply-To: <44295FAA.8050706@texaslife.com> Message-ID: <4039D552ADAB094BB1EA670F3E96214E022B4559@df-foxhound-msg.exchange.corp.microsoft.com> Definitely a bug, I don't think we've seen this one before... Thanks for the report. I've got it filed in our bug database... I'm not sure if this will be in beta 5 or not as we're quickly nearing the time for another release but if the fix is simple we'll try and get it in. Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Lewis Franklin Sent: Tuesday, March 28, 2006 8:09 AM To: users at lists.ironpython.com Subject: [IronPython] String Replacement I encountered a problem working with IronPython the other day and wanted to post to see if anyone else has experienced this problem and if it may be a bug: >>> '%02d' % 1 '01' >>> '%02d' % 12 '012' Expected Result: >>> '%02d' % 12 '12' Lewis Franklin _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From lfranklin at texaslife.com Tue Mar 28 18:35:46 2006 From: lfranklin at texaslife.com (Lewis Franklin) Date: Tue, 28 Mar 2006 10:35:46 -0600 Subject: [IronPython] String Replacement In-Reply-To: <4039D552ADAB094BB1EA670F3E96214E022B4559@df-foxhound-msg.exchange.corp.microsoft.com> References: <4039D552ADAB094BB1EA670F3E96214E022B4559@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <442965E2.5050902@texaslife.com> Thanks for the quick response. Since I'm new to this list and filing bugs for IronPython, is there a place I can see the status or should I just scan the release notes with each beta release to see when this gets fixed? Lewis Dino Viehland wrote: > Definitely a bug, I don't think we've seen this one before... Thanks for the report. > > I've got it filed in our bug database... I'm not sure if this will be in beta 5 or not as we're quickly nearing the time for another release but if the fix is simple we'll try and get it in. > > > Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Lewis Franklin > Sent: Tuesday, March 28, 2006 8:09 AM > To: users at lists.ironpython.com > Subject: [IronPython] String Replacement > > I encountered a problem working with IronPython the other day and wanted > to post to see if anyone else has experienced this problem and if it may > be a bug: > > >>> '%02d' % 1 > '01' > >>> '%02d' % 12 > '012' > > Expected Result: > >>> '%02d' % 12 > '12' > > Lewis Franklin > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > ______________________________________________________________________ > This e-mail has been scanned by MCI Managed Email Content Service, using Skeptic(tm) technology powered by MessageLabs. For more information on MCI's Managed Email Content Service, visit http://www.mci.com. > ______________________________________________________________________ > > > From dinov at exchange.microsoft.com Tue Mar 28 18:45:09 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 28 Mar 2006 08:45:09 -0800 Subject: [IronPython] String Replacement In-Reply-To: <442965E2.5050902@texaslife.com> Message-ID: <4039D552ADAB094BB1EA670F3E96214E022B4578@df-foxhound-msg.exchange.corp.microsoft.com> Unfortunately our gotdotnet bug database and our internal bug database aren't automatically kept in sync. We have plans in the future to switch to something that does a better job here. So scanning the release notes is the way to go for now (and it should be pretty easy, we'll thank you for the bug report when we fix it). Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Lewis Franklin Sent: Tuesday, March 28, 2006 8:36 AM To: Discussion of IronPython Subject: Re: [IronPython] String Replacement Thanks for the quick response. Since I'm new to this list and filing bugs for IronPython, is there a place I can see the status or should I just scan the release notes with each beta release to see when this gets fixed? Lewis Dino Viehland wrote: > Definitely a bug, I don't think we've seen this one before... Thanks for the report. > > I've got it filed in our bug database... I'm not sure if this will be in beta 5 or not as we're quickly nearing the time for another release but if the fix is simple we'll try and get it in. > > > Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Lewis Franklin > Sent: Tuesday, March 28, 2006 8:09 AM > To: users at lists.ironpython.com > Subject: [IronPython] String Replacement > > I encountered a problem working with IronPython the other day and wanted > to post to see if anyone else has experienced this problem and if it may > be a bug: > > >>> '%02d' % 1 > '01' > >>> '%02d' % 12 > '012' > > Expected Result: > >>> '%02d' % 12 > '12' > > Lewis Franklin > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > ______________________________________________________________________ > This e-mail has been scanned by MCI Managed Email Content Service, using Skeptic(tm) technology powered by MessageLabs. For more information on MCI's Managed Email Content Service, visit http://www.mci.com. > ______________________________________________________________________ > > > _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From kfarmer at thuban.org Tue Mar 28 19:55:42 2006 From: kfarmer at thuban.org (Keith J. Farmer) Date: Tue, 28 Mar 2006 09:55:42 -0800 Subject: [IronPython] .NET Attributes Message-ID: Then perhaps this is a point where we talk to Guido and ask him to bend Python a little to allow a more consistent story for Python-on-.NET. And remember that it's not just methods and classes. Members are also valid attribute targets. We could come up with a different decorator altogether without breaking Python. "//@", perhaps? (Easily uncommented in the event that Python decorators on non-classes are approved.) ----- Keith J. Farmer // kfarmer at thuban.org -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Ernst, Nathan Sent: Tuesday, 28 March 2006 05:42 To: Discussion of IronPython Subject: Re: [IronPython] .NET Attributes I wouldn't give up completely on using decorators for classes. True, Python 2.4 doesn't support them on classes, only functions. I think consistency should be sought here. After reading PEP 318 (http://www.python.org/dev/peps/pep-0318/) a little closer, I noticed that there *are* some examples of using decorators on classes. (See examples 2 and 5 at the end of the PEP). While not included in 2.4, I could not find if it has been ruled out as a later enhancement. Note that there may be a potential problem using decorator syntax for attributes. In CPython, a decorator is merely a syntactical shortcut for applying a function to a function definition. It could be said that, in IronPython, the attribute is being applied to a function. To me, this seems kind of confused, as the attribute descriptor now becomes a special case descriptor for the interpreter to have to handle because the descriptor is not being called with the function/class definition as an argument. Instead, the attributes must be compiled into the generated code. It is probably not that large of a deal, though. (Just playing devil's advocate here). Despite this, I still like the decorator syntax. -Nathan -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Monday, March 27, 2006 11:45 PM To: Discussion of IronPython Subject: Re: [IronPython] .NET Attributes I like this too... It's interesting that while the syntax isn't exactly the same for giving both classes & functions attributes they are both getting that information in the same way. I was previously worried about the differences between classes & functions but I think this brings it all together. ------------------------------------------------------------------------ ------------------------- ------------------------- CONFIDENTIALITY AND SECURITY NOTICE This e-mail contains information that may be confidential and proprietary. It is to be read and used solely by the intended recipient(s). Citadel and its affiliates retain all proprietary rights they may have in the information. If you are not an intended recipient, please notify us immediately either by reply e-mail or by telephone at 312-395-2100 and delete this e-mail (including any attachments hereto) immediately without reading, disseminating, distributing or copying. We cannot give any assurances that this e-mail and any attachments are free of viruses and other harmful code. Citadel reserves the right to monitor, intercept and block all communications involving its computer systems. _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From arman at twinsun.com Wed Mar 29 00:08:04 2006 From: arman at twinsun.com (Arman Bostani) Date: Tue, 28 Mar 2006 14:08:04 -0800 Subject: [IronPython] strange behavior with CLR types Message-ID: <4429B3C4.8030702@twinsun.com> The behavior of comparison with CLR types is not consistent. I'm using beta4 on Windows: >>> from System import * >>> UInt64.Parse('0') == 0 False >>> UInt32.Parse('0') == 0 False >>> UInt16.Parse('0') == 0 False >>> Int16.Parse('0') == 0 False >>> Int32.Parse('0') == 0 True >>> Int64.Parse('0') == 0 True >>> -arman From dinov at exchange.microsoft.com Wed Mar 29 00:52:58 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 28 Mar 2006 14:52:58 -0800 Subject: [IronPython] .NET Attributes In-Reply-To: Message-ID: <4039D552ADAB094BB1EA670F3E96214E0235B664@df-foxhound-msg.exchange.corp.microsoft.com> The usage of decorators on classes is interesting, and is worth a follow up to the python mailing lists... There's actually a lot of interesting problems like what you describe below w/ attributes and runtime vs. compile time. For example if we were to do a from __experimental__ import ... for optional static typing (http://www.artima.com/weblogs/viewpost.jsp?thread=89161) then we'd have a similar tension between doing things at runtime vs. compile time - as it's really still runtime logic that's being added.. For the most part I believe we can get the best of both worlds here. For example even though we'd be statically compiling types somewhere in the generated code is still the body used for module initialization. This code runs at import time just like it would w/ a normal python module. Likewise there are also still executable class statements (these would turn into CLR class initializers) and these would run when a class statement normally would run. The reason why I mention these is that when these run we can check and see if the static compiler made the right decisions and fix anything it did wrong at runtime. To take an example that is simpler than attributes: class foo(object): if False: def bar(self): print "Hello world!" Anyone who tries to call bar on an instance of a foo should get an exception. The static transformation of that would be into something like this: class foo { Dict myDict; static foo(){ myDict = new Dict(); if(false){ myDict['bar'] = new ReflectedMethod(foo.bar); } } public object bar(){ if(myDict['bar'] == null) throw MissingMemberException(); if(myDict['bar'] == bar) { // or something... Ops.Print('hello world'); return null; } else { return Ops.Call(barFunc); } } } Attributes here are trickier but could be handled in a similar fashion. But in this case we'd need to generate a new class at runtime that contains the correct attributes, and prevent the C# code from getting an instance of the statically compiled class (e.g. by throwing an exception whenever it gets created). That means we've effectively pushed ourselves all the way back to the fully dynamic experience but that's better than being wrong. In general we don't want to trade off ANY of the runtime facilities of Python to make this happen. Instead we want to retain all of those capabilities while generating IL & Metadata that allows other statically typed languages to consume the less-dynamic portions of the language. In other words if a Python programmer can tell we compiled the code statically at runtime we've made a mistake. But doing all of this is a lot of work... There's a reason we don't have it yet :). Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Ernst, Nathan Sent: Tuesday, March 28, 2006 5:42 AM To: Discussion of IronPython Subject: Re: [IronPython] .NET Attributes I wouldn't give up completely on using decorators for classes. True, Python 2.4 doesn't support them on classes, only functions. I think consistency should be sought here. After reading PEP 318 (http://www.python.org/dev/peps/pep-0318/) a little closer, I noticed that there *are* some examples of using decorators on classes. (See examples 2 and 5 at the end of the PEP). While not included in 2.4, I could not find if it has been ruled out as a later enhancement. Note that there may be a potential problem using decorator syntax for attributes. In CPython, a decorator is merely a syntactical shortcut for applying a function to a function definition. It could be said that, in IronPython, the attribute is being applied to a function. To me, this seems kind of confused, as the attribute descriptor now becomes a special case descriptor for the interpreter to have to handle because the descriptor is not being called with the function/class definition as an argument. Instead, the attributes must be compiled into the generated code. It is probably not that large of a deal, though. (Just playing devil's advocate here). Despite this, I still like the decorator syntax. -Nathan -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Monday, March 27, 2006 11:45 PM To: Discussion of IronPython Subject: Re: [IronPython] .NET Attributes I like this too... It's interesting that while the syntax isn't exactly the same for giving both classes & functions attributes they are both getting that information in the same way. I was previously worried about the differences between classes & functions but I think this brings it all together. ------------------------------------------------------------------------------------------------- ------------------------- CONFIDENTIALITY AND SECURITY NOTICE This e-mail contains information that may be confidential and proprietary. It is to be read and used solely by the intended recipient(s). Citadel and its affiliates retain all proprietary rights they may have in the information. If you are not an intended recipient, please notify us immediately either by reply e-mail or by telephone at 312-395-2100 and delete this e-mail (including any attachments hereto) immediately without reading, disseminating, distributing or copying. We cannot give any assurances that this e-mail and any attachments are free of viruses and other harmful code. Citadel reserves the right to monitor, intercept and block all communications involving its computer systems. _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From jvm_cop at spamcop.net Wed Mar 29 00:58:39 2006 From: jvm_cop at spamcop.net (J. Merrill) Date: Tue, 28 Mar 2006 17:58:39 -0500 Subject: [IronPython] Updating globals() Message-ID: <4.3.2.7.2.20060328175831.04b81a38@mail.comcast.net> What makes running from file work differently than the console? Are there possibly other similar issues? (Failing from the console while working from file is the more common issue, isn't it, in CPython?) At 11:30 AM 3/27/2006, Dino Viehland wrote >Thanks for the bug report Seo. I can repro this on our current builds and have filed the bug. I think we'll be able to get this one fixed for beta 5. > >Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) >-----Original Message----- >From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Sanghyeon Seo >Sent: Monday, March 27, 2006 12:26 AM >To: Discussion of IronPython >Subject: [IronPython] Updating globals() > >Updating module-level globals() raises AttributeError. > >vars = {'a': 1, 'b': 2} >globals().update(vars) >print a, b > >Seo Sanghyeon J. Merrill / Analytical Software Corp From dinov at exchange.microsoft.com Wed Mar 29 01:09:54 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 28 Mar 2006 15:09:54 -0800 Subject: [IronPython] Updating globals() In-Reply-To: <4.3.2.7.2.20060328175831.04b81a38@mail.comcast.net> Message-ID: <4039D552ADAB094BB1EA670F3E96214E0235B698@df-foxhound-msg.exchange.corp.microsoft.com> When you are running from a module we generate a module type which is a subclass of CustomDict. That CustomDict stores the field values as static variables which allows quicker access than requiring a dictionary lookup each time through (in particular the module gets to just do a ldsfld / stsfld in IL to get the value, but setting the value from outside of the module is still relatively expensive). At the console the dictionary is really just a standard dict object, so of course that one works! It turns out that we were missing the update method on the custom dict classes. We currently run our entire test suite through 2 modes: one mode is generate as snippets mode which is the same as if you were typing code in at the console. This mode is optimized to not create new types (which the CLR cannot garbage collection). This is also the mode that gets used when executing code dynamically via eval. The other is our normal mode where imported modules get compiled into real types. This mode is optimized for performance. We introduced the two-sets of test passes after the console regressions in beta 1. In this case we're just missing some coverage of doing update on the dictionary returned from globals() so we hadn't seen it. The final thing for us to review is making sure our custom dictionaries have ALL the functionality that our normal dictionaries have, and of course we'll do that as part of fixing this bug (and put in place a test case to catch any future regressions). Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of J. Merrill Sent: Tuesday, March 28, 2006 2:59 PM To: Discussion of IronPython Subject: Re: [IronPython] Updating globals() What makes running from file work differently than the console? Are there possibly other similar issues? (Failing from the console while working from file is the more common issue, isn't it, in CPython?) At 11:30 AM 3/27/2006, Dino Viehland wrote >Thanks for the bug report Seo. I can repro this on our current builds and have filed the bug. I think we'll be able to get this one fixed for beta 5. > >Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) >-----Original Message----- >From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Sanghyeon Seo >Sent: Monday, March 27, 2006 12:26 AM >To: Discussion of IronPython >Subject: [IronPython] Updating globals() > >Updating module-level globals() raises AttributeError. > >vars = {'a': 1, 'b': 2} >globals().update(vars) >print a, b > >Seo Sanghyeon J. Merrill / Analytical Software Corp _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Wed Mar 29 01:31:51 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 28 Mar 2006 15:31:51 -0800 Subject: [IronPython] String Replacement In-Reply-To: <442965E2.5050902@texaslife.com> Message-ID: <4039D552ADAB094BB1EA670F3E96214E0235B6CE@df-foxhound-msg.exchange.corp.microsoft.com> This will be fixed in beta 5 - it turns out if the number was zero padded we would always do the alternate form (ensuring the leading zero was present) which is wrong. Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Lewis Franklin Sent: Tuesday, March 28, 2006 8:36 AM To: Discussion of IronPython Subject: Re: [IronPython] String Replacement Thanks for the quick response. Since I'm new to this list and filing bugs for IronPython, is there a place I can see the status or should I just scan the release notes with each beta release to see when this gets fixed? Lewis Dino Viehland wrote: > Definitely a bug, I don't think we've seen this one before... Thanks for the report. > > I've got it filed in our bug database... I'm not sure if this will be in beta 5 or not as we're quickly nearing the time for another release but if the fix is simple we'll try and get it in. > > > Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Lewis Franklin > Sent: Tuesday, March 28, 2006 8:09 AM > To: users at lists.ironpython.com > Subject: [IronPython] String Replacement > > I encountered a problem working with IronPython the other day and wanted > to post to see if anyone else has experienced this problem and if it may > be a bug: > > >>> '%02d' % 1 > '01' > >>> '%02d' % 12 > '012' > > Expected Result: > >>> '%02d' % 12 > '12' > > Lewis Franklin > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > ______________________________________________________________________ > This e-mail has been scanned by MCI Managed Email Content Service, using Skeptic(tm) technology powered by MessageLabs. For more information on MCI's Managed Email Content Service, visit http://www.mci.com. > ______________________________________________________________________ > > > _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From jvm_cop at spamcop.net Wed Mar 29 01:40:15 2006 From: jvm_cop at spamcop.net (J. Merrill) Date: Tue, 28 Mar 2006 18:40:15 -0500 Subject: [IronPython] .NET Attributes In-Reply-To: <4039D552ADAB094BB1EA670F3E96214E0235B664@df-foxhound-msg.e xchange.corp.microsoft.com> References: Message-ID: <4.3.2.7.2.20060328180420.0478fcb0@mail.comcast.net> At 05:52 PM 3/28/2006, Dino Viehland wrote (in part) >[snip]There's actually a lot of interesting problems [with] runtime vs. compile time. For example if we were to do a from __experimental__ import ... for optional static typing [snip] At least one interpreter for a different dynamic language (APL) has the notion of "compiling" each line of code to a stack-based list of (internal) method invocations that smells (to me) a tad like what Forth is -- there's no "interpreted language" overhead left (tho there is "dynamic typing" overhead). It "compiles" a line when it's first encountered for execution. It also records the assumptions that are implicit in the decisions about what internal methods should be invoked, and re-processes the line if those assumptions turn out to be incorrect. Whether the initial "compile" activity takes place during a compile step or at runtime, it should be possible to keep track of the decisions that were made and potentially replace the code if it turns out that the decision is wrong. (Or, rather than replace the code, have both versions of the code in memory and invoke the one that matches the current situation in the future.) I had suggested something similar when dealing with the "what's the right CLR method overload to call" issue. In Python-think, there'd be a dictionary with the key being a tuple formed from the identity of the CLR method to be invoked (assembly, class, method). The associated value would be a dictionary; in that, the key is a tuple of the Python types of the parameters presented in this attempt to call the method, and the value is (normally) the identity of the CLR method to be invoked -- and if any of the Python values need to be "diddled" to match the chosen CLR overload, the referenced CLR method would be one dynamically constructed that (e.g.) converts a Python float to a CLR int64 and calls ToString on a Python class before calling the CLR method named in the source. (If the programmer discovers a wrong overload guess by IP, it should be possible to mark the guess as incorrect so the overload-guesswork will be done again -- but the info about the bad guess has to stay in the dictionary so that the same guess won't be made again. That's why I said "normally" above; details left to the reader .) The same kind of thing could be done for calling Python methods, or evaluating any Python expression, so you get different code generated when (e.g.) the method is called with (string, int) than when it's called with (int, string). In other words, record what happened before that resulted in a particular "static" code block getting generated, and be prepared to do it again if things are different at the next call. But if you want Python with static typing, you can just use Boo . J. Merrill / Analytical Software Corp From textdirected at gmail.com Wed Mar 29 03:41:11 2006 From: textdirected at gmail.com (HEMMI, Shigeru) Date: Wed, 29 Mar 2006 10:41:11 +0900 Subject: [IronPython] os.chdir - An elementary question. Message-ID: Hello, I have an elementary question. I want to use os.chdir. In IronPython, it seems os.chdir has been disabled: IronPython 1.0.2258 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import sys >>> sys.path.append(r'C:\Python24\Lib') >>> import os >>> os.chdir(r'C:\tmp') Traceback (most recent call last): File , line 0, in input##339 AttributeError: 'module' object has no attribute 'chdir' >>> os.getcwd() 'C:\\IronPython-1.0-Beta4' >>> Let me know any workaround of it. Thanks in advance. Regards, From sanxiyn at gmail.com Wed Mar 29 04:53:27 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Wed, 29 Mar 2006 11:53:27 +0900 Subject: [IronPython] os.chdir - An elementary question. In-Reply-To: References: Message-ID: <5b0248170603281853w4404aaf8vaa2e69006c1c68dc@mail.gmail.com> 2006/3/29, HEMMI, Shigeru : > I want to use os.chdir. It's not included in Beta 4, but you can add it easily. --- IronPython/Modules/nt.cs.orig 2006-03-08 11:11:30.000000000 +0900 +++ IronPython/Modules/nt.cs 2006-03-29 11:48:59.000000000 +0900 @@ -148,2 +148,7 @@ + [PythonName("chdir")] + public static void SetCurrentDirectory(string path) { + Directory.SetCurrentDirectory(path); + } + [PythonName("listdir")] Open Src\IronPython\Modules\nt.cs and add chdir function as above and rebuild. IronPython ReadMe includes instruction to rebuild from the source. I'm sure ever great IronPython team will fix this in the next release! :-) Seo Sanghyeon From textdirected at gmail.com Wed Mar 29 05:44:29 2006 From: textdirected at gmail.com (HEMMI, Shigeru) Date: Wed, 29 Mar 2006 12:44:29 +0900 Subject: [IronPython] os.chdir - An elementary question. In-Reply-To: <5b0248170603281853w4404aaf8vaa2e69006c1c68dc@mail.gmail.com> References: <5b0248170603281853w4404aaf8vaa2e69006c1c68dc@mail.gmail.com> Message-ID: Thanks, I was able to do it very easily: IronPython 1.0.2279 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import nt >>> nt.chdir(r'C:\tmp') >>> nt.getcwd() 'C:\\tmp' >>> Best Regards, 2006/3/29, Sanghyeon Seo : > 2006/3/29, HEMMI, Shigeru : > > I want to use os.chdir. > > It's not included in Beta 4, but you can add it easily. > > --- IronPython/Modules/nt.cs.orig 2006-03-08 11:11:30.000000000 +0900 > +++ IronPython/Modules/nt.cs 2006-03-29 11:48:59.000000000 +0900 > @@ -148,2 +148,7 @@ > > + [PythonName("chdir")] > + public static void SetCurrentDirectory(string path) { > + Directory.SetCurrentDirectory(path); > + } > + > [PythonName("listdir")] > > Open Src\IronPython\Modules\nt.cs and add chdir function as above and > rebuild. IronPython ReadMe includes instruction to rebuild from the > source. > > I'm sure ever great IronPython team will fix this in the next release! :-) > > Seo Sanghyeon > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From jvm_cop at spamcop.net Wed Mar 29 18:21:09 2006 From: jvm_cop at spamcop.net (J. Merrill) Date: Wed, 29 Mar 2006 11:21:09 -0500 Subject: [IronPython] Updating globals() In-Reply-To: <4039D552ADAB094BB1EA670F3E96214E0235B698@df-foxhound-msg.e xchange.corp.microsoft.com> References: <4.3.2.7.2.20060328175831.04b81a38@mail.comcast.net> Message-ID: <4.3.2.7.2.20060329110523.04978e38@mail.comcast.net> Not all attributes can be stored as static variables, or you couldn't add new ones at runtime. So there must also be a dictionary in the CustomDict subclass -- right? Are the only attributes that are made into statics the "all modules have these" names? (That is, the names I would find if I create a new Module object and examine it?) Or does make the names assigned in the __init__ method static as well? What happens if one of the static-var-stored dictionary entries gets removed from one of these CustomDict subclasses? Is there a value that can be stored in the corresponding static variable that means "do a name lookup within superclasses to find this when you get this value (and raise a NameError if it's not found)" so that removing an entry will work correctly? (If retrieving one of the static-var-stored values is really just ldsfld / stsfld, with no check for whether the value returned means "there's no entry here", can things work right?) Maybe I should do some testing -- but it might not be fruitful until the just-discovered bug is fixed. At 06:09 PM 3/28/2006, Dino Viehland wrote (in part) >When you are running from a module we generate a module type which is a subclass of CustomDict. That CustomDict stores the field values as static variables which allows quicker access than requiring a dictionary lookup each time through (in particular the module gets to just do a ldsfld / stsfld in IL to get the value, but setting the value from outside of the module is still relatively expensive). >[snip] J. Merrill / Analytical Software Corp From dinov at exchange.microsoft.com Wed Mar 29 19:08:24 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 29 Mar 2006 09:08:24 -0800 Subject: [IronPython] Updating globals() In-Reply-To: <4.3.2.7.2.20060329110523.04978e38@mail.comcast.net> Message-ID: <4039D552ADAB094BB1EA670F3E96214E0235BAEA@df-foxhound-msg.exchange.corp.microsoft.com> The statics actually come from all of the global variables referred to in the module. So for example in a case like: from sys import * min(2,3,4) min would become a static variable. When the import occurs we update the modules dictionary which will recognize that min is an extra key and we'll update the static variable instead of updating the underlying dictionary. Which brings me to your second question - there is an underlying dictionary that will be lazily created if a user tries to use keys that aren't otherwise present. If the user deletes an extra key we will store a value of Uninitialize(attrName) for the value. We also check to see if the value is Uninitialized before handing it back to the user (and say it doesn't exist if it is Uninitialized). Uninitialized is a sealed class in the IronPython runtime and it's also used in other cases (for example when you delete a local we assign Uninitialized to it). And we do also check for Uninitialized after the ldsfld as well. If you want to test it out and see if you can hit any corner cases that don't work that'd be great. I don't think the update should really block you too much as it's just one API that isn't available (everything else should just work). Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of J. Merrill Sent: Wednesday, March 29, 2006 8:21 AM To: Discussion of IronPython Subject: Re: [IronPython] Updating globals() Not all attributes can be stored as static variables, or you couldn't add new ones at runtime. So there must also be a dictionary in the CustomDict subclass -- right? Are the only attributes that are made into statics the "all modules have these" names? (That is, the names I would find if I create a new Module object and examine it?) Or does make the names assigned in the __init__ method static as well? What happens if one of the static-var-stored dictionary entries gets removed from one of these CustomDict subclasses? Is there a value that can be stored in the corresponding static variable that means "do a name lookup within superclasses to find this when you get this value (and raise a NameError if it's not found)" so that removing an entry will work correctly? (If retrieving one of the static-var-stored values is really just ldsfld / stsfld, with no check for whether the value returned means "there's no entry here", can things work right?) Maybe I should do some testing -- but it might not be fruitful until the just-discovered bug is fixed. At 06:09 PM 3/28/2006, Dino Viehland wrote (in part) >When you are running from a module we generate a module type which is a subclass of CustomDict. That CustomDict stores the field values as static variables which allows quicker access than requiring a dictionary lookup each time through (in particular the module gets to just do a ldsfld / stsfld in IL to get the value, but setting the value from outside of the module is still relatively expensive). >[snip] J. Merrill / Analytical Software Corp _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From yalvi at exchange.microsoft.com Wed Mar 29 20:47:35 2006 From: yalvi at exchange.microsoft.com (Yasir Alvi) Date: Wed, 29 Mar 2006 10:47:35 -0800 Subject: [IronPython] os.chdir - An elementary question. In-Reply-To: Message-ID: <2D38793E06D9DE449285146407202692026A676B@df-foxhound-msg.exchange.corp.microsoft.com> I've filed this bug...it'll be fixed for Beta 5. Thanks, Yasir -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of HEMMI, Shigeru Sent: Tuesday, March 28, 2006 7:44 PM To: Discussion of IronPython Subject: Re: [IronPython] os.chdir - An elementary question. Thanks, I was able to do it very easily: IronPython 1.0.2279 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import nt >>> nt.chdir(r'C:\tmp') >>> nt.getcwd() 'C:\\tmp' >>> Best Regards, 2006/3/29, Sanghyeon Seo : > 2006/3/29, HEMMI, Shigeru : > > I want to use os.chdir. > > It's not included in Beta 4, but you can add it easily. > > --- IronPython/Modules/nt.cs.orig 2006-03-08 11:11:30.000000000 +0900 > +++ IronPython/Modules/nt.cs 2006-03-29 11:48:59.000000000 +0900 > @@ -148,2 +148,7 @@ > > + [PythonName("chdir")] > + public static void SetCurrentDirectory(string path) { > + Directory.SetCurrentDirectory(path); > + } > + > [PythonName("listdir")] > > Open Src\IronPython\Modules\nt.cs and add chdir function as above and > rebuild. IronPython ReadMe includes instruction to rebuild from the > source. > > I'm sure ever great IronPython team will fix this in the next release! :-) > > Seo Sanghyeon > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From myeates at jpl.nasa.gov Wed Mar 29 23:02:19 2006 From: myeates at jpl.nasa.gov (Mathew Yeates) Date: Wed, 29 Mar 2006 13:02:19 -0800 Subject: [IronPython] can't import nt Message-ID: <442AF5DB.6080200@jpl.nasa.gov> Hi From the IronPython Console I try and import nt (I need to spawn a process) but I get "ImportError: no module named nt". Anybody know why? I can import other modules like errno. Mathew From dinov at exchange.microsoft.com Wed Mar 29 23:06:10 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 29 Mar 2006 13:06:10 -0800 Subject: [IronPython] can't import nt In-Reply-To: <442AF5DB.6080200@jpl.nasa.gov> Message-ID: <4039D552ADAB094BB1EA670F3E96214E0235BEB1@df-foxhound-msg.exchange.corp.microsoft.com> Are you running on Mono or Rotor on a Unix OS? If so we re-name nt to be unix there. Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Mathew Yeates Sent: Wednesday, March 29, 2006 1:02 PM To: Discussion of IronPython Subject: [IronPython] can't import nt Hi From the IronPython Console I try and import nt (I need to spawn a process) but I get "ImportError: no module named nt". Anybody know why? I can import other modules like errno. Mathew _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From myeates at jpl.nasa.gov Wed Mar 29 23:08:54 2006 From: myeates at jpl.nasa.gov (Mathew Yeates) Date: Wed, 29 Mar 2006 13:08:54 -0800 Subject: [IronPython] can't import nt In-Reply-To: <4039D552ADAB094BB1EA670F3E96214E0235BEB1@df-foxhound-msg.exchange.corp.microsoft.com> References: <4039D552ADAB094BB1EA670F3E96214E0235BEB1@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <442AF766.3070008@jpl.nasa.gov> I'm running mono on Linux. I just tried "import unix" and that didnt work either Mathew Dino Viehland wrote: > Are you running on Mono or Rotor on a Unix OS? If so we re-name nt to be unix there. > > > > Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Mathew Yeates > Sent: Wednesday, March 29, 2006 1:02 PM > To: Discussion of IronPython > Subject: [IronPython] can't import nt > > Hi > From the IronPython Console I try and import nt (I need to spawn a > process) but I get "ImportError: no module named nt". Anybody know why? > I can import other modules like errno. > > Mathew > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > From dinov at exchange.microsoft.com Wed Mar 29 23:10:47 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 29 Mar 2006 13:10:47 -0800 Subject: [IronPython] can't import nt In-Reply-To: <442AF766.3070008@jpl.nasa.gov> Message-ID: <4039D552ADAB094BB1EA670F3E96214E0235BEC7@df-foxhound-msg.exchange.corp.microsoft.com> Oh, sorry, I got it wrong - it's actually "posix" that we rename it to, not unix... It helps if I look at the code :) Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Mathew Yeates Sent: Wednesday, March 29, 2006 1:09 PM To: Discussion of IronPython Subject: Re: [IronPython] can't import nt I'm running mono on Linux. I just tried "import unix" and that didnt work either Mathew Dino Viehland wrote: > Are you running on Mono or Rotor on a Unix OS? If so we re-name nt to be unix there. > > > > Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Mathew Yeates > Sent: Wednesday, March 29, 2006 1:02 PM > To: Discussion of IronPython > Subject: [IronPython] can't import nt > > Hi > From the IronPython Console I try and import nt (I need to spawn a > process) but I get "ImportError: no module named nt". Anybody know why? > I can import other modules like errno. > > Mathew > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From myeates at jpl.nasa.gov Wed Mar 29 23:12:31 2006 From: myeates at jpl.nasa.gov (Mathew Yeates) Date: Wed, 29 Mar 2006 13:12:31 -0800 Subject: [IronPython] can't import nt In-Reply-To: <4039D552ADAB094BB1EA670F3E96214E0235BEC7@df-foxhound-msg.exchange.corp.microsoft.com> References: <4039D552ADAB094BB1EA670F3E96214E0235BEC7@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <442AF83F.5050801@jpl.nasa.gov> bingo! Dino Viehland wrote: > Oh, sorry, I got it wrong - it's actually "posix" that we rename it to, not unix... It helps if I look at the code :) > > Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Mathew Yeates > Sent: Wednesday, March 29, 2006 1:09 PM > To: Discussion of IronPython > Subject: Re: [IronPython] can't import nt > > I'm running mono on Linux. I just tried "import unix" and that didnt > work either > Mathew > > Dino Viehland wrote: > >> Are you running on Mono or Rotor on a Unix OS? If so we re-name nt to be unix there. >> >> >> >> Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) >> >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Mathew Yeates >> Sent: Wednesday, March 29, 2006 1:02 PM >> To: Discussion of IronPython >> Subject: [IronPython] can't import nt >> >> Hi >> From the IronPython Console I try and import nt (I need to spawn a >> process) but I get "ImportError: no module named nt". Anybody know why? >> I can import other modules like errno. >> >> Mathew >> _______________________________________________ >> users mailing list >> users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> _______________________________________________ >> users mailing list >> users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> >> > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > From alleykat at gmail.com Wed Mar 29 23:15:07 2006 From: alleykat at gmail.com (Travis Watkins) Date: Wed, 29 Mar 2006 15:15:07 -0600 Subject: [IronPython] can't import nt In-Reply-To: <442AF83F.5050801@jpl.nasa.gov> References: <4039D552ADAB094BB1EA670F3E96214E0235BEC7@df-foxhound-msg.exchange.corp.microsoft.com> <442AF83F.5050801@jpl.nasa.gov> Message-ID: On 3/29/06, Mathew Yeates wrote: > bingo! > It's usually a good idea to just import the os module. it's a wrapper (at least in cpython) around the nt, posix, etc modules so you can use it anywhere. -- Travis Watkins http://www.realistanew.com From myeates at jpl.nasa.gov Wed Mar 29 23:43:36 2006 From: myeates at jpl.nasa.gov (Mathew Yeates) Date: Wed, 29 Mar 2006 13:43:36 -0800 Subject: [IronPython] can't import nt In-Reply-To: References: <4039D552ADAB094BB1EA670F3E96214E0235BEC7@df-foxhound-msg.exchange.corp.microsoft.com> <442AF83F.5050801@jpl.nasa.gov> Message-ID: <442AFF88.7090705@jpl.nasa.gov> "import os" doesn't work Travis Watkins wrote: > On 3/29/06, Mathew Yeates wrote: > >> bingo! >> >> > > It's usually a good idea to just import the os module. it's a wrapper > (at least in cpython) around the nt, posix, etc modules so you can use > it anywhere. > > -- > Travis Watkins > http://www.realistanew.com > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > From dinov at exchange.microsoft.com Thu Mar 30 00:04:15 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 29 Mar 2006 14:04:15 -0800 Subject: [IronPython] can't import nt In-Reply-To: <442AFF88.7090705@jpl.nasa.gov> Message-ID: <4039D552ADAB094BB1EA670F3E96214E0235BF80@df-foxhound-msg.exchange.corp.microsoft.com> You'll need to download the CPython distribution (www.python.org) and copy it's Lib directory into the same directory as IronPythonConsole.exe. Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Mathew Yeates Sent: Wednesday, March 29, 2006 1:44 PM To: Discussion of IronPython Subject: Re: [IronPython] can't import nt "import os" doesn't work Travis Watkins wrote: > On 3/29/06, Mathew Yeates wrote: > >> bingo! >> >> > > It's usually a good idea to just import the os module. it's a wrapper > (at least in cpython) around the nt, posix, etc modules so you can use > it anywhere. > > -- > Travis Watkins > http://www.realistanew.com > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From alleykat at gmail.com Thu Mar 30 00:12:07 2006 From: alleykat at gmail.com (Travis Watkins) Date: Wed, 29 Mar 2006 16:12:07 -0600 Subject: [IronPython] can't import nt In-Reply-To: <4039D552ADAB094BB1EA670F3E96214E0235BF80@df-foxhound-msg.exchange.corp.microsoft.com> References: <442AFF88.7090705@jpl.nasa.gov> <4039D552ADAB094BB1EA670F3E96214E0235BF80@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: On 3/29/06, Dino Viehland wrote: > You'll need to download the CPython distribution (www.python.org) and copy it's Lib directory into the same directory as IronPythonConsole.exe. > Why does IronPython have it's own os module that chooses between the nt and posix modules? -- Travis Watkins http://www.realistanew.com From dinov at exchange.microsoft.com Thu Mar 30 00:34:02 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 29 Mar 2006 14:34:02 -0800 Subject: [IronPython] can't import nt In-Reply-To: Message-ID: <4039D552ADAB094BB1EA670F3E96214E0235BFCE@df-foxhound-msg.exchange.corp.microsoft.com> Why does or why doesn't it? The reason it doesn't have its on os module is that this is a Python module written entirely in Python, and we're focused on re-creating the core runtime. The reason why we change our name between nt & posix is because there isn't a cli platform that the os module recognizes. The standard os module also makes decisions based upon how paths should be formed based upon what module it finds. So we re-name it to be compatible w/ the platform we're running on. Ideally we'd have a cli os that would then consult the CLI way of getting the path separator, but renaming nt to posix was a better short term way of dealing with this. Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Travis Watkins Sent: Wednesday, March 29, 2006 2:12 PM To: Discussion of IronPython Subject: Re: [IronPython] can't import nt On 3/29/06, Dino Viehland wrote: > You'll need to download the CPython distribution (www.python.org) and copy it's Lib directory into the same directory as IronPythonConsole.exe. > Why does IronPython have it's own os module that chooses between the nt and posix modules? -- Travis Watkins http://www.realistanew.com _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From ironpythonlist at richardshea.fastmail.fm Thu Mar 30 02:35:37 2006 From: ironpythonlist at richardshea.fastmail.fm (Richard Shea) Date: Thu, 30 Mar 2006 12:35:37 +1200 Subject: [IronPython] very basic question - use of iron python as asp.net - when ? Message-ID: <1143678937.493.257868954@webmail.messagingengine.com> Hi - I'm a python and 'Classic' ASP developer. I'm interested in stopping using VBScript in the ASP/ASP.net environment and starting to use Python (those who've used both will understand just how keenly i'm intersted ;-). I'm really looking some very basic information on how Iron Python is going to plug into ASP.Net and when ? I appreciate we're heading down to what looks like a release version of IP sometime in the foreseeable future but it's unclear to me what that means in the context of ASP ? I'm interested to know : (A) is iron python expected to work within ASP.net ? (B) if so when ? (C) how would one go about using it in that context once there was a release version ? Interested in any links/books etc. thank you. richard. From dinov at exchange.microsoft.com Thu Mar 30 02:41:47 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 29 Mar 2006 16:41:47 -0800 Subject: [IronPython] very basic question - use of iron python as asp.net - when ? In-Reply-To: <1143678937.493.257868954@webmail.messagingengine.com> Message-ID: <4039D552ADAB094BB1EA670F3E96214E0235C1AD@df-foxhound-msg.exchange.corp.microsoft.com> There are two features that are required to support ASP.NET: CodeDom & static type compilation. We have a pretty good implementation of CodeDom at this point. It is mostly sufficient for both ASP.NET's code gen purposes as well as the VS WinForms designer. It's probably less sufficient for ASP.NET designer scenarios but there's been no real exploration in this space. The second part is ye-old-static type compilation. ASP.NET, after compiling code using CodeDom, expects to be able to get real types back from the assembly that was produced. If it can't create an instance of the type it just asked CodeDom to create then its game over. Static type compilation will most likely (as in that's when you should realistically expect it) happen in v1.1, but if things go really really smoothly throughout the rest of v1.0 then we might be able to squeeze in the required features for v1.0. But currently ASP.NET basically just doesn't work at all. Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Richard Shea Sent: Wednesday, March 29, 2006 4:36 PM To: users at lists.ironpython.com Subject: [IronPython] very basic question - use of iron python as asp.net - when ? Hi - I'm a python and 'Classic' ASP developer. I'm interested in stopping using VBScript in the ASP/ASP.net environment and starting to use Python (those who've used both will understand just how keenly i'm intersted ;-). I'm really looking some very basic information on how Iron Python is going to plug into ASP.Net and when ? I appreciate we're heading down to what looks like a release version of IP sometime in the foreseeable future but it's unclear to me what that means in the context of ASP ? I'm interested to know : (A) is iron python expected to work within ASP.net ? (B) if so when ? (C) how would one go about using it in that context once there was a release version ? Interested in any links/books etc. thank you. richard. _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From myeates at jpl.nasa.gov Thu Mar 30 04:35:18 2006 From: myeates at jpl.nasa.gov (Mathew Yeates) Date: Wed, 29 Mar 2006 18:35:18 -0800 Subject: [IronPython] beta 5 question Message-ID: <442B43E6.7020506@jpl.nasa.gov> Hi When Beta 5 comes out, will more of pythons library be implemented. For instance .... popen? nudge nudge, wink wink Mathew From dinov at exchange.microsoft.com Thu Mar 30 05:29:01 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 29 Mar 2006 19:29:01 -0800 Subject: [IronPython] beta 5 question In-Reply-To: <442B43E6.7020506@jpl.nasa.gov> Message-ID: <4039D552ADAB094BB1EA670F3E96214E0235C310@df-foxhound-msg.exchange.corp.microsoft.com> Unfortunately I don't think we'll get this in beta 5 but can probably get it for the release after. I've opened a bug for us and that bug includes reviewing all of the missing functionality we need for os (as we seem to be getting a lot of missing os functionality bugs recently). Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Mathew Yeates Sent: Wednesday, March 29, 2006 6:35 PM To: users at lists.ironpython.com Subject: [IronPython] beta 5 question Hi When Beta 5 comes out, will more of pythons library be implemented. For instance .... popen? nudge nudge, wink wink Mathew _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From sanxiyn at gmail.com Thu Mar 30 09:21:08 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Thu, 30 Mar 2006 16:21:08 +0900 Subject: [IronPython] Implementing WSGI server as ASP.NET handler Message-ID: <5b0248170603292321y154ca6edk76ddf723494e2a8a@mail.gmail.com> Hello, I got a proof-of-concept WSGI server as ASP.NET handler working, using IronPython. My development environment is Debian GNU/Linux with latest Mono and XSP, and IronPython 1.0 Beta 4 with patches. All the relevant codes are here. I will write a nice HOWTO when I got some more time. http://sparcs.kaist.ac.kr/~tinuviel/fepy/ Extract IronPython release and copy CPython's Lib directory over. Then download wsgi.py from lib directory to Lib directory. Create a directory (this will be ASP.NET application root directory). Download web.config and wsgi_hello.py from example directory. Create "bin" directory inside the application root directory. Make symbolic links to IronMath.dll, IronPython.dll, and copied-over Lib directory there. Then download WSGI.cs and its Makefile from src directory, and build WSGI.dll. Now just run "xsp2" ("xsp" is for .NET 1.x, and won't work with IronPython) from the application root directory. You should see something like: xsp2 Listening on port: 8080 (non-secure) Listening on address: 0.0.0.0 Root directory: /home/tinuviel/devel/fepy/wsgi Hit Return to stop the server. Do not hit return. Open http://localhost:8080/wsgi_hello.py in your web browser and get greeted. Seo Sanghyeon From porkone at wp.pl Thu Mar 30 10:25:17 2006 From: porkone at wp.pl (Albert Einstein) Date: Thu, 30 Mar 2006 10:25:17 +0200 Subject: [IronPython] How to use IP as default Python engine? Message-ID: <442b95ed1a100@wp.pl> Hi I would like to use IP as default Python engine. That means I would like to run IP scripts using doubleclick or just 'enter' on script file or right mouse button and 'open with'. Now I have to run IP console and then 'import myModule'. Is it possible? p.s. sorry for my english ;) ---------------------------------------------------- Sharon Stone w filmie "Nagi Instynkt 2" w kinach od 29 marca! http://klik.wp.pl/?adr=http%3A%2F%2Fadv.reklama.wp.pl%2Fas%2Fnagi_instynkt.html&sid=712 From ryan at acceleration.net Thu Mar 30 16:56:19 2006 From: ryan at acceleration.net (Ryan Davis) Date: Thu, 30 Mar 2006 09:56:19 -0500 Subject: [IronPython] very basic question - use of iron python as asp.net - when ? In-Reply-To: <1143678937.493.257868954@webmail.messagingengine.com> References: <1143678937.493.257868954@webmail.messagingengine.com> Message-ID: <442BF193.5000301@acceleration.net> A little off topic for this list, but you can configure IIS to use Python (the non-iron variety) in place of VBScript in asp pages: http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B276494 The document is a little dated, but worked for me last fall. I'm not sure about the performance, but its there. Ryan Davis Acceleration.net Director of Programming Services 2831 NW 41st street, suite B Gainesville, FL 32606 Office: 352-335-6500 x 124 Fax: 352-335-6506 Richard Shea wrote: > Hi - I'm a python and 'Classic' ASP developer. I'm interested in > stopping using VBScript in the ASP/ASP.net environment and starting to > use Python (those who've used both will understand just how keenly i'm > intersted ;-). > > I'm really looking some very basic information on how Iron Python is > going to plug into ASP.Net and when ? I appreciate we're heading down to > what looks like a release version of IP sometime in the foreseeable > future but it's unclear to me what that means in the context of ASP ? > I'm interested to know : > > (A) is iron python expected to work within ASP.net ? > (B) if so when ? > (C) how would one go about using it in that context once there was a > release version ? > > Interested in any links/books etc. > > thank you. > > richard. > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > From joesox at gmail.com Thu Mar 30 17:02:16 2006 From: joesox at gmail.com (JoeSox) Date: Thu, 30 Mar 2006 07:02:16 -0800 Subject: [IronPython] How to use IP as default Python engine? In-Reply-To: <442b95ed1a100@wp.pl> References: <442b95ed1a100@wp.pl> Message-ID: <785694cd0603300702t70479974k1d329d22444a8e1b@mail.gmail.com> On 3/30/06, Albert Einstein wrote: > Hi > I would like to use IP as default Python engine. That means I would like to run IP scripts using doubleclick or just 'enter' on script file or right mouse button and 'open with'. Now I have to run IP console and then 'import myModule'. Is it possible? > > p.s. sorry for my english ;) I believe using PythonEngine, or the stream support(beta5 if I understand correctly) will work for what you are asking. If you are using MS VS, take a look at my IronTextBox (v1.1.5 now) control http://codeproject.com/useritems/irontextbox.asp It uses a PythonEngine to bypass the Console. It would have been better if I could devote more time to it. Whenever I get spare time I try to update it. -- Joseph From mailinglist.account at gmail.com Thu Mar 30 17:10:10 2006 From: mailinglist.account at gmail.com (Anthony Tarlano) Date: Thu, 30 Mar 2006 17:10:10 +0200 Subject: [IronPython] IronPython on the .NET Compact Framework Message-ID: Hi all, Quick question for anyone that knows the answer ;o) Can IronPython be used on the .NET Compact Framework? I am interested in purchasing a Windows 5.0 smartphone and I was wondering if I could use IronPython to do some development. TIA, Anthony From ionrock at gmail.com Thu Mar 30 17:16:46 2006 From: ionrock at gmail.com (Eric Larson) Date: Thu, 30 Mar 2006 09:16:46 -0600 Subject: [IronPython] Implementing WSGI server as ASP.NET handler In-Reply-To: <5b0248170603292321y154ca6edk76ddf723494e2a8a@mail.gmail.com> References: <5b0248170603292321y154ca6edk76ddf723494e2a8a@mail.gmail.com> Message-ID: <6e46dd1e0603300716h31ef7ae8jf762074aae5f329@mail.gmail.com> That is rad. :) On 3/30/06, Sanghyeon Seo wrote: > > Hello, I got a proof-of-concept WSGI server as ASP.NET handler > working, using IronPython. > > My development environment is Debian GNU/Linux with latest Mono and > XSP, and IronPython 1.0 Beta 4 with patches. > > All the relevant codes are here. I will write a nice HOWTO when I got > some more time. > http://sparcs.kaist.ac.kr/~tinuviel/fepy/ > > Extract IronPython release and copy CPython's Lib directory over. Then > download wsgi.py from lib directory to Lib directory. > > Create a directory (this will be ASP.NET application root directory). > Download web.config and wsgi_hello.py from example directory. > > Create "bin" directory inside the application root directory. Make > symbolic links to IronMath.dll, IronPython.dll, and copied-over Lib > directory there. Then download WSGI.cs and its Makefile from src > directory, and build WSGI.dll. > > Now just run "xsp2" ("xsp" is for .NET 1.x, and won't work with > IronPython) from the application root directory. You should see > something like: > > xsp2 > Listening on port: 8080 (non-secure) > Listening on address: 0.0.0.0 > Root directory: /home/tinuviel/devel/fepy/wsgi > Hit Return to stop the server. > > Do not hit return. > > Open http://localhost:8080/wsgi_hello.py in your web browser and get > greeted. > > Seo Sanghyeon > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dans at houmus.org Thu Mar 30 17:23:45 2006 From: dans at houmus.org (Dan Shechter) Date: Thu, 30 Mar 2006 17:23:45 +0200 Subject: [IronPython] IronPython on the .NET Compact Framework In-Reply-To: Message-ID: <002a01c6540d$f064be40$2003640a@Go80211.com> I was wondering the same thing yesterday... However, I already have a PocketPC with Compact Framework so I will try To get it working there this weekend... Shechter. > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Anthony Tarlano > Sent: Thursday, March 30, 2006 17:10 > To: Discussion of IronPython > Subject: [IronPython] IronPython on the .NET Compact Framework > > Hi all, > > Quick question for anyone that knows the answer ;o) > > Can IronPython be used on the .NET Compact Framework? I am interested > in purchasing a Windows 5.0 smartphone and I was wondering if I could > use IronPython to do some development. > > TIA, > > Anthony > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From jvm_cop at spamcop.net Thu Mar 30 17:43:59 2006 From: jvm_cop at spamcop.net (J. Merrill) Date: Thu, 30 Mar 2006 10:43:59 -0500 Subject: [IronPython] IronPython on the .NET Compact Framework Message-ID: <4.3.2.7.2.20060330104348.048d91d8@mail.comcast.net> It's not going to work. One of the (I believe few) things that IP uses that's not supported in CF is critical -- generating code "on the fly" using new-in-2.0 functionality. This might be the time to tell (complain to) Microsoft that they need to provide that in CF. If I'm not mistaken, there is a CPython implementation for Windows smartphones -- it might be runtime-only. Good luck. At 10:23 AM 3/30/2006, Dan Shechter wrote >I was wondering the same thing yesterday... >However, I already have a PocketPC with Compact Framework so I will try >To get it working there this weekend... > > Shechter. > >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users- >> bounces at lists.ironpython.com] On Behalf Of Anthony Tarlano >> Sent: Thursday, March 30, 2006 17:10 >> To: Discussion of IronPython >> Subject: [IronPython] IronPython on the .NET Compact Framework >> >> Hi all, >> >> Quick question for anyone that knows the answer ;o) >> >> Can IronPython be used on the .NET Compact Framework? I am interested >> in purchasing a Windows 5.0 smartphone and I was wondering if I could >> use IronPython to do some development. >> >> TIA, >> >> Anthony J. Merrill / Analytical Software Corp From mailinglist.account at gmail.com Thu Mar 30 18:37:32 2006 From: mailinglist.account at gmail.com (Anthony Tarlano) Date: Thu, 30 Mar 2006 18:37:32 +0200 Subject: [IronPython] IronPython on the .NET Compact Framework In-Reply-To: <4.3.2.7.2.20060330104348.048d91d8@mail.comcast.net> References: <4.3.2.7.2.20060330104348.048d91d8@mail.comcast.net> Message-ID: Shechter, Still give it a shot to see if it will work. One thought to get around this "on the fly" issue could be just doing the development on the PC and then transferring the assembly to the phone. May be that could work? Let us know.. Anthony On 3/30/06, J. Merrill wrote: > It's not going to work. One of the (I believe few) things that IP uses that's not supported in CF is critical -- generating code "on the fly" using new-in-2.0 functionality. > > This might be the time to tell (complain to) Microsoft that they need to provide that in CF. > > If I'm not mistaken, there is a CPython implementation for Windows smartphones -- it might be runtime-only. Good luck. > > At 10:23 AM 3/30/2006, Dan Shechter wrote > >I was wondering the same thing yesterday... > >However, I already have a PocketPC with Compact Framework so I will try > >To get it working there this weekend... > > > > Shechter. > > > >> -----Original Message----- > >> From: users-bounces at lists.ironpython.com [mailto:users- > >> bounces at lists.ironpython.com] On Behalf Of Anthony Tarlano > >> Sent: Thursday, March 30, 2006 17:10 > >> To: Discussion of IronPython > >> Subject: [IronPython] IronPython on the .NET Compact Framework > >> > >> Hi all, > >> > >> Quick question for anyone that knows the answer ;o) > >> > >> Can IronPython be used on the .NET Compact Framework? I am interested > >> in purchasing a Windows 5.0 smartphone and I was wondering if I could > >> use IronPython to do some development. > >> > >> TIA, > >> > >> Anthony > > > J. Merrill / Analytical Software Corp > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From dinov at exchange.microsoft.com Thu Mar 30 19:22:45 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Thu, 30 Mar 2006 09:22:45 -0800 Subject: [IronPython] How to use IP as default Python engine? In-Reply-To: <785694cd0603300702t70479974k1d329d22444a8e1b@mail.gmail.com> Message-ID: <4039D552ADAB094BB1EA670F3E96214E0235C4F6@df-foxhound-msg.exchange.corp.microsoft.com> For double click / enter you should be able to right click on the script, see "Opens with" on the General tab, select the Change button to the right, click the Browse button on the bottom of the Open With dialog that opens, and then find IronPythonConsole.exe in the file open dialog that comes up. Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of JoeSox Sent: Thursday, March 30, 2006 7:02 AM To: Discussion of IronPython Subject: Re: [IronPython] How to use IP as default Python engine? On 3/30/06, Albert Einstein wrote: > Hi > I would like to use IP as default Python engine. That means I would like to run IP scripts using doubleclick or just 'enter' on script file or right mouse button and 'open with'. Now I have to run IP console and then 'import myModule'. Is it possible? > > p.s. sorry for my english ;) I believe using PythonEngine, or the stream support(beta5 if I understand correctly) will work for what you are asking. If you are using MS VS, take a look at my IronTextBox (v1.1.5 now) control http://codeproject.com/useritems/irontextbox.asp It uses a PythonEngine to bypass the Console. It would have been better if I could devote more time to it. Whenever I get spare time I try to update it. -- Joseph _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From sriramk at gmail.com Thu Mar 30 19:32:04 2006 From: sriramk at gmail.com (Sriram Krishnan) Date: Thu, 30 Mar 2006 23:02:04 +0530 Subject: [IronPython] IronPython on the .NET Compact Framework In-Reply-To: References: <4.3.2.7.2.20060330104348.048d91d8@mail.comcast.net> Message-ID: <442C1614.6020304@gmail.com> If I remember, the root issue is that NetCF does not support LCG or anything in Reflection.Emit that IronPython depends on. Here's a suggestion - Rotor 2.0 has just shipped with the source for both of the above. It might be an interesting experiment to try and graft out the parts of LCG/Reflection.Emit from Rotor and port IronPython to NetCF. Since I work in the Visual Studio for Devices team, I have a vested interested in seeing this work :) -- Sriram From Martin.Maly at microsoft.com Thu Mar 30 23:13:49 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Thu, 30 Mar 2006 13:13:49 -0800 Subject: [IronPython] NameError In-Reply-To: <5b0248170603260301y3a05cc17r@mail.gmail.com> Message-ID: <5C0A6F919D675745BB1DBA7412DB68F50229669E@df-foxhound-msg.exchange.corp.microsoft.com> Yes. We had discussions with the standard Python developers and Guido about it, actually. The language spec states that assignment is binding and if binding appears in a block (class body being block), all references to the name are local within the block. It was not clear whether it was a language spec bug or a implementation bug, but Guido ruled that it was a spec bug and the Python implementation is correct. We'll be fixing this soon. Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Sanghyeon Seo Sent: Sunday, March 26, 2006 3:01 AM To: Discussion of IronPython Subject: [IronPython] NameError Following script raises NameError, but it shouldn't. x = '' class C: x = x Seo Sanghyeon _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Fri Mar 31 02:18:56 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Thu, 30 Mar 2006 16:18:56 -0800 Subject: [IronPython] IronPython 1.0 Beta 5 Message-ID: <4039D552ADAB094BB1EA670F3E96214E023F4EE7@df-foxhound-msg.exchange.corp.microsoft.com> Hello IronPython Community, We have just released IronPython 1.0 Beta 5. This release focuses primarily on improving IronPython's performance. In this area we've reduced working set and startup type by optimizing methods on-demand, improved the speed of attribute access, reduced the overhead in many basic operations (e.g. equality checks and uninitialized checks for local variables), and done other various fine tuning. As usual there are also a good number of bug fixes (primarily focused on community reported bugs). There was also one significant API change in the .NET <-> Python interoperability area: If we have the following definitions: public class Foo { public void Bar(int arg) {} public void Bar(int arg) {} } We can call the non-generic version with any of: foo.Bar(1) foo.Bar.__overloads__[int](1) And the generic one with any of: foo.Bar[str](1) foo.Bar.__overloads__[int][str](1) foo.Bar[str].__overloads__[int](1) This is different from previous versions of IronPython where indexing was used to provide access to generic methods. A more complete list of changes follows at the end. You can download the release from: http://www.microsoft.com/downloads/details.aspx?FamilyID=e4058d5f-49ec-47cb-899e-c4f781e6648f&displaylang=en We'd like to thank everyone in the community for your bug reports and suggestions that helped make this a better release: Aaronm, Anthony Tarlano, Eugene Rosenzweig, Shigeru Hemmi, JoeSox, John Platt, Klaus M?ller, Lewis Franklin, Pete Sheill, Rusty Deschenes, and Sanghyeon Seo. Thanks and keep in touch, The IronPython Team More complete list of changes and bug fixes: ============================================ ReflectOptimize methods on-demand ReflectOptimize hasattr/getattr/setattr and other context aware methods Improve BigInteger parsing performance abs(True) and abs(False) fixed to match CPython behavior os('stat') sets file modes properly now Bugfix: Setting variables in nt.environ doesn't propagate to environment Bugfix: Improve constructing files from streams ReflectOptimizer inlines type checks for non-convertible types (ICallerContext & UserType) Optimize uses of Ops.IsTrue(Ops.Equal(... )) to Ops.EqualRetBool to avoid boxing & conversions Support binding to generic .NET methods and move manual overload resolution __overloads__ dictionary Use data flow analysis to avoid Uninitialized checks where possible in locals Optimize generator.next calls to get good performance Bugfix: IronPython CodeDom cannot round trip 2 buttons on a form Improve performance of constructing commonly used built-in types FunctionEnvironment performance improvements Minor tweaks to casting orders Avoid TLS where possible in repr Bugfix: from __future__ import division doesn't flow into eval in some cases Bugfix: hasattr raises Bugfix: need to implement nt.startfile Bugfix: subclassing Tuple not working Bugfix: fix resource definitions in generated files Large namespaces use binary search to find attributes Bugfix: -i option doesn't go interactive when exception is raised SuperConsole now supports Ctrl_C handling as well as basic console Bugfix: '%02d' % 12 appends a leading zero Attribute access re-written for significant performance gains Bugfix: nt module doesn't implement chdir ReflectedPackage's delay load all type loads Bugfix: atxexit doesn't work Bugfix: IP: Cannot use a class from IronPython generated class libraries Bugfix: Cannot delete variable referenced in nested scope Bugfix: Support special method names (__int__, __pos__, etc...) Bugfix: Support for generic & non-generic types of the same name in same namespace Bugfix: __doc__ strings should reflect how we mangle calling conventions Bugfix: Update makefiles to include new assembly references Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -------------- next part -------------- An HTML attachment was scrubbed... URL: From sanxiyn at gmail.com Fri Mar 31 04:24:31 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Fri, 31 Mar 2006 11:24:31 +0900 Subject: [IronPython] IronPython 1.0 Beta 5 on Mono Message-ID: <5b0248170603301824o309de1cbv6f8828535cc85d22@mail.gmail.com> The binary will start up fine with Mono 1.1.13.4 release. You can't import os module, because Mono's System.Environment.SetEnvironmentVariable method is a stub that will raise NotImplementedException every time, but IronPython now makes use of this method. Implementing this apparently involves P/Invoke machinery, so I'm afraid I can't fix this myself: http://svn.myrealbox.com/source/trunk/mcs/class/corlib/System/Environment.cs I will report more as I experiment. Seo Sanghyeon From sanxiyn at gmail.com Fri Mar 31 08:10:23 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Fri, 31 Mar 2006 15:10:23 +0900 Subject: [IronPython] IronPython 1.0 Beta 5 on Mono In-Reply-To: <5b0248170603301824o309de1cbv6f8828535cc85d22@mail.gmail.com> References: <5b0248170603301824o309de1cbv6f8828535cc85d22@mail.gmail.com> Message-ID: <5b0248170603302210h5632761bu5e63f93e2ca8818c@mail.gmail.com> Compiler used below is gmcs 1.1.13.4. This is *older* than compiler I used to compile Beta 4, because people complained about using non-released SVN version of compiler... While compiling the source, I get: IronPython/Runtime/SymbolTable.cs(95,33): error CS0262: Partial declarations of `IronPython.Runtime.SymbolTable' have conflicting accessibility modifiers New in Beta 5. Editing IronPython/Runtime/SymbolTable.Generated.cs line 21 to read "public static partial class SymbolTable" and continue: IronPython/Compiler/FlowChecker.cs(158,13): error CS0117: `System.Diagnostics.Debug' does not contain a definition for `Print' New in Beta 5. This is Mono issue. Commenting out and continue: IronPython/Runtime/PerfTrack.cs(44,13): error CS0246: The type or namespace name `Stopwatch' could not be found. Are you missing a using directive or an assembly reference? New in Beta 5. Mono issue. Commenting out and continue: IronPython/Runtime/StringOps.cs(1140,35): error CS0117: `System.Text.Encoding' does not contain a definition for `GetEncodings' Already in Beta 4. Mono issue. Fixed in SVN (by creating stub). Editing line 1140 to read "EncodingInfo[] encs = {};" (I know, it's crazy) and continue: IronPythonTest/EngineTest.cs(238,17): error CS0117: `System.IO.File' does not contain a definition for `WriteAllText' Already in Beta 4. Mono issue. Fixed in SVN (by implementation). Eh, I won't bother with this one. Yeah, so that's how you can compile IronPython 1.0 Beta 5 on Mono. Seo Sanghyeon From s.kobalczyk at softwaremind.pl Fri Mar 31 11:25:06 2006 From: s.kobalczyk at softwaremind.pl (Szymon Kobalczyk) Date: Fri, 31 Mar 2006 11:25:06 +0200 Subject: [IronPython] Line info in PythonSyntaxError In-Reply-To: <44118C4D.30309@softwaremind.pl> References: <44118C4D.30309@softwaremind.pl> Message-ID: <442CF572.6000203@softwaremind.pl> Hi, First big thanks for yet another great release! However, as I see you haven't addressed this small issue I described a while ago. Please confirm you have received my report and if you are going to address it. Now I've manually added these properties to the PythonSyntaxError class: public class PythonSyntaxError : Exception, ICustomExceptionConversion { int lineNo, columnNo; string lineText, file; public int LineNumber { get { return lineNo; } } public int ColumnNumber { get { return columnNo; } } public string File { get { return file; } } public string LineText { get { return lineText; } } ... } Regards, Szymon Kobalczyk Szymon Kobalczyk napisa?(a): > Hi, > I found it quite convenient to be able to catch parsing error from the > engine's Compile method and read the line and column number where the > error occurred. In previous version this was simply displayed in the > PythonSyntaxError's message. Currently it was removed and instead this > exception carries this information in private fields so it can recreate > PythonException. Do you have anything against exposing these fields as > read-only properties? > > Regards, > Szymon Kobalczyk > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -- Software Mind *Software Mind Sp z oo* Bociana 22A 31-231 Krak?w Poland Tel. (+48-12) 6145490 Fax: (+48-12) 6145170 s.kobalczyk at softwaremind.pl www.softwaremind.pl *Szymon Kobalczyk* Software Developer This email may contain confidential and privileged material for the sole use of the intended recipient(s). Any review, use, retention, distribution or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive for the recipient), please contact the sender by reply email and delete all copies of this message. Also, email is susceptible to data corruption, interception, tampering, unauthorized amendment and viruses. We only send and receive emails on the basis that we are not liable for any such corruption, interception, tampering, amendment or viruses or any consequence thereof. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: minism.gif Type: image/gif Size: 3654 bytes Desc: not available URL: From mailinglist.account at gmail.com Fri Mar 31 12:07:09 2006 From: mailinglist.account at gmail.com (Anthony Tarlano) Date: Fri, 31 Mar 2006 12:07:09 +0200 Subject: [IronPython] IronPython 1.0 Beta 5 In-Reply-To: <4039D552ADAB094BB1EA670F3E96214E023F4EE7@df-foxhound-msg.exchange.corp.microsoft.com> References: <4039D552ADAB094BB1EA670F3E96214E023F4EE7@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: Dino, Great job on improving the performance!!!! IronPython is now faster then CPython running overhead.py After Beta 5: ========= CPC220# python.net overhead.py LOOP TIME: 0.460693359375 THREAD TIME: 0.590881347656 CPC220# IronPythonConsole overhead.py LOOP TIME: 0.460670471191 THREAD TIME: 0.590873718262 ---------------------------------------------------------- # overhead.py import time TIMES = 100000 threads = list() def stringops(): for n in xrange(TIMES): s = "Mary had a little lamb" s = s.upper() s = "Mary had a little lamb" s = s.lower() s = "Mary had a little lamb" s = s.replace('a','A') def scheduler(): for n in xrange(TIMES): for thread in threads: thread.next() def upper(): while 1: s = "Mary had a little lamb" s = s.upper() yield None def lower(): while 1: s = "Mary had a little lamb" s = s.lower() yield None def replace(): while 1: s = "Mary had a little lamb" s = s.replace('a','A') yield None if __name__=='__main__': start = time.clock() stringops() looptime = time.clock()-start print "LOOP TIME:", looptime threads.append(upper()) threads.append(lower()) threads.append(replace()) start = time.clock() scheduler() threadtime = time.clock()-start print "THREAD TIME:", threadtime On 3/31/06, Dino Viehland wrote: > > > > Hello IronPython Community, > > > > We have just released IronPython 1.0 Beta 5. This release focuses primarily > on improving IronPython's performance. In this area we've reduced working > set and startup type by optimizing methods on-demand, improved the speed of > attribute access, reduced the overhead in many basic operations (e.g. > equality checks and uninitialized checks for local variables), and done > other various fine tuning. As usual there are also a good number of bug > fixes (primarily focused on community reported bugs). There was also one > significant API change in the .NET <-> Python interoperability area: > > > > If we have the following definitions: > > > > public class Foo { > > public void Bar(int arg) {} > > public void Bar(int arg) {} > > } > > > > We can call the non-generic version with any of: > > foo.Bar(1) > > foo.Bar.__overloads__[int](1) > > > > And the generic one with any of: > > foo.Bar[str](1) > > foo.Bar.__overloads__[int][str](1) > > foo.Bar[str].__overloads__[int](1) > > > > This is different from previous versions of IronPython where indexing was > used to provide access to generic methods. > > > > A more complete list of changes follows at the end. > > > > You can download the release from: > http://www.microsoft.com/downloads/details.aspx?FamilyID=e4058d5f-49ec-47cb-899e-c4f781e6648f&displaylang=en > > > > We'd like to thank everyone in the community for your bug reports and > suggestions that helped make this a better release: Aaronm, Anthony Tarlano, > Eugene Rosenzweig, Shigeru Hemmi, JoeSox, John Platt, Klaus M?ller, Lewis > Franklin, Pete Sheill, Rusty Deschenes, and Sanghyeon Seo. > > > > > > Thanks and keep in touch, > > The IronPython Team > > > > > > More complete list of changes and bug fixes: > > ============================================ > > ReflectOptimize methods on-demand > > ReflectOptimize hasattr/getattr/setattr and other context aware methods > > Improve BigInteger parsing performance > > abs(True) and abs(False) fixed to match CPython behavior > > os('stat') sets file modes properly now > > Bugfix: Setting variables in nt.environ doesn't propagate to environment > > Bugfix: Improve constructing files from streams > > ReflectOptimizer inlines type checks for non-convertible types > (ICallerContext & UserType) > > Optimize uses of Ops.IsTrue(Ops.Equal(? )) to Ops.EqualRetBool to avoid > boxing & conversions > > Support binding to generic .NET methods and move manual overload resolution > __overloads__ dictionary > > Use data flow analysis to avoid Uninitialized checks where possible in > locals > > Optimize generator.next calls to get good performance > > Bugfix: IronPython CodeDom cannot round trip 2 buttons on a form > > Improve performance of constructing commonly used built-in types > > FunctionEnvironment performance improvements > > Minor tweaks to casting orders > > Avoid TLS where possible in repr > > Bugfix: from __future__ import division doesn't flow into eval in some cases > > Bugfix: hasattr raises > > Bugfix: need to implement nt.startfile > > Bugfix: subclassing Tuple not working > > Bugfix: fix resource definitions in generated files > > Large namespaces use binary search to find attributes > > Bugfix: -i option doesn't go interactive when exception is raised > > SuperConsole now supports Ctrl_C handling as well as basic console > > Bugfix: '%02d' % 12 appends a leading zero > > Attribute access re-written for significant performance gains > > Bugfix: nt module doesn't implement chdir > > ReflectedPackage's delay load all type loads > > Bugfix: atxexit doesn't work > > Bugfix: IP: Cannot use a class from IronPython generated class libraries > > Bugfix: Cannot delete variable referenced in nested scope > > Bugfix: Support special method names (__int__, __pos__, etc?) > > Bugfix: Support for generic & non-generic types of the same name in same > namespace > > Bugfix: __doc__ strings should reflect how we mangle calling conventions > > Bugfix: Update makefiles to include new assembly references > > > > > > > > > > > > Do you want to help develop Dynamic languages on CLR? > (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) > > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > From dinov at exchange.microsoft.com Fri Mar 31 18:38:57 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Fri, 31 Mar 2006 08:38:57 -0800 Subject: [IronPython] Line info in PythonSyntaxError In-Reply-To: <442CF572.6000203@softwaremind.pl> Message-ID: <4039D552ADAB094BB1EA670F3E96214E023F521F@df-foxhound-msg.exchange.corp.microsoft.com> Sorry Szymon, I believe this is my fault. We did receive your report but somehow it didn't make it into a bug. I've got the bug opened now, and we'll fix this before beta 6. Again, sorry for the delay on this. Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Szymon Kobalczyk Sent: Friday, March 31, 2006 1:25 AM To: Discussion of IronPython Subject: [IronPython] Line info in PythonSyntaxError Hi, First big thanks for yet another great release! However, as I see you haven't addressed this small issue I described a while ago. Please confirm you have received my report and if you are going to address it. Now I've manually added these properties to the PythonSyntaxError class: public class PythonSyntaxError : Exception, ICustomExceptionConversion { int lineNo, columnNo; string lineText, file; public int LineNumber { get { return lineNo; } } public int ColumnNumber { get { return columnNo; } } public string File { get { return file; } } public string LineText { get { return lineText; } } ... } Regards, Szymon Kobalczyk Szymon Kobalczyk napisa?(a): Hi, I found it quite convenient to be able to catch parsing error from the engine's Compile method and read the line and column number where the error occurred. In previous version this was simply displayed in the PythonSyntaxError's message. Currently it was removed and instead this exception carries this information in private fields so it can recreate PythonException. Do you have anything against exposing these fields as read-only properties? Regards, Szymon Kobalczyk _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- [cid:image001.gif at 01C6549E.8D3E8AD0] Software Mind Sp z oo Bociana 22A 31-231 Krak?w Poland Tel. (+48-12) 6145490 Fax: (+48-12) 6145170 s.kobalczyk at softwaremind.pl www.softwaremind.pl Szymon Kobalczyk Software Developer This email may contain confidential and privileged material for the sole use of the intended recipient(s). Any review, use, retention, distribution or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive for the recipient), please contact the sender by reply email and delete all copies of this message. Also, email is susceptible to data corruption, interception, tampering, unauthorized amendment and viruses. We only send and receive emails on the basis that we are not liable for any such corruption, interception, tampering, amendment or viruses or any consequence thereof. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.gif Type: image/gif Size: 3654 bytes Desc: image001.gif URL: From fumanchu at amor.org Thu Mar 30 20:20:18 2006 From: fumanchu at amor.org (Robert Brewer) Date: Thu, 30 Mar 2006 18:20:18 -0000 Subject: [IronPython] [Web-SIG] Implementing WSGI server as ASP.NET handler Message-ID: <435DF58A933BA74397B42CDEB8145A8601144074@ex9.hostedexchange.local> Sanghyeon Seo wrote: > Hello, I got a proof-of-concept WSGI server as ASP.NET handler > working, using IronPython. > > My development environment is Debian GNU/Linux with latest Mono and > XSP, and IronPython 1.0 Beta 4 with patches. > > All the relevant codes are here. I will write a nice HOWTO when I got > some more time. > http://sparcs.kaist.ac.kr/~tinuviel/fepy/ > > Extract IronPython release and copy CPython's Lib directory over. Then > download wsgi.py from lib directory to Lib directory. > > Create a directory (this will be ASP.NET application root directory). > Download web.config and wsgi_hello.py from example directory. > > Create "bin" directory inside the application root directory. Make > symbolic links to IronMath.dll, IronPython.dll, and copied-over Lib > directory there. Then download WSGI.cs and its Makefile from src > directory, and build WSGI.dll. > > Now just run "xsp2" ("xsp" is for .NET 1.x, and won't work with > IronPython) from the application root directory. You should see > something like: > > xsp2 > Listening on port: 8080 (non-secure) > Listening on address: 0.0.0.0 > Root directory: /home/tinuviel/devel/fepy/wsgi > Hit Return to stop the server. > > Do not hit return. > > Open http://localhost:8080/wsgi_hello.py in your web browser > and get greeted. Good to see another one out there. Mine's at http://projects.amor.org/misc/wiki/ASPGateway Be careful with request.InputStream--apparently, the whole thing gets copied into memory: http://www.codecomments.com/archive289-2004-10-299287.html You'll also probably want to use ReadBinary to handle "non-text" files. Robert Brewer System Architect Amor Ministries fumanchu at amor.org From Brian.Lloyd at revolution.com Fri Mar 31 22:38:33 2006 From: Brian.Lloyd at revolution.com (Brian Lloyd) Date: Fri, 31 Mar 2006 20:38:33 -0000 Subject: [IronPython] Naming and resolution of generic types Message-ID: <65531D426735784F854EE658938A585302798C9F@MI8NYCMAIL03.Mi8.com> Hi all - I'm cross-posting this to the IP list as the subject seems to be an open issue there too. I'm working on generics support for Python for .NET, and there a couple of thorny issues that could use some discussion regarding naming and resolution of generic types. In C# you can explicitly name a generic type, a la Dictionary<,>. That syntax won't work in Python, of course. Looking at IP, it seems to allow the apparent Python name to be the unmangled IL name so you can naturally use the name. The problem is that the mangled name is illegal as a python name, and the unmangled name isn't guaranteed to be unique - you can potentially have any number of generic types as well as a non-generic type with the same base name in the same namespace: namespace Spam { public class SpamCan {} public class SpamCan {} public class SpamCan {} ... } I imagine that maybe IP has enough information available at compile-time to do the right thing for some common usage (binding and instantiating the types), but the overloaded name can still be ambiguous. A real-life example of this is System.IComparable - in IP, it doesn't seem possible to get to the non-generic version of IComparable anymore (or at least it was not obvious to me how to do it): >>> import System >>> System.IComparable It seems like we need to figure out some acceptable way of spelling generic type names explicitly in Python (an equivalent to IComparable<> in C#) that works within the existing syntax. There don't appear to be a lot of great options :( It has to be a valid Python name to work in an import statement, so that rules out strange operator shenanigans akin to the [] hack used for generic type binding. One would be to mimic the existing IL mangling in some way, a la: >From System import IComparable # the non-generic type >From System import IComparable_1 # the 1-param generic # or from System import IComparable_T from System.Collections.Generic import Dictionary_TT These are all pretty gross, and still don't totally prevent hiding of legit non-generic classes with those names (though it makes it less likely that names will be hidden than the current approach). I suppose another approach would be to continue to have only one type end up with the simple name, but provide a way to disambiguate it after the fact: >>> import System >>> System.IComparable >>> # abandon all hope, ye who enter here... >>> NonGenericIComparable = System.IComparable<<0 >>> NonGenericIComparable = System.IComparable<<0 Thoughts? -Brian From Brian.Lloyd at revolution.com Fri Mar 31 22:43:09 2006 From: Brian.Lloyd at revolution.com (Brian Lloyd) Date: Fri, 31 Mar 2006 20:43:09 -0000 Subject: [IronPython] Naming and resolution of generic types (complete!) Message-ID: <65531D426735784F854EE658938A585302798CCA@MI8NYCMAIL03.Mi8.com> Hi all - I'm cross-posting this to the IP list as the subject seems to be an open issue there too. I'm working on generics support for Python for .NET, and there a couple of thorny issues that could use some discussion regarding naming and resolution of generic types. In C# you can explicitly name a generic type, a la Dictionary<,>. That syntax won't work in Python, of course. Looking at IP, it seems to allow the apparent Python name to be the unmangled IL name so you can naturally use the name. The problem is that the mangled name is illegal as a python name, and the unmangled name isn't guaranteed to be unique - you can potentially have any number of generic types as well as a non-generic type with the same base name in the same namespace: namespace Spam { public class SpamCan {} public class SpamCan {} public class SpamCan {} ... } I imagine that maybe IP has enough information available at compile-time to do the right thing for some common usage (binding and instantiating the types), but the overloaded name can still be ambiguous. A real-life example of this is System.IComparable - in IP, it doesn't seem possible to get to the non-generic version of IComparable anymore (or at least it was not obvious to me how to do it): >>> import System >>> System.IComparable It seems like we need to figure out some acceptable way of spelling generic type names explicitly in Python (an equivalent to IComparable<> in C#) that works within the existing syntax. There don't appear to be a lot of great options :( It has to be a valid Python name to work in an import statement, so that rules out strange operator shenanigans akin to the [] hack used for generic type binding. One would be to mimic the existing IL mangling in some way, a la: >From System import IComparable # the non-generic type >From System import IComparable_1 # the 1-param generic # or from System import IComparable_T from System.Collections.Generic import Dictionary_TT These are all pretty gross, and still don't totally prevent hiding of legit non-generic classes with those names (though it makes it less likely that names will be hidden than the current approach). I suppose another approach would be to continue to have only one type end up with the simple name, but provide a way to disambiguate it after the fact: >>> import System >>> System.IComparable >>> # abandon all hope, ye who enter here... >>> NonGenericIComparable = System.IComparable<<0 >>> OneParamGenericIComparable = System.IComparable<<1 >>> TwoParamVersionIfThereWasOne = System.IComparable<<2 That feels to me like it violates Python Zen in several ways, though. Thoughts? -Brian