From falcon at uwyo.edu Tue Jul 1 03:14:27 2008 From: falcon at uwyo.edu (Michael Stephens) Date: Mon, 30 Jun 2008 19:14:27 -0600 Subject: [IronPython] Python Generation Message-ID: I am writing a macro->python translation utility for our system. I thought I struck it rich when i found IronPython.Compiler.Ast . But there doesn't seem to be a good way to take these things and generate python code (strings). If anyone knows any spiffy libraries out there to do this that would be awesome too. Michael Stephens Electrical Engineering Graduate Student University of Wyoming falcon at uwyo.edu or 89iroc at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Tue Jul 1 03:33:20 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 30 Jun 2008 18:33:20 -0700 Subject: [IronPython] Python Generation In-Reply-To: References: Message-ID: <7AD436E4270DD54A94238001769C2227012C932988CD@DF-GRTDANE-MSG.exchange.corp.microsoft.com> You could take a look at IronPython 1.x's CodeDom support in IronPython.CodeDom.Provider. From there you can get the generator and throw CodeDom trees at it. It can generate a bunch of ugliness to support WinForms but by default it doesn't do that. Unfortunately it hasn't been updated to 2.0 but of course the source is available :) From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Stephens Sent: Monday, June 30, 2008 6:14 PM To: Discussion of IronPython Subject: [IronPython] Python Generation I am writing a macro->python translation utility for our system. I thought I struck it rich when i found IronPython.Compiler.Ast . But there doesn't seem to be a good way to take these things and generate python code (strings). If anyone knows any spiffy libraries out there to do this that would be awesome too. Michael Stephens Electrical Engineering Graduate Student University of Wyoming falcon at uwyo.edu or 89iroc at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From falcon at uwyo.edu Tue Jul 1 04:39:12 2008 From: falcon at uwyo.edu (Michael Stephens) Date: Mon, 30 Jun 2008 20:39:12 -0600 Subject: [IronPython] Python Generation In-Reply-To: <7AD436E4270DD54A94238001769C2227012C932988CD@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <7AD436E4270DD54A94238001769C2227012C932988CD@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: Thanks.. I've got a basic example up. Michael Stephens Electrical Engineering Graduate Student University of Wyoming falcon at uwyo.edu or 89iroc at gmail.com On Mon, Jun 30, 2008 at 7:33 PM, Dino Viehland wrote: > You could take a look at IronPython 1.x's CodeDom support in > IronPython.CodeDom.Provider. From there you can get the generator and throw > CodeDom trees at it. It can generate a bunch of ugliness to support > WinForms but by default it doesn't do that. Unfortunately it hasn't been > updated to 2.0 but of course the source is available J > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Michael Stephens > *Sent:* Monday, June 30, 2008 6:14 PM > *To:* Discussion of IronPython > *Subject:* [IronPython] Python Generation > > > > I am writing a macro->python translation utility for our system. I thought > I struck it rich when i found IronPython.Compiler.Ast . But there doesn't > seem to be a good way to take these things and generate python code > (strings). If anyone knows any spiffy libraries out there to do this that > would be awesome too. > > Michael Stephens > > Electrical Engineering Graduate Student > University of Wyoming > falcon at uwyo.edu or 89iroc at gmail.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 Tue Jul 1 06:25:45 2008 From: kfarmer at thuban.org (Keith J. Farmer) Date: Mon, 30 Jun 2008 21:25:45 -0700 Subject: [IronPython] IronPython 1.1.2 eta? In-Reply-To: <7AD436E4270DD54A94238001769C2227012C93298788@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <48692AFD.4040605@voidspace.org.uk> <7AD436E4270DD54A94238001769C2227012C93298788@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: (Python lambdas to CLR Expression Trees.. my one wish aside from C#3-style extension method resolution) (but y'all knew that, anyway) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Monday, June 30, 2008 1:00 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython 1.1.2 eta? Yeah, it's not going to happen today :) The changes are done (any bugs assigned to me and the 1.1.2 release on CodePlex will be fixed), they just need to run through a full test pass. I got started on the changes late and the test infrastructure needed to be brought back to life so it's taking a little bit longer than expected but the RC should be out soon. Beta 4 is currently planned for early August. If you're willing to try out a source release from http://www.codeplex.com/IronPython/SourceControl/ListDownloadableCommits.aspx I'd be happy to let you know when the last remaining regression is fixed (and gets uploaded there - looks like that hasn't been happening :(). We've fixed the polymorphic call site perf bug already but there's still a bug that results in massive overhead of calling simple Python functions. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Monday, June 30, 2008 11:51 AM To: Discussion of IronPython Subject: [IronPython] IronPython 1.1.2 eta? Hello guys, A while back you suggested that IronPython 1.1.2 would arrive 'some time in June'. Whilst that is still possible it seems unlikely, any news on an eta? Whilst we're at it, any idea on when IP 2 Beta 4 might be released? We'd like to test Resolver One with an updated IronPython 2 where performance isn't borked quite so much... :-) Michael -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ _______________________________________________ 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 Tue Jul 1 06:39:39 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 30 Jun 2008 21:39:39 -0700 Subject: [IronPython] IronPython 1.1.2 eta? In-Reply-To: References: <48692AFD.4040605@voidspace.org.uk> <7AD436E4270DD54A94238001769C2227012C93298788@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <7AD436E4270DD54A94238001769C2227012C932988EE@DF-GRTDANE-MSG.exchange.corp.microsoft.com> The good news is this is basically inevitable but will take some time to achieve :). In the latest source code, I guess currently available only through the IronRuby SVN, you'll see that the namespaces of the DLR expression trees have moved to System.Linq.Expressions. This is the completion of making the DLR expression trees into a superset of the LINQ expression trees. Unfortunately both of your features require taking a dependency on .NET 3.5 (or some future version) which we're just not quite ready to do. But ultimately this should be trivial in the future - it's just not going to happen in 1.x and probably not 2.x. But the lambdas -> expression trees is probably a little easier as it's just add some new conversion support - C# 3.0 extension methods have scoping design issues. Anyway obviously this is something we care about too but it serves as a good excuse to mention some cool recent code changes :). -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Keith J. Farmer Sent: Monday, June 30, 2008 9:26 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython 1.1.2 eta? (Python lambdas to CLR Expression Trees.. my one wish aside from C#3-style extension method resolution) (but y'all knew that, anyway) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Monday, June 30, 2008 1:00 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython 1.1.2 eta? Yeah, it's not going to happen today :) The changes are done (any bugs assigned to me and the 1.1.2 release on CodePlex will be fixed), they just need to run through a full test pass. I got started on the changes late and the test infrastructure needed to be brought back to life so it's taking a little bit longer than expected but the RC should be out soon. Beta 4 is currently planned for early August. If you're willing to try out a source release from http://www.codeplex.com/IronPython/SourceControl/ListDownloadableCommits.aspx I'd be happy to let you know when the last remaining regression is fixed (and gets uploaded there - looks like that hasn't been happening :(). We've fixed the polymorphic call site perf bug already but there's still a bug that results in massive overhead of calling simple Python functions. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Monday, June 30, 2008 11:51 AM To: Discussion of IronPython Subject: [IronPython] IronPython 1.1.2 eta? Hello guys, A while back you suggested that IronPython 1.1.2 would arrive 'some time in June'. Whilst that is still possible it seems unlikely, any news on an eta? Whilst we're at it, any idea on when IP 2 Beta 4 might be released? We'd like to test Resolver One with an updated IronPython 2 where performance isn't borked quite so much... :-) Michael -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ _______________________________________________ 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 Tue Jul 1 07:20:13 2008 From: kfarmer at thuban.org (Keith J. Farmer) Date: Mon, 30 Jun 2008 22:20:13 -0700 Subject: [IronPython] IronPython 1.1.2 eta? In-Reply-To: <7AD436E4270DD54A94238001769C2227012C932988EE@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <48692AFD.4040605@voidspace.org.uk><7AD436E4270DD54A94238001769C2227012C93298788@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <7AD436E4270DD54A94238001769C2227012C932988EE@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: You can just not compile a hard dependency on System.Core, and instead import it manually. Basically, create a plug-in style architecture for dealing with it: Start: DLR Import: DLR + LINQ-for-DLR plugin (+ System.Core, required by plugin) So such a plugin would be importable, and then it could register itself as a service to handle specific points in processing. If no such service is loaded and registered, processing continues as normal (eg, .NET 2.0-level). -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Monday, June 30, 2008 9:40 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython 1.1.2 eta? The good news is this is basically inevitable but will take some time to achieve :). In the latest source code, I guess currently available only through the IronRuby SVN, you'll see that the namespaces of the DLR expression trees have moved to System.Linq.Expressions. This is the completion of making the DLR expression trees into a superset of the LINQ expression trees. Unfortunately both of your features require taking a dependency on .NET 3.5 (or some future version) which we're just not quite ready to do. But ultimately this should be trivial in the future - it's just not going to happen in 1.x and probably not 2.x. But the lambdas -> expression trees is probably a little easier as it's just add some new conversion support - C# 3.0 extension methods have scoping design issues. Anyway obviously this is something we care about too but it serves as a good excuse to mention some cool recent code changes :). -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Keith J. Farmer Sent: Monday, June 30, 2008 9:26 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython 1.1.2 eta? (Python lambdas to CLR Expression Trees.. my one wish aside from C#3-style extension method resolution) (but y'all knew that, anyway) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Monday, June 30, 2008 1:00 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython 1.1.2 eta? Yeah, it's not going to happen today :) The changes are done (any bugs assigned to me and the 1.1.2 release on CodePlex will be fixed), they just need to run through a full test pass. I got started on the changes late and the test infrastructure needed to be brought back to life so it's taking a little bit longer than expected but the RC should be out soon. Beta 4 is currently planned for early August. If you're willing to try out a source release from http://www.codeplex.com/IronPython/SourceControl/ListDownloadableCommits.aspx I'd be happy to let you know when the last remaining regression is fixed (and gets uploaded there - looks like that hasn't been happening :(). We've fixed the polymorphic call site perf bug already but there's still a bug that results in massive overhead of calling simple Python functions. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Monday, June 30, 2008 11:51 AM To: Discussion of IronPython Subject: [IronPython] IronPython 1.1.2 eta? Hello guys, A while back you suggested that IronPython 1.1.2 would arrive 'some time in June'. Whilst that is still possible it seems unlikely, any news on an eta? Whilst we're at it, any idea on when IP 2 Beta 4 might be released? We'd like to test Resolver One with an updated IronPython 2 where performance isn't borked quite so much... :-) Michael -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ _______________________________________________ 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 fuzzyman at voidspace.org.uk Tue Jul 1 10:27:33 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 01 Jul 2008 09:27:33 +0100 Subject: [IronPython] IronPython 1.1.2 eta? In-Reply-To: <7AD436E4270DD54A94238001769C2227012C932988EE@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <48692AFD.4040605@voidspace.org.uk> <7AD436E4270DD54A94238001769C2227012C93298788@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <7AD436E4270DD54A94238001769C2227012C932988EE@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <4869EA75.2030105@voidspace.org.uk> Dino Viehland wrote: > The good news is this is basically inevitable but will take some time to achieve :). In the latest source code, I guess currently available only through the IronRuby SVN, you'll see that the namespaces of the DLR expression trees have moved to System.Linq.Expressions. This is the completion of making the DLR expression trees into a superset of the LINQ expression trees. > > Unfortunately both of your features require taking a dependency on .NET 3.5 (or some future version) which we're just not quite ready to do. But ultimately this should be trivial in the future - it's just not going to happen in 1.x and probably not 2.x. But the lambdas -> expression trees is probably a little easier as it's just add some new conversion support - C# 3.0 extension methods have scoping design issues. > Please don't make .NET 3.5 a dependency for IronPython! As an option for additional Linq support in IronPython it would be *great*, but not as a requirement... Thanks Michael Foord > Anyway obviously this is something we care about too but it serves as a good excuse to mention some cool recent code changes :). > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Keith J. Farmer > Sent: Monday, June 30, 2008 9:26 PM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython 1.1.2 eta? > > (Python lambdas to CLR Expression Trees.. my one wish aside from C#3-style extension method resolution) > > (but y'all knew that, anyway) > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland > Sent: Monday, June 30, 2008 1:00 PM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython 1.1.2 eta? > > Yeah, it's not going to happen today :) The changes are done (any bugs assigned to me and the 1.1.2 release on CodePlex will be fixed), they just need to run through a full test pass. I got started on the changes late and the test infrastructure needed to be brought back to life so it's taking a little bit longer than expected but the RC should be out soon. > > Beta 4 is currently planned for early August. If you're willing to try out a source release from http://www.codeplex.com/IronPython/SourceControl/ListDownloadableCommits.aspx I'd be happy to let you know when the last remaining regression is fixed (and gets uploaded there - looks like that hasn't been happening :(). We've fixed the polymorphic call site perf bug already but there's still a bug that results in massive overhead of calling simple Python functions. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Monday, June 30, 2008 11:51 AM > To: Discussion of IronPython > Subject: [IronPython] IronPython 1.1.2 eta? > > Hello guys, > > A while back you suggested that IronPython 1.1.2 would arrive 'some time > in June'. Whilst that is still possible it seems unlikely, any news on > an eta? > > Whilst we're at it, any idea on when IP 2 Beta 4 might be released? We'd > like to test Resolver One with an updated IronPython 2 where performance > isn't borked quite so much... :-) > > Michael > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.resolverhacks.net/ http://wwww.theotherdelia.co.uk/ From dan.eloff at gmail.com Tue Jul 1 15:32:28 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Tue, 1 Jul 2008 08:32:28 -0500 Subject: [IronPython] StaticResources + DLR + Silverlight In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A32845D42AE215@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <4817b6fc0805050643g61cf500fy91c17510b5661c6a@mail.gmail.com> <5283CA0A4168DF4FBBD71AE9ECA5A32845D42AE215@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <4817b6fc0807010632j2309472u5778dc38389c345@mail.gmail.com> Hi Jimmy, I was reading your blog and it turns out you and I are the same age. Go figure. I tried this out, and it works great. There's one major problem with it though. It doesn't work with templating. LoadComponent has no overload that accepts a xaml string (or loaded application object). The current workaround I'd have to use is to evaluate the template, upload the generated xaml to the server, get a dynamic uri back, and load the xaml back down with LoadComponent. Very nasty. Please, please push to get an lower-level overload of LoadComponent that takes xaml instead of a Uri (probably there already is such a beast, it's just not public.) Thanks, -Dan On Wed, Jun 25, 2008 at 7:55 PM, Jimmy Schementi wrote: > > Using a dynamic language in Silverlight is no different than in C#/VB wrt StaticResources; you can have a app.xaml file which looks like this: > > xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" > x:Class="Microsoft.Scripting.Silverlight.DynamicApplication" > > > > > > > > And load it in app.py like this: > > Application.LoadComponent(Application.current, Uri("app.xaml", UriKind.Relative)) > > I omit this "StaticResource XAML file" from our templates since I figured they'd only add confusion, but do you think this should be in there regardless? > > ~Jimmy > >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users- >> bounces at lists.ironpython.com] On Behalf Of Dan Eloff >> Sent: Monday, May 05, 2008 6:44 AM >> To: Discussion of IronPython >> Subject: [IronPython] StaticResources + DLR + Silverlight >> >> I notice if you use C#/VB, you have in your main xaml >> file. In there you can place resources that can be used from anywhere >> in your other xaml files. Using the {StaticResource foo} markup >> extension. >> >> If you are using a dynamic language, there is no >> equivalent (please correct me if I'm wrong), most examples I've seen >> use . >> >> The trouble is placing your resources in makes >> them off limit to {StaticResource foo} in any other xaml files (again >> please correct me if I'm wrong) >> >> So I find myself in a nightmare of duplicating resources across files >> and setting styles in code from >> Application.Current.RootVisual.Resources['foo'], neither of which is >> pleasant. Are there really no better alternatives? >> >> -Dan >> _______________________________________________ >> 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 brosembob at yahoo.com Tue Jul 1 16:21:14 2008 From: brosembob at yahoo.com (Bob Rosembob) Date: Tue, 1 Jul 2008 07:21:14 -0700 (PDT) Subject: [IronPython] Another deployment question... Message-ID: <804624.69867.qm@web35705.mail.mud.yahoo.com> One script that I'm using is a third party code and they would prefere me to use the compiled version of it. Is there a way to compile it? Please advise. Thanks, Bob ----------------------------------------------------------------------- Bob Rosembob wrote: >Hi there, >I have a couple of questions. >? >1. If I'm using IronPython to call Python function from my C# app. >What do I need to deploy my project? >? >I added references to my project to the following dlls: >/IronPython.dlll >IronMath.dll/ >/ >? / >In the code I'm using the following: >/using IronPython.Runtime; >using IronPython.Runtime.Types; >using IronPython.Runtime.Operations; >usingIronPython.Hosting; >using IronPython.Modules;/ >/ >? / >The script imports: >/string/ >/sys/ >/os/ >/math/ >and other >? >2. In order to run the script I had to copy imported libraries into >directory where my exe is.? For some reason if I copy the compiled >version of the files (e.g. string.pyc, sys.pyc, etc.) my script won't >find them. It can see only none-compiled files. Why is it? What should >I do to be able run all script files (py) as compiled (pyc)? Those compiled files are compiled into bytecode for the CPython VM. They will never run on the .NET framework. What is wrong with using the '.py' source files? Michael >? >Please advise. >? >Thanks, >Bob >? > >------------------------------------------------------------------------ -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Tue Jul 1 16:26:18 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 01 Jul 2008 15:26:18 +0100 Subject: [IronPython] Another deployment question... In-Reply-To: <804624.69867.qm@web35705.mail.mud.yahoo.com> References: <804624.69867.qm@web35705.mail.mud.yahoo.com> Message-ID: <486A3E8A.2090303@voidspace.org.uk> Bob Rosembob wrote: > One script that I'm using is a third party code and they would prefere > me to use the compiled version of it. Is there a way to compile it? > You *cannot* use '.pyc' files with IronPython. With IronPython 1 you can compile Python files into .NET assemblies that you can import from as if they were Python files (Resolver Systems use that). You can use the 'Pyc' compiler sample to do this. There is not yet any equivalent for IronPython 2. Michael Foord > Please advise. > > Thanks, > Bob > > ----------------------------------------------------------------------- > Bob Rosembob wrote: > >/ Hi there, > />/ I have a couple of questions. > />/ > />/ 1. If I'm using IronPython to call Python function from my C# app. > />/ What do I need to deploy my project? > />/ > />/ I added references to my project to the following dlls: > />/ /IronPython.dlll > />/ IronMath.dll/ > />/ / > />/ / > />/ In the code I'm using the following: > />/ /using IronPython.Runtime; > />/ using IronPython.Runtime.Types; > />/ using IronPython.Runtime.Operations; > />/ usingIronPython.Hosting; > />/ using IronPython.Modules;/ > />/ / > />/ / > />/ The script imports: > />/ /string/ > />/ /sys/ > />/ /os/ > />/ /math/ > />/ and other > />/ > />/ 2. In order to run the script I had to copy imported libraries > into />/ directory where my exe is. For some reason if I copy the > compiled > />/ version of the files (e.g. string.pyc, sys.pyc, etc.) my script won't > />/ find them. It can see only none-compiled files. Why is it? What > should />/ I do to be able run all script files (py) as compiled (pyc)? > / > Those compiled files are compiled into bytecode for the CPython VM. They > will never run on the .NET framework. > > What is wrong with using the '.py' source files? > > Michael > > > >/ > />/ Please advise. > />/ > />/ Thanks, > />/ Bob > />/ > />/ > />/ > ------------------------------------------------------------------------/ > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.resolverhacks.net/ http://wwww.theotherdelia.co.uk/ From dinov at exchange.microsoft.com Tue Jul 1 17:11:42 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 1 Jul 2008 08:11:42 -0700 Subject: [IronPython] IronPython 1.1.2 eta? In-Reply-To: References: <48692AFD.4040605@voidspace.org.uk><7AD436E4270DD54A94238001769C2227012C93298788@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <7AD436E4270DD54A94238001769C2227012C932988EE@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <7AD436E4270DD54A94238001769C2227012C93298916@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Or we could use reflection to access the members we need (we've been doing that for a while to get a 2.0SP1 feature). For small features this is perfectly reasonable but for something as large as transforming our ASTs into LINQ ASTs it seems better to just move to a newer version of .NET when appropriate. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Keith J. Farmer Sent: Monday, June 30, 2008 10:20 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython 1.1.2 eta? You can just not compile a hard dependency on System.Core, and instead import it manually. Basically, create a plug-in style architecture for dealing with it: Start: DLR Import: DLR + LINQ-for-DLR plugin (+ System.Core, required by plugin) So such a plugin would be importable, and then it could register itself as a service to handle specific points in processing. If no such service is loaded and registered, processing continues as normal (eg, .NET 2.0-level). -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Monday, June 30, 2008 9:40 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython 1.1.2 eta? The good news is this is basically inevitable but will take some time to achieve :). In the latest source code, I guess currently available only through the IronRuby SVN, you'll see that the namespaces of the DLR expression trees have moved to System.Linq.Expressions. This is the completion of making the DLR expression trees into a superset of the LINQ expression trees. Unfortunately both of your features require taking a dependency on .NET 3.5 (or some future version) which we're just not quite ready to do. But ultimately this should be trivial in the future - it's just not going to happen in 1.x and probably not 2.x. But the lambdas -> expression trees is probably a little easier as it's just add some new conversion support - C# 3.0 extension methods have scoping design issues. Anyway obviously this is something we care about too but it serves as a good excuse to mention some cool recent code changes :). -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Keith J. Farmer Sent: Monday, June 30, 2008 9:26 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython 1.1.2 eta? (Python lambdas to CLR Expression Trees.. my one wish aside from C#3-style extension method resolution) (but y'all knew that, anyway) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Monday, June 30, 2008 1:00 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython 1.1.2 eta? Yeah, it's not going to happen today :) The changes are done (any bugs assigned to me and the 1.1.2 release on CodePlex will be fixed), they just need to run through a full test pass. I got started on the changes late and the test infrastructure needed to be brought back to life so it's taking a little bit longer than expected but the RC should be out soon. Beta 4 is currently planned for early August. If you're willing to try out a source release from http://www.codeplex.com/IronPython/SourceControl/ListDownloadableCommits.aspx I'd be happy to let you know when the last remaining regression is fixed (and gets uploaded there - looks like that hasn't been happening :(). We've fixed the polymorphic call site perf bug already but there's still a bug that results in massive overhead of calling simple Python functions. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Monday, June 30, 2008 11:51 AM To: Discussion of IronPython Subject: [IronPython] IronPython 1.1.2 eta? Hello guys, A while back you suggested that IronPython 1.1.2 would arrive 'some time in June'. Whilst that is still possible it seems unlikely, any news on an eta? Whilst we're at it, any idea on when IP 2 Beta 4 might be released? We'd like to test Resolver One with an updated IronPython 2 where performance isn't borked quite so much... :-) Michael -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ _______________________________________________ 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 From dinov at exchange.microsoft.com Tue Jul 1 17:14:19 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 1 Jul 2008 08:14:19 -0700 Subject: [IronPython] IronPython 1.1.2 eta? In-Reply-To: <4869EA75.2030105@voidspace.org.uk> References: <48692AFD.4040605@voidspace.org.uk> <7AD436E4270DD54A94238001769C2227012C93298788@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <7AD436E4270DD54A94238001769C2227012C932988EE@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <4869EA75.2030105@voidspace.org.uk> Message-ID: <7AD436E4270DD54A94238001769C2227012C93298918@DF-GRTDANE-MSG.exchange.corp.microsoft.com> We're not going to do that anytime soon - but there will be a point in the future when we require a more recent .NET than 2.0. Our current thinking is that happens when pieces of the DLR move into the .NET framework. We'll then have a major new version - e.g. 3.0. But it's not going to happen anytime too soon. We currently think all releases in 2.x will forever require .NET 2.0 SP1 as their minimum bar. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Tuesday, July 01, 2008 1:28 AM To: Discussion of IronPython Subject: Re: [IronPython] IronPython 1.1.2 eta? Dino Viehland wrote: > The good news is this is basically inevitable but will take some time to achieve :). In the latest source code, I guess currently available only through the IronRuby SVN, you'll see that the namespaces of the DLR expression trees have moved to System.Linq.Expressions. This is the completion of making the DLR expression trees into a superset of the LINQ expression trees. > > Unfortunately both of your features require taking a dependency on .NET 3.5 (or some future version) which we're just not quite ready to do. But ultimately this should be trivial in the future - it's just not going to happen in 1.x and probably not 2.x. But the lambdas -> expression trees is probably a little easier as it's just add some new conversion support - C# 3.0 extension methods have scoping design issues. > Please don't make .NET 3.5 a dependency for IronPython! As an option for additional Linq support in IronPython it would be *great*, but not as a requirement... Thanks Michael Foord > Anyway obviously this is something we care about too but it serves as a good excuse to mention some cool recent code changes :). > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Keith J. Farmer > Sent: Monday, June 30, 2008 9:26 PM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython 1.1.2 eta? > > (Python lambdas to CLR Expression Trees.. my one wish aside from C#3-style extension method resolution) > > (but y'all knew that, anyway) > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland > Sent: Monday, June 30, 2008 1:00 PM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython 1.1.2 eta? > > Yeah, it's not going to happen today :) The changes are done (any bugs assigned to me and the 1.1.2 release on CodePlex will be fixed), they just need to run through a full test pass. I got started on the changes late and the test infrastructure needed to be brought back to life so it's taking a little bit longer than expected but the RC should be out soon. > > Beta 4 is currently planned for early August. If you're willing to try out a source release from http://www.codeplex.com/IronPython/SourceControl/ListDownloadableCommits.aspx I'd be happy to let you know when the last remaining regression is fixed (and gets uploaded there - looks like that hasn't been happening :(). We've fixed the polymorphic call site perf bug already but there's still a bug that results in massive overhead of calling simple Python functions. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Monday, June 30, 2008 11:51 AM > To: Discussion of IronPython > Subject: [IronPython] IronPython 1.1.2 eta? > > Hello guys, > > A while back you suggested that IronPython 1.1.2 would arrive 'some time > in June'. Whilst that is still possible it seems unlikely, any news on > an eta? > > Whilst we're at it, any idea on when IP 2 Beta 4 might be released? We'd > like to test Resolver One with an updated IronPython 2 where performance > isn't borked quite so much... :-) > > Michael > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.resolverhacks.net/ http://wwww.theotherdelia.co.uk/ _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From fuzzyman at voidspace.org.uk Tue Jul 1 17:19:21 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 01 Jul 2008 16:19:21 +0100 Subject: [IronPython] IronPython 1.1.2 eta? In-Reply-To: <7AD436E4270DD54A94238001769C2227012C93298918@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <48692AFD.4040605@voidspace.org.uk> <7AD436E4270DD54A94238001769C2227012C93298788@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <7AD436E4270DD54A94238001769C2227012C932988EE@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <4869EA75.2030105@voidspace.org.uk> <7AD436E4270DD54A94238001769C2227012C93298918@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <486A4AF9.7070702@voidspace.org.uk> Dino Viehland wrote: > We're not going to do that anytime soon - but there will be a point in the future when we require a more recent .NET than 2.0. Our current thinking is that happens when pieces of the DLR move into the .NET framework. We'll then have a major new version - e.g. 3.0. But it's not going to happen anytime too soon. We currently think all releases in 2.x will forever require .NET 2.0 SP1 as their minimum bar. > > Ok - cool. Michael > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Tuesday, July 01, 2008 1:28 AM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython 1.1.2 eta? > > Dino Viehland wrote: > >> The good news is this is basically inevitable but will take some time to achieve :). In the latest source code, I guess currently available only through the IronRuby SVN, you'll see that the namespaces of the DLR expression trees have moved to System.Linq.Expressions. This is the completion of making the DLR expression trees into a superset of the LINQ expression trees. >> >> Unfortunately both of your features require taking a dependency on .NET 3.5 (or some future version) which we're just not quite ready to do. But ultimately this should be trivial in the future - it's just not going to happen in 1.x and probably not 2.x. But the lambdas -> expression trees is probably a little easier as it's just add some new conversion support - C# 3.0 extension methods have scoping design issues. >> >> > > Please don't make .NET 3.5 a dependency for IronPython! > > As an option for additional Linq support in IronPython it would be > *great*, but not as a requirement... > > Thanks > > Michael Foord > > >> Anyway obviously this is something we care about too but it serves as a good excuse to mention some cool recent code changes :). >> >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Keith J. Farmer >> Sent: Monday, June 30, 2008 9:26 PM >> To: Discussion of IronPython >> Subject: Re: [IronPython] IronPython 1.1.2 eta? >> >> (Python lambdas to CLR Expression Trees.. my one wish aside from C#3-style extension method resolution) >> >> (but y'all knew that, anyway) >> >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland >> Sent: Monday, June 30, 2008 1:00 PM >> To: Discussion of IronPython >> Subject: Re: [IronPython] IronPython 1.1.2 eta? >> >> Yeah, it's not going to happen today :) The changes are done (any bugs assigned to me and the 1.1.2 release on CodePlex will be fixed), they just need to run through a full test pass. I got started on the changes late and the test infrastructure needed to be brought back to life so it's taking a little bit longer than expected but the RC should be out soon. >> >> Beta 4 is currently planned for early August. If you're willing to try out a source release from http://www.codeplex.com/IronPython/SourceControl/ListDownloadableCommits.aspx I'd be happy to let you know when the last remaining regression is fixed (and gets uploaded there - looks like that hasn't been happening :(). We've fixed the polymorphic call site perf bug already but there's still a bug that results in massive overhead of calling simple Python functions. >> >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord >> Sent: Monday, June 30, 2008 11:51 AM >> To: Discussion of IronPython >> Subject: [IronPython] IronPython 1.1.2 eta? >> >> Hello guys, >> >> A while back you suggested that IronPython 1.1.2 would arrive 'some time >> in June'. Whilst that is still possible it seems unlikely, any news on >> an eta? >> >> Whilst we're at it, any idea on when IP 2 Beta 4 might be released? We'd >> like to test Resolver One with an updated IronPython 2 where performance >> isn't borked quite so much... :-) >> >> Michael >> >> -- >> http://www.ironpythoninaction.com/ >> http://www.voidspace.org.uk/ >> http://www.trypython.org/ >> http://www.ironpython.info/ >> http://www.theotherdelia.co.uk/ >> http://www.resolverhacks.net/ >> >> _______________________________________________ >> 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 >> >> > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.resolverhacks.net/ > http://wwww.theotherdelia.co.uk/ > > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.resolverhacks.net/ http://wwww.theotherdelia.co.uk/ From riltim at gmail.com Tue Jul 1 20:26:16 2008 From: riltim at gmail.com (Tim Riley) Date: Tue, 1 Jul 2008 14:26:16 -0400 Subject: [IronPython] Python Generation In-Reply-To: References: <7AD436E4270DD54A94238001769C2227012C932988CD@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: Care to share an example? I am very interested in this. On Mon, Jun 30, 2008 at 10:39 PM, Michael Stephens wrote: > Thanks.. I've got a basic example up. > > Michael Stephens > > Electrical Engineering Graduate Student > University of Wyoming > falcon at uwyo.edu or 89iroc at gmail.com > > On Mon, Jun 30, 2008 at 7:33 PM, Dino Viehland > wrote: >> >> You could take a look at IronPython 1.x's CodeDom support in >> IronPython.CodeDom.Provider. From there you can get the generator and throw >> CodeDom trees at it. It can generate a bunch of ugliness to support >> WinForms but by default it doesn't do that. Unfortunately it hasn't been >> updated to 2.0 but of course the source is available J >> >> >> >> From: users-bounces at lists.ironpython.com >> [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Stephens >> Sent: Monday, June 30, 2008 6:14 PM >> To: Discussion of IronPython >> Subject: [IronPython] Python Generation >> >> >> >> I am writing a macro->python translation utility for our system. I >> thought I struck it rich when i found IronPython.Compiler.Ast . But there >> doesn't seem to be a good way to take these things and generate python code >> (strings). If anyone knows any spiffy libraries out there to do this that >> would be awesome too. >> >> Michael Stephens >> >> Electrical Engineering Graduate Student >> University of Wyoming >> falcon at uwyo.edu or 89iroc at gmail.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 brosembob at yahoo.com Tue Jul 1 20:29:12 2008 From: brosembob at yahoo.com (Bob Rosembob) Date: Tue, 1 Jul 2008 11:29:12 -0700 (PDT) Subject: [IronPython] Another deployment question... Message-ID: <826185.42281.qm@web35706.mail.mud.yahoo.com> Michael, thanks for your help. ? I looked at the documentation and tried to?follow the directions but I got something different then what I expected. Here what I did: 1. Copied IronPython and IronMath dlls and ipy.exe into the directory where my script is 2. Started command prompt and changed the directory 3. Typed the following ipy.exe cycle.py /target:cycle.dll ? It executed the script but didn't create cycle.dll. I guess I'm missing something. Please advise, Bob ? ----- Original Message ---- From: Michael Foord To: Discussion of IronPython Sent: Tuesday, July 1, 2008 10:26:18 AM Subject: Re: [IronPython] Another deployment question... Bob Rosembob wrote: > One script that I'm using is a third party code and they would prefere > me to use the compiled version of it. Is there a way to compile it? >? You *cannot* use '.pyc' files with IronPython. With IronPython 1 you can compile Python files into .NET assemblies that you can import from as if they were Python files (Resolver Systems use that). You can use the 'Pyc' compiler sample to do this. There is not yet any equivalent for IronPython 2. Michael Foord > Please advise. >? > Thanks, > Bob >? > ----------------------------------------------------------------------- > Bob Rosembob wrote: > >/ Hi there, > />/ I have a couple of questions. > />/ > />/ 1. If I'm using IronPython to call Python function from my C# app. > />/ What do I need to deploy my project? > />/ > />/ I added references to my project to the following dlls: > />/ /IronPython.dlll > />/ IronMath.dll/ > />/ / > />/? / > />/ In the code I'm using the following: > />/ /using IronPython.Runtime; > />/ using IronPython.Runtime.Types; > />/ using IronPython.Runtime.Operations; > />/ usingIronPython.Hosting; > />/ using IronPython.Modules;/ > />/ / > />/? / > />/ The script imports: > />/ /string/ > />/ /sys/ > />/ /os/ > />/ /math/ > />/ and other > />/ > />/ 2. In order to run the script I had to copy imported libraries > into />/ directory where my exe is.? For some reason if I copy the > compiled > />/ version of the files (e.g. string.pyc, sys.pyc, etc.) my script won't > />/ find them. It can see only none-compiled files. Why is it? What > should />/ I do to be able run all script files (py) as compiled (pyc)? > / > Those compiled files are compiled into bytecode for the CPython VM. They > will never run on the .NET framework. > > What is wrong with using the '.py' source files? > > Michael > > > >/ > />/ Please advise. > />/ > />/ Thanks, > />/ Bob > />/ > />/ > />/ > ------------------------------------------------------------------------/ > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >? -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.resolverhacks.net/ http://wwww.theotherdelia.co.uk/ _______________________________________________ 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 brosembob at yahoo.com Tue Jul 1 21:25:25 2008 From: brosembob at yahoo.com (Bob Rosembob) Date: Tue, 1 Jul 2008 12:25:25 -0700 (PDT) Subject: [IronPython] Another deployment question... Message-ID: <881765.82997.qm@web35704.mail.mud.yahoo.com> I thinks I got it. ipy.exe pyc.py /target:dll cycle.py would create cycle.dll ----- Original Message ---- From: Bob Rosembob To: Discussion of IronPython Sent: Tuesday, July 1, 2008 2:29:12 PM Subject: Re: [IronPython] Another deployment question... Michael, thanks for your help. ? I looked at the documentation and tried to?follow the directions but I got something different then what I expected. Here what I did: 1. Copied IronPython and IronMath dlls and ipy.exe into the directory where my script is 2. Started command prompt and changed the directory 3. Typed the following ipy.exe cycle.py /target:cycle.dll ? It executed the script but didn't create cycle.dll. I guess I'm missing something. Please advise, Bob ? ----- Original Message ---- From: Michael Foord To: Discussion of IronPython Sent: Tuesday, July 1, 2008 10:26:18 AM Subject: Re: [IronPython] Another deployment question... Bob Rosembob wrote: > One script that I'm using is a third party code and they would prefere > me to use the compiled version of it. Is there a way to compile it? >? You *cannot* use '.pyc' files with IronPython. With IronPython 1 you can compile Python files into .NET assemblies that you can import from as if they were Python files (Resolver Systems use that). You can use the 'Pyc' compiler sample to do this. There is not yet any equivalent for IronPython 2. Michael Foord > Please advise. >? > Thanks, > Bob >? > ----------------------------------------------------------------------- > Bob Rosembob wrote: > >/ Hi there, > />/ I have a couple of questions. > />/ > />/ 1. If I'm using IronPython to call Python function from my C# app. > />/ What do I need to deploy my project? > />/ > />/ I added references to my project to the following dlls: > />/ /IronPython.dlll > />/ IronMath.dll/ > />/ / > />/? / > />/ In the code I'm using the following: > />/ /using IronPython.Runtime; > />/ using IronPython.Runtime.Types; > />/ using IronPython.Runtime.Operations; > />/ usingIronPython.Hosting; > />/ using IronPython.Modules;/ > />/ / > />/? / > />/ The script imports: > />/ /string/ > />/ /sys/ > />/ /os/ > />/ /math/ > />/ and other > />/ > />/ 2. In order to run the script I had to copy imported libraries > into />/ directory where my exe is.? For some reason if I copy the > compiled > />/ version of the files (e.g. string.pyc, sys.pyc, etc.) my script won't > />/ find them. It can see only none-compiled files. Why is it? What > should />/ I do to be able run all script files (py) as compiled (pyc)? > / > Those compiled files are compiled into bytecode for the CPython VM. They > will never run on the .NET framework. > > What is wrong with using the '.py' source files? > > Michael > > > >/ > />/ Please advise. > />/ > />/ Thanks, > />/ Bob > />/ > />/ > />/ > ------------------------------------------------------------------------/ > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >? -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.resolverhacks.net/ http://wwww.theotherdelia.co.uk/ _______________________________________________ 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 falcon at uwyo.edu Tue Jul 1 21:55:56 2008 From: falcon at uwyo.edu (Michael Stephens) Date: Tue, 1 Jul 2008 13:55:56 -0600 Subject: [IronPython] Python Generation In-Reply-To: References: <7AD436E4270DD54A94238001769C2227012C932988CD@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: http://tech-michael.blogspot.com/2008/06/python-generation-using-code-dom.html Michael Stephens Electrical Engineering Graduate Student University of Wyoming falcon at uwyo.edu or 89iroc at gmail.com On Tue, Jul 1, 2008 at 12:26 PM, Tim Riley wrote: > Care to share an example? I am very interested in this. > > On Mon, Jun 30, 2008 at 10:39 PM, Michael Stephens > wrote: > > Thanks.. I've got a basic example up. > > > > Michael Stephens > > > > Electrical Engineering Graduate Student > > University of Wyoming > > falcon at uwyo.edu or 89iroc at gmail.com > > > > On Mon, Jun 30, 2008 at 7:33 PM, Dino Viehland > > wrote: > >> > >> You could take a look at IronPython 1.x's CodeDom support in > >> IronPython.CodeDom.Provider. From there you can get the generator and > throw > >> CodeDom trees at it. It can generate a bunch of ugliness to support > >> WinForms but by default it doesn't do that. Unfortunately it hasn't > been > >> updated to 2.0 but of course the source is available J > >> > >> > >> > >> From: users-bounces at lists.ironpython.com > >> [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael > Stephens > >> Sent: Monday, June 30, 2008 6:14 PM > >> To: Discussion of IronPython > >> Subject: [IronPython] Python Generation > >> > >> > >> > >> I am writing a macro->python translation utility for our system. I > >> thought I struck it rich when i found IronPython.Compiler.Ast . But > there > >> doesn't seem to be a good way to take these things and generate python > code > >> (strings). If anyone knows any spiffy libraries out there to do this > that > >> would be awesome too. > >> > >> Michael Stephens > >> > >> Electrical Engineering Graduate Student > >> University of Wyoming > >> falcon at uwyo.edu or 89iroc at gmail.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 fuzzyman at voidspace.org.uk Tue Jul 1 22:56:30 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 01 Jul 2008 21:56:30 +0100 Subject: [IronPython] Another deployment question... In-Reply-To: <826185.42281.qm@web35706.mail.mud.yahoo.com> References: <826185.42281.qm@web35706.mail.mud.yahoo.com> Message-ID: <486A99FE.30807@voidspace.org.uk> Bob Rosembob wrote: > Michael, thanks for your help. > > I looked at the documentation and tried to follow the directions but I > got something different then what I expected. > Here what I did: > 1. Copied IronPython and IronMath dlls and ipy.exe into the directory > where my script is > 2. Started command prompt and changed the directory > 3. Typed the following > ipy.exe cycle.py /target:cycle.dll Is that using the 'Pyc' sample? If it is then you aren't invoking Pyc at all. Isn't it *likely* to be something like: ipy.exe pyc.py cycle.py /target:cycle.dll Can you check the documentation again. Michael Foord > > It executed the script but didn't create cycle.dll. I guess I'm > missing something. > Please advise, > Bob > > > > ----- Original Message ---- > From: Michael Foord > To: Discussion of IronPython > Sent: Tuesday, July 1, 2008 10:26:18 AM > Subject: Re: [IronPython] Another deployment question... > > Bob Rosembob wrote: > > One script that I'm using is a third party code and they would prefere > > me to use the compiled version of it. Is there a way to compile it? > > > > You *cannot* use '.pyc' files with IronPython. > > With IronPython 1 you can compile Python files into .NET assemblies that > you can import from as if they were Python files (Resolver Systems use > that). You can use the 'Pyc' compiler sample to do this. > > There is not yet any equivalent for IronPython 2. > > Michael Foord > > > Please advise. > > > > Thanks, > > Bob > > > > ----------------------------------------------------------------------- > > Bob Rosembob wrote: > > >/ Hi there, > > />/ I have a couple of questions. > > />/ > > />/ 1. If I'm using IronPython to call Python function from my C# app. > > />/ What do I need to deploy my project? > > />/ > > />/ I added references to my project to the following dlls: > > />/ /IronPython.dlll > > />/ IronMath.dll/ > > />/ / > > />/ / > > />/ In the code I'm using the following: > > />/ /using IronPython.Runtime; > > />/ using IronPython.Runtime.Types; > > />/ using IronPython.Runtime.Operations; > > />/ usingIronPython.Hosting; > > />/ using IronPython.Modules;/ > > />/ / > > />/ / > > />/ The script imports: > > />/ /string/ > > />/ /sys/ > > />/ /os/ > > />/ /math/ > > />/ and other > > />/ > > />/ 2. In order to run the script I had to copy imported libraries > > into />/ directory where my exe is. For some reason if I copy the > > compiled > > />/ version of the files (e.g. string.pyc, sys.pyc, etc.) my script > won't > > />/ find them. It can see only none-compiled files. Why is it? What > > should />/ I do to be able run all script files (py) as compiled (pyc)? > > / > > Those compiled files are compiled into bytecode for the CPython VM. They > > will never run on the .NET framework. > > > > What is wrong with using the '.py' source files? > > > > Michael > > > > > > >/ > > />/ Please advise. > > />/ > > />/ Thanks, > > />/ Bob > > />/ > > />/ > > />/ > > > ------------------------------------------------------------------------/ > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.resolverhacks.net/ > http://wwww.theotherdelia.co.uk/ > > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From dinov at exchange.microsoft.com Wed Jul 2 00:36:47 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 1 Jul 2008 15:36:47 -0700 Subject: [IronPython] ToyScript - Parses code twice? In-Reply-To: References: Message-ID: <7AD436E4270DD54A94238001769C2227012C93298AAC@DF-GRTDANE-MSG.exchange.corp.microsoft.com> IF you haven't figured this out yet I think it's due to the fact that it gets parsed once to get the source code properties (by the console) and once to compile it. It should only be interactive code that this is happening to. If it's happening to all code then there's probably a bug somewhere that should be fixed. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Ben Hall Sent: Sunday, June 29, 2008 2:07 PM To: Discussion of IronPython Subject: [IronPython] ToyScript - Parses code twice? Hello, I was just looking at ToyScript and how it generates the DLR Trees, and i've found that ParseSourceCode is called twice for a single line of code (in this case print "a" + "b"). I was just wondering is the DLR parsing the source code twice? It seems quite inaffective but i'm sure you have a reason. I would have thought you would only need to generate the DLR Tree once. If you could let me know why this is the case, that would be great. Thanks Ben _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From 89iroc at gmail.com Wed Jul 2 00:58:59 2008 From: 89iroc at gmail.com (Michael Stephens) Date: Tue, 1 Jul 2008 16:58:59 -0600 Subject: [IronPython] CodeWalker public? Message-ID: Any chance of getting CodeWalker made public in the 1.2 release? We really need to be able to easily walk through the AST and track dependant objects. Michael Stephens Electrical Engineering Graduate Student University of Wyoming falcon at uwyo.edu or 89iroc at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Wed Jul 2 01:07:29 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 1 Jul 2008 16:07:29 -0700 Subject: [IronPython] CodeWalker public? In-Reply-To: References: Message-ID: <7AD436E4270DD54A94238001769C2227012C93298AD6@DF-GRTDANE-MSG.exchange.corp.microsoft.com> There's a AstWalker/IAstWalker in IronPython.Compiler.Ast which is better for general consumption. Is that good enough? The AST nodes then expose Walk method which take the IAstWalker. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Stephens Sent: Tuesday, July 01, 2008 3:59 PM To: Discussion of IronPython Subject: [IronPython] CodeWalker public? Any chance of getting CodeWalker made public in the 1.2 release? We really need to be able to easily walk through the AST and track dependant objects. Michael Stephens Electrical Engineering Graduate Student University of Wyoming falcon at uwyo.edu or 89iroc at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From liwei.peng at gmail.com Wed Jul 2 01:16:16 2008 From: liwei.peng at gmail.com (Liwei Peng) Date: Tue, 1 Jul 2008 16:16:16 -0700 Subject: [IronPython] help: ironpy 1.1.1: clr.Reference(Array[str]) works in interactive mode but not in script Message-ID: Hi Iron python team, I have trouble when using *clr.Reference(Array[str]?)* in the following python script. When I ran the script line by line under interactive mode ipy.exe, no issue is found. When I ran it with "ipy.exe a.py", I got the following error: Traceback (most recent call last): File d:\tools\IronPython-1.1.1\a.py, line 12, in Initialize File , line 0, in NonDefaultNew##12 File , line 0, in .ctor##14 # ironpython 1.1.1. how to run: ipy.exe a.py # import sys import clr import System argarray = System.Array[str](sys.argv) # the following doesn't work when running in a python script. # it works from interactive ipy.exe *argarrayref = clr.Reference[ System.Array[str] ]( argarray )* My OS: W2k8 x64 server. Can you help on the issue? Thanks, Liwei -------------- next part -------------- An HTML attachment was scrubbed... URL: From liwei.peng at gmail.com Wed Jul 2 01:25:48 2008 From: liwei.peng at gmail.com (Liwei Peng) Date: Tue, 1 Jul 2008 16:25:48 -0700 Subject: [IronPython] how to avoid a .Net object being converted to tuple type? Message-ID: Hi, I am trying to call MPI.Net from IronPython 1.1.1 in the following script. The problem is IronPython automatically converts my MPI.Environment() object into a tuple type, so that the object cannot be disposed at the end of with statement. the following is what I did: 1) write a __future__.py containing the following 2 lines: division=1 with_statement=1 2) run my script like: ipy.exe -X:Python25 pi.py Got error here: Traceback (most recent call last): File d:\tools\IronPython-1.1.1\pi.py, line 19, in Initialize AttributeError: 'tuple' object has no attribute '__exit__' ERROR: MPI.Environment not finalized. Please call Dispose() on your MPI.Environment object. Can you tell me what's wrong with the script? can I avoid to the conversion from MPI.Environment object to tuple? Thanks, # This is a IronPython program to calculate PI using MPI.Net. # Usage (For IronPython 1.1.1): # ipy.exe -X:Python25 pi.py from __future__ import with_statement import sys import clr import System sys.path.append("C:\Program Files (x86)\MPI.NET\Lib") clr.AddReferenceToFile("MPI.dll") import MPI with MPI.Environment(argarrayref) as mpienv: n=100 Liwei -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Wed Jul 2 01:40:07 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 1 Jul 2008 16:40:07 -0700 Subject: [IronPython] how to avoid a .Net object being converted to tuple type? In-Reply-To: References: Message-ID: <7AD436E4270DD54A94238001769C2227012C93298AF0@DF-GRTDANE-MSG.exchange.corp.microsoft.com> I'm not sure about the error message but unfortunately 1.x doesn't expose Dispose as __exit__. That's been fixed in 2.0. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Liwei Peng Sent: Tuesday, July 01, 2008 4:26 PM To: users at lists.ironpython.com Subject: [IronPython] how to avoid a .Net object being converted to tuple type? Hi, I am trying to call MPI.Net from IronPython 1.1.1 in the following script. The problem is IronPython automatically converts my MPI.Environment() object into a tuple type, so that the object cannot be disposed at the end of with statement. the following is what I did: 1) write a __future__.py containing the following 2 lines: division=1 with_statement=1 2) run my script like: ipy.exe -X:Python25 pi.py Got error here: Traceback (most recent call last): File d:\tools\IronPython-1.1.1\pi.py, line 19, in Initialize AttributeError: 'tuple' object has no attribute '__exit__' ERROR: MPI.Environment not finalized. Please call Dispose() on your MPI.Environment object. Can you tell me what's wrong with the script? can I avoid to the conversion from MPI.Environment object to tuple? Thanks, # This is a IronPython program to calculate PI using MPI.Net. # Usage (For IronPython 1.1.1): # ipy.exe -X:Python25 pi.py from __future__ import with_statement import sys import clr import System sys.path.append("C:\Program Files (x86)\MPI.NET\Lib") clr.AddReferenceToFile("MPI.dll") import MPI with MPI.Environment(argarrayref) as mpienv: n=100 Liwei -------------- next part -------------- An HTML attachment was scrubbed... URL: From 89iroc at gmail.com Wed Jul 2 02:03:45 2008 From: 89iroc at gmail.com (Michael Stephens) Date: Tue, 1 Jul 2008 18:03:45 -0600 Subject: [IronPython] CodeWalker public? In-Reply-To: <7AD436E4270DD54A94238001769C2227012C93298AD6@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <7AD436E4270DD54A94238001769C2227012C93298AD6@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: Thanks.. I didn't realize that the nodes were meant for walking :) I thought I would have to dispatch to the right walk method etc. Thanks! Michael Stephens Electrical Engineering Graduate Student University of Wyoming falcon at uwyo.edu or 89iroc at gmail.com On Tue, Jul 1, 2008 at 5:07 PM, Dino Viehland wrote: > There's a AstWalker/IAstWalker in IronPython.Compiler.Ast which is better > for general consumption. Is that good enough? The AST nodes then expose > Walk method which take the IAstWalker. > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Michael Stephens > *Sent:* Tuesday, July 01, 2008 3:59 PM > *To:* Discussion of IronPython > *Subject:* [IronPython] CodeWalker public? > > > > Any chance of getting CodeWalker made public in the 1.2 release? We really > need to be able to easily walk through the AST and track dependant objects. > > Michael Stephens > > Electrical Engineering Graduate Student > University of Wyoming > falcon at uwyo.edu or 89iroc at gmail.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kfarmer at thuban.org Wed Jul 2 04:10:43 2008 From: kfarmer at thuban.org (Keith J. Farmer) Date: Tue, 1 Jul 2008 19:10:43 -0700 Subject: [IronPython] IronPython 1.1.2 eta? References: <48692AFD.4040605@voidspace.org.uk><7AD436E4270DD54A94238001769C2227012C93298788@DF-GRTDANE-MSG.exchange.corp.microsoft.com><7AD436E4270DD54A94238001769C2227012C932988EE@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <7AD436E4270DD54A94238001769C2227012C93298916@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: That's basically what I said. ________________________________ From: users-bounces at lists.ironpython.com on behalf of Dino Viehland Sent: Tue 7/1/2008 8:11 AM To: Discussion of IronPython Subject: Re: [IronPython] IronPython 1.1.2 eta? Or we could use reflection to access the members we need (we've been doing that for a while to get a 2.0SP1 feature). For small features this is perfectly reasonable but for something as large as transforming our ASTs into LINQ ASTs it seems better to just move to a newer version of .NET when appropriate. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Keith J. Farmer Sent: Monday, June 30, 2008 10:20 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython 1.1.2 eta? You can just not compile a hard dependency on System.Core, and instead import it manually. Basically, create a plug-in style architecture for dealing with it: Start: DLR Import: DLR + LINQ-for-DLR plugin (+ System.Core, required by plugin) So such a plugin would be importable, and then it could register itself as a service to handle specific points in processing. If no such service is loaded and registered, processing continues as normal (eg, .NET 2.0-level). -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Monday, June 30, 2008 9:40 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython 1.1.2 eta? The good news is this is basically inevitable but will take some time to achieve :). In the latest source code, I guess currently available only through the IronRuby SVN, you'll see that the namespaces of the DLR expression trees have moved to System.Linq.Expressions. This is the completion of making the DLR expression trees into a superset of the LINQ expression trees. Unfortunately both of your features require taking a dependency on .NET 3.5 (or some future version) which we're just not quite ready to do. But ultimately this should be trivial in the future - it's just not going to happen in 1.x and probably not 2.x. But the lambdas -> expression trees is probably a little easier as it's just add some new conversion support - C# 3.0 extension methods have scoping design issues. Anyway obviously this is something we care about too but it serves as a good excuse to mention some cool recent code changes :). -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Keith J. Farmer Sent: Monday, June 30, 2008 9:26 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython 1.1.2 eta? (Python lambdas to CLR Expression Trees.. my one wish aside from C#3-style extension method resolution) (but y'all knew that, anyway) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Monday, June 30, 2008 1:00 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython 1.1.2 eta? Yeah, it's not going to happen today :) The changes are done (any bugs assigned to me and the 1.1.2 release on CodePlex will be fixed), they just need to run through a full test pass. I got started on the changes late and the test infrastructure needed to be brought back to life so it's taking a little bit longer than expected but the RC should be out soon. Beta 4 is currently planned for early August. If you're willing to try out a source release from http://www.codeplex.com/IronPython/SourceControl/ListDownloadableCommits.aspx I'd be happy to let you know when the last remaining regression is fixed (and gets uploaded there - looks like that hasn't been happening :(). We've fixed the polymorphic call site perf bug already but there's still a bug that results in massive overhead of calling simple Python functions. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Monday, June 30, 2008 11:51 AM To: Discussion of IronPython Subject: [IronPython] IronPython 1.1.2 eta? Hello guys, A while back you suggested that IronPython 1.1.2 would arrive 'some time in June'. Whilst that is still possible it seems unlikely, any news on an eta? Whilst we're at it, any idea on when IP 2 Beta 4 might be released? We'd like to test Resolver One with an updated IronPython 2 where performance isn't borked quite so much... :-) Michael -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ _______________________________________________ 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 _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From liwei.peng at gmail.com Wed Jul 2 04:22:30 2008 From: liwei.peng at gmail.com (Liwei Peng) Date: Tue, 1 Jul 2008 19:22:30 -0700 Subject: [IronPython] how to avoid a .Net object being converted to tuple type? In-Reply-To: <7AD436E4270DD54A94238001769C2227012C93298AF0@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <7AD436E4270DD54A94238001769C2227012C93298AF0@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: thanks. Can you advise on how to use "with" statement in 2.0 beta3? I couldn't find the __future__ module by default thanks, liwei On Tue, Jul 1, 2008 at 4:40 PM, Dino Viehland wrote: > I'm not sure about the error message but unfortunately 1.x doesn't expose > Dispose as __exit__. That's been fixed in 2.0. > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Liwei Peng > *Sent:* Tuesday, July 01, 2008 4:26 PM > *To:* users at lists.ironpython.com > *Subject:* [IronPython] how to avoid a .Net object being converted to > tuple type? > > > > Hi, > > > > I am trying to call MPI.Net from IronPython 1.1.1 in the following script. > The problem is IronPython automatically converts my MPI.Environment() object > into a tuple type, so that the object cannot be disposed at the end of with > statement. > > > > the following is what I did: > > 1) write a __future__.py containing the following 2 lines: > > division=1 > with_statement=1 > > > > 2) run my script like: ipy.exe -X:Python25 pi.py > > Got error here: > > Traceback (most recent call last): > File d:\tools\IronPython-1.1.1\pi.py, line 19, in Initialize > AttributeError: 'tuple' object has no attribute '__exit__' > ERROR: MPI.Environment not finalized. > Please call Dispose() on your MPI.Environment object. > > > > Can you tell me what's wrong with the script? can I avoid to the conversion > from MPI.Environment object to tuple? Thanks, > > > > # This is a IronPython program to calculate PI using MPI.Net. > # Usage (For IronPython 1.1.1): > # ipy.exe -X:Python25 pi.py > > from __future__ import with_statement > import sys > import clr > import System > > sys.path.append("C:\Program Files (x86)\MPI.NET \Lib") > clr.AddReferenceToFile("MPI.dll") > import MPI > > with MPI.Environment(argarrayref) as mpienv: > n=100 > > Liwei > > > > _______________________________________________ > 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 dan.eloff at gmail.com Wed Jul 2 07:06:24 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Wed, 2 Jul 2008 00:06:24 -0500 Subject: [IronPython] how to avoid a .Net object being converted to tuple type? In-Reply-To: References: <7AD436E4270DD54A94238001769C2227012C93298AF0@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <4817b6fc0807012206x8c18189rfd29a90d67eacf08@mail.gmail.com> Liwei, You just need to add a __future__.py module with with_statement = True, or (probably better) just use the CPython 2.5 __future__.py. -Dan On Tue, Jul 1, 2008 at 9:22 PM, Liwei Peng wrote: > thanks. > > Can you advise on how to use "with" statement in 2.0 beta3? I couldn't find > the __future__ module by default > > thanks, > > liwei > > On Tue, Jul 1, 2008 at 4:40 PM, Dino Viehland > wrote: >> >> I'm not sure about the error message but unfortunately 1.x doesn't expose >> Dispose as __exit__. That's been fixed in 2.0. >> >> >> >> From: users-bounces at lists.ironpython.com >> [mailto:users-bounces at lists.ironpython.com] On Behalf Of Liwei Peng >> Sent: Tuesday, July 01, 2008 4:26 PM >> To: users at lists.ironpython.com >> Subject: [IronPython] how to avoid a .Net object being converted to tuple >> type? >> >> >> >> Hi, >> >> >> >> I am trying to call MPI.Net from IronPython 1.1.1 in the following >> script. The problem is IronPython automatically converts my >> MPI.Environment() object into a tuple type, so that the object cannot be >> disposed at the end of with statement. >> >> >> >> the following is what I did: >> >> 1) write a __future__.py containing the following 2 lines: >> >> division=1 >> with_statement=1 >> >> >> >> 2) run my script like: ipy.exe -X:Python25 pi.py >> >> Got error here: >> >> Traceback (most recent call last): >> File d:\tools\IronPython-1.1.1\pi.py, line 19, in Initialize >> AttributeError: 'tuple' object has no attribute '__exit__' >> ERROR: MPI.Environment not finalized. >> Please call Dispose() on your MPI.Environment object. >> >> >> >> Can you tell me what's wrong with the script? can I avoid to the >> conversion from MPI.Environment object to tuple? Thanks, >> >> >> >> # This is a IronPython program to calculate PI using MPI.Net. >> # Usage (For IronPython 1.1.1): >> # ipy.exe -X:Python25 pi.py >> >> from __future__ import with_statement >> import sys >> import clr >> import System >> >> sys.path.append("C:\Program Files (x86)\MPI.NET\Lib") >> clr.AddReferenceToFile("MPI.dll") >> import MPI >> >> with MPI.Environment(argarrayref) as mpienv: >> n=100 >> >> Liwei >> >> >> >> _______________________________________________ >> 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 dan.eloff at gmail.com Wed Jul 2 07:53:54 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Wed, 2 Jul 2008 00:53:54 -0500 Subject: [IronPython] Importing on another Thread Message-ID: <4817b6fc0807012253v4988c6c1q6ccd3f1a61855bae@mail.gmail.com> I actually haven't managed to successfully import any modules in a new thread, shouldn't this be possible in IronPython (2.0b3) Silverlight B2 All modules loaded in 2.95s Background imported [] Could not (background) import ['hmac', 'hashlib', 'urlparse', 'new', 'ConfigParser', 'cgi', 'heapq', 'copy', 'dis'] I started the thread like so: t = Thread(ThreadStart(preload)) t.Start() And I used __import__ to load the modules. Thanks, -Dan From fuzzyman at voidspace.org.uk Wed Jul 2 11:51:11 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Wed, 02 Jul 2008 10:51:11 +0100 Subject: [IronPython] Importing on another Thread In-Reply-To: <4817b6fc0807012253v4988c6c1q6ccd3f1a61855bae@mail.gmail.com> References: <4817b6fc0807012253v4988c6c1q6ccd3f1a61855bae@mail.gmail.com> Message-ID: <486B4F8F.3010002@voidspace.org.uk> Dan Eloff wrote: > I actually haven't managed to successfully import any modules in a new > thread, shouldn't this be possible in IronPython (2.0b3) Silverlight > B2 > > All modules loaded in 2.95s > Background imported [] > Could not (background) import ['hmac', 'hashlib', 'urlparse', 'new', > 'ConfigParser', 'cgi', 'heapq', 'copy', 'dis'] > > Does it work if you do the imports normally? > I started the thread like so: > > t = Thread(ThreadStart(preload)) > t.Start() > > And I used __import__ to load the modules. > > Out of interest, why? Michael > Thanks, > -Dan > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.resolverhacks.net/ http://www.theotherdelia.co.uk/ From tony_caduto at amsoftwaredesign.com Wed Jul 2 16:06:03 2008 From: tony_caduto at amsoftwaredesign.com (Tony Caduto) Date: Wed, 02 Jul 2008 09:06:03 -0500 Subject: [IronPython] IronPython and Paramiko? Message-ID: <486B8B4B.4070301@amsoftwaredesign.com> Does anyone know if it's possible to use Paramiko (http://www.lag.net/paramiko/) with Iron Python? Thanks, Tony From curt at hagenlocher.org Wed Jul 2 16:12:02 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Wed, 2 Jul 2008 07:12:02 -0700 Subject: [IronPython] IronPython and Paramiko? In-Reply-To: <486B8B4B.4070301@amsoftwaredesign.com> References: <486B8B4B.4070301@amsoftwaredesign.com> Message-ID: The requirement for PyCrypto means that this won't work as-is under IronPython. Although Paramiko itself is pure Python, PyCrypto is a C extension. It's possible that you could get something going with the IronClad project (http://code.google.com/p/ironclad/) which aims to allow you to use C extensions with IronPython. On Wed, Jul 2, 2008 at 7:06 AM, Tony Caduto < tony_caduto at amsoftwaredesign.com> wrote: > Does anyone know if it's possible to use Paramiko ( > http://www.lag.net/paramiko/) with Iron Python? > > Thanks, > > Tony > _______________________________________________ > 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 Wed Jul 2 17:17:08 2008 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Thu, 3 Jul 2008 00:17:08 +0900 Subject: [IronPython] IronPython and Paramiko? In-Reply-To: References: <486B8B4B.4070301@amsoftwaredesign.com> Message-ID: <5b0248170807020817t731da456l4e889fe436784783@mail.gmail.com> 2008/7/2 Curt Hagenlocher : > The requirement for PyCrypto means that this won't work as-is under > IronPython. Although Paramiko itself is pure Python, PyCrypto is a C > extension. It's possible that you could get something going with the > IronClad project (http://code.google.com/p/ironclad/) which aims to allow > you to use C extensions with IronPython. Or FePy project has a reimplementation of PyCrypto for IronPython. -- Seo Sanghyeon From dblank at brynmawr.edu Wed Jul 2 17:40:09 2008 From: dblank at brynmawr.edu (Douglas S. Blank) Date: Wed, 02 Jul 2008 11:40:09 -0400 Subject: [IronPython] IronPython and Paramiko? In-Reply-To: <5b0248170807020817t731da456l4e889fe436784783@mail.gmail.com> References: <486B8B4B.4070301@amsoftwaredesign.com> <5b0248170807020817t731da456l4e889fe436784783@mail.gmail.com> Message-ID: <486BA159.7040903@brynmawr.edu> Sanghyeon Seo wrote: > 2008/7/2 Curt Hagenlocher : >> The requirement for PyCrypto means that this won't work as-is under >> IronPython. Although Paramiko itself is pure Python, PyCrypto is a C >> extension. It's possible that you could get something going with the >> IronClad project (http://code.google.com/p/ironclad/) which aims to allow >> you to use C extensions with IronPython. > > Or FePy project has a reimplementation of PyCrypto for IronPython. FYI, you can find that here: http://fepy.svn.sourceforge.net/viewvc/fepy/trunk/fepy/cipher.py?view=log -Doug From dan.eloff at gmail.com Wed Jul 2 18:39:41 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Wed, 2 Jul 2008 11:39:41 -0500 Subject: [IronPython] Importing on another Thread In-Reply-To: <486B4F8F.3010002@voidspace.org.uk> References: <4817b6fc0807012253v4988c6c1q6ccd3f1a61855bae@mail.gmail.com> <486B4F8F.3010002@voidspace.org.uk> Message-ID: <4817b6fc0807020939gd0c76b9of2663d50d401cc8f@mail.gmail.com> > Does it work if you do the imports normally? Yes. I should have mentioned that these same modules are all imported successfully on the main thread (but that they still fail to import in the background if I comment that out) > Out of interest, why? Most of my startup time is spent importing, I think I may be able to shave 30% off that if I can do some of the imports on a background thread (stdlib modules, some supporting packages.) Of course there would be no performance improvement on a single core machine, but those are becoming rarer every day. -Dan From fuzzyman at voidspace.org.uk Wed Jul 2 18:40:51 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Wed, 02 Jul 2008 17:40:51 +0100 Subject: [IronPython] Importing on another Thread In-Reply-To: <4817b6fc0807020939gd0c76b9of2663d50d401cc8f@mail.gmail.com> References: <4817b6fc0807012253v4988c6c1q6ccd3f1a61855bae@mail.gmail.com> <486B4F8F.3010002@voidspace.org.uk> <4817b6fc0807020939gd0c76b9of2663d50d401cc8f@mail.gmail.com> Message-ID: <486BAF93.2090200@voidspace.org.uk> Dan Eloff wrote: >> Does it work if you do the imports normally? >> > > Yes. I should have mentioned that these same modules are all imported > successfully on the main thread (but that they still fail to import in > the background if I comment that out) > > >> Out of interest, why? >> > > Most of my startup time is spent importing, I think I may be able to > shave 30% off that if I can do some of the imports on a background > thread (stdlib modules, some supporting packages.) Of course there > would be no performance improvement on a single core machine, but > those are becoming rarer every day. > I mean why are you using '__import__'? Does your background importer code work when run on the main thread? Can you show the actual failure message rather than just printing that they failed to import? Michael > -Dan > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.resolverhacks.net/ http://www.theotherdelia.co.uk/ From liwei.peng at gmail.com Wed Jul 2 18:49:33 2008 From: liwei.peng at gmail.com (Liwei Peng) Date: Wed, 2 Jul 2008 09:49:33 -0700 Subject: [IronPython] 2.0 beta3: with statement: SystemError: Operation could destabilize the runtime. Message-ID: Hi, I used IronPython 2.0 Beta3 using the with statement. I got the following error: >ipy.exe a.py Traceback (most recent call last): File "a.py", line 17, in a.py SystemError: Operation could destabilize the runtime. What I did: 1) create a __future__.py file with 1 line: with_statement=True 2) run the following script. the error occured in the line "with MPI.Environment(argarrayref) as mpienv:" from __future__ import with_statement import sys import clr import System sys.path.append("C:\Program Files (x86)\MPI.NET\Lib") clr.AddReferenceToFile("MPI.dll") import MPI argarray = System.Array[str](sys.argv) argarrayref = clr.Reference[ System.Array[str] ]( argarray ) with MPI.Environment(argarrayref) as mpienv: n=100 Question: how can I fix it? thanks, Liwei -------------- next part -------------- An HTML attachment was scrubbed... URL: From curt at hagenlocher.org Wed Jul 2 18:57:51 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Wed, 2 Jul 2008 09:57:51 -0700 Subject: [IronPython] 2.0 beta3: with statement: SystemError: Operation could destabilize the runtime. In-Reply-To: References: Message-ID: That exception isn't coming from IronPython -- not directly, anyway. Can you re-run with the -X:ShowClrExceptions flag? Have you done anything to force IronPython to run as a 32-bit app or is it running as a 64-bit app (ie natively)? Is MPI.NET built against CLR 2.0? On Wed, Jul 2, 2008 at 9:49 AM, Liwei Peng wrote: > Hi, > > I used IronPython 2.0 Beta3 using the with statement. I got the following > error: > > >ipy.exe a.py > Traceback (most recent call last): > File "a.py", line 17, in a.py > SystemError: Operation could destabilize the runtime. > > What I did: > 1) create a __future__.py file with 1 line: > with_statement=True > > 2) run the following script. the error occured in the line "with > MPI.Environment(argarrayref) as mpienv:" > > from __future__ import with_statement > import sys > import clr > import System > > sys.path.append("C:\Program Files (x86)\MPI.NET \Lib") > clr.AddReferenceToFile("MPI.dll") > import MPI > > argarray = System.Array[str](sys.argv) > argarrayref = clr.Reference[ System.Array[str] ]( argarray ) > with MPI.Environment(argarrayref) as mpienv: > n=100 > Question: how can I fix it? thanks, > > Liwei > > _______________________________________________ > 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 Wed Jul 2 19:02:18 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 2 Jul 2008 10:02:18 -0700 Subject: [IronPython] 2.0 beta3: with statement: SystemError: Operation could destabilize the runtime. In-Reply-To: References: Message-ID: <7AD436E4270DD54A94238001769C2227012C93298BCA@DF-GRTDANE-MSG.exchange.corp.microsoft.com> -X:ExceptionDetail is usually much more useful - we should probably just kill -X:ShowClrExceptions :). From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Curt Hagenlocher Sent: Wednesday, July 02, 2008 9:58 AM To: Discussion of IronPython Subject: Re: [IronPython] 2.0 beta3: with statement: SystemError: Operation could destabilize the runtime. That exception isn't coming from IronPython -- not directly, anyway. Can you re-run with the -X:ShowClrExceptions flag? Have you done anything to force IronPython to run as a 32-bit app or is it running as a 64-bit app (ie natively)? Is MPI.NET built against CLR 2.0? On Wed, Jul 2, 2008 at 9:49 AM, Liwei Peng > wrote: Hi, I used IronPython 2.0 Beta3 using the with statement. I got the following error: >ipy.exe a.py Traceback (most recent call last): File "a.py", line 17, in a.py SystemError: Operation could destabilize the runtime. What I did: 1) create a __future__.py file with 1 line: with_statement=True 2) run the following script. the error occured in the line "with MPI.Environment(argarrayref) as mpienv:" from __future__ import with_statement import sys import clr import System sys.path.append("C:\Program Files (x86)\MPI.NET\Lib") clr.AddReferenceToFile("MPI.dll") import MPI argarray = System.Array[str](sys.argv) argarrayref = clr.Reference[ System.Array[str] ]( argarray ) with MPI.Environment(argarrayref) as mpienv: n=100 Question: how can I fix it? thanks, Liwei _______________________________________________ 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 liwei.peng at gmail.com Wed Jul 2 19:36:57 2008 From: liwei.peng at gmail.com (Liwei Peng) Date: Wed, 2 Jul 2008 10:36:57 -0700 Subject: [IronPython] 2.0 beta3: with statement: SystemError: Operation could destabilize the runtime. In-Reply-To: References: Message-ID: Thanks for the help. The following are more details: 1) d:\tools\IronPython-2.0B3>ipy.exe -X:ShowClrExceptions a.py Traceback (most recent call last): File "a.py", line 17, in a.py SystemError: Operation could destabilize the runtime. CLR Exception: VerificationException : Operation could destabilize the runtime. 2) I didn't do anything at force IronPython to run as a 32-bit app or 64-bit app. My OS is x64 W2K8 server. ipy.exe is a 32-bit binary. 3) MPI.net is built from CLR 2.0. thanks, Liwei On Wed, Jul 2, 2008 at 9:57 AM, Curt Hagenlocher wrote: > That exception isn't coming from IronPython -- not directly, anyway. Can > you re-run with the -X:ShowClrExceptions flag? > > Have you done anything to force IronPython to run as a 32-bit app or is it > running as a 64-bit app (ie natively)? Is MPI.NET built > against CLR 2.0? > > On Wed, Jul 2, 2008 at 9:49 AM, Liwei Peng wrote: > >> Hi, >> >> I used IronPython 2.0 Beta3 using the with statement. I got the following >> error: >> >> >ipy.exe a.py >> Traceback (most recent call last): >> File "a.py", line 17, in a.py >> SystemError: Operation could destabilize the runtime. >> >> What I did: >> 1) create a __future__.py file with 1 line: >> with_statement=True >> >> 2) run the following script. the error occured in the line "with >> MPI.Environment(argarrayref) as mpienv:" >> >> from __future__ import with_statement >> import sys >> import clr >> import System >> >> sys.path.append("C:\Program Files (x86)\MPI.NET \Lib") >> clr.AddReferenceToFile("MPI.dll") >> import MPI >> >> argarray = System.Array[str](sys.argv) >> argarrayref = clr.Reference[ System.Array[str] ]( argarray ) >> with MPI.Environment(argarrayref) as mpienv: >> n=100 >> Question: how can I fix it? thanks, >> >> Liwei >> >> _______________________________________________ >> 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 curt at hagenlocher.org Wed Jul 2 20:20:38 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Wed, 2 Jul 2008 11:20:38 -0700 Subject: [IronPython] 2.0 beta3: with statement: SystemError: Operation could destabilize the runtime. In-Reply-To: References: Message-ID: I'm sorry -- Dino's right, I should have said "-X:ExceptionDetail". Could you run again with that? On Wed, Jul 2, 2008 at 10:36 AM, Liwei Peng wrote: > Thanks for the help. The following are more details: > > > 1) d:\tools\IronPython-2.0B3>ipy.exe -X:ShowClrExceptions a.py > Traceback (most recent call last): > File "a.py", line 17, in a.py > SystemError: Operation could destabilize the runtime. > CLR Exception: > VerificationException > : > Operation could destabilize the runtime. > > 2) I didn't do anything at force IronPython to run as a 32-bit app or > 64-bit app. > My OS is x64 W2K8 server. ipy.exe is a 32-bit binary. > 3) MPI.net is built from CLR 2.0. > > thanks, > > Liwei > > On Wed, Jul 2, 2008 at 9:57 AM, Curt Hagenlocher > wrote: > >> That exception isn't coming from IronPython -- not directly, anyway. Can >> you re-run with the -X:ShowClrExceptions flag? >> >> Have you done anything to force IronPython to run as a 32-bit app or is it >> running as a 64-bit app (ie natively)? Is MPI.NET built against CLR 2.0? >> >> On Wed, Jul 2, 2008 at 9:49 AM, Liwei Peng >> wrote: >> >>> Hi, >>> >>> I used IronPython 2.0 Beta3 using the with statement. I got the following >>> error: >>> >>> >ipy.exe a.py >>> Traceback (most recent call last): >>> File "a.py", line 17, in a.py >>> SystemError: Operation could destabilize the runtime. >>> >>> What I did: >>> 1) create a __future__.py file with 1 line: >>> with_statement=True >>> >>> 2) run the following script. the error occured in the line "with >>> MPI.Environment(argarrayref) as mpienv:" >>> >>> from __future__ import with_statement >>> import sys >>> import clr >>> import System >>> >>> sys.path.append("C:\Program Files (x86)\MPI.NET \Lib") >>> clr.AddReferenceToFile("MPI.dll") >>> import MPI >>> >>> argarray = System.Array[str](sys.argv) >>> argarrayref = clr.Reference[ System.Array[str] ]( argarray ) >>> with MPI.Environment(argarrayref) as mpienv: >>> n=100 >>> Question: how can I fix it? thanks, >>> >>> Liwei >>> >>> _______________________________________________ >>> 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 liwei.peng at gmail.com Wed Jul 2 20:33:28 2008 From: liwei.peng at gmail.com (Liwei Peng) Date: Wed, 2 Jul 2008 11:33:28 -0700 Subject: [IronPython] 2.0 beta3: with statement: SystemError: Operation could destabilize the runtime. In-Reply-To: References: Message-ID: Thanks for the help. The following is what I got: d:\tools\IronPython-2.0B3>ipy.exe -X:ExceptionDetail a.py Operation could destabilize the runtime. at _stub_$36##33(Closure , CallSite , CodeContext , Object , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update3[T,T0,T1,T2,TRet](CallSite site , T0 arg0, T1 arg1, T2 arg2) at S$2.Initialize(CodeContext ) at IronPython.Hosting.PythonCommandLine.RunFileWorker(String fileName) at IronPython.Hosting.PythonCommandLine.RunFile(String fileName) SystemError: Operation could destabilize the runtime. Liwei On Wed, Jul 2, 2008 at 11:20 AM, Curt Hagenlocher wrote: > I'm sorry -- Dino's right, I should have said "-X:ExceptionDetail". Could > you run again with that? > > On Wed, Jul 2, 2008 at 10:36 AM, Liwei Peng > wrote: > >> Thanks for the help. The following are more details: >> >> >> 1) d:\tools\IronPython-2.0B3>ipy.exe -X:ShowClrExceptions a.py >> Traceback (most recent call last): >> File "a.py", line 17, in a.py >> SystemError: Operation could destabilize the runtime. >> CLR Exception: >> VerificationException >> : >> Operation could destabilize the runtime. >> >> 2) I didn't do anything at force IronPython to run as a 32-bit app or >> 64-bit app. >> My OS is x64 W2K8 server. ipy.exe is a 32-bit binary. >> 3) MPI.net is built from CLR 2.0. >> >> thanks, >> >> Liwei >> >> On Wed, Jul 2, 2008 at 9:57 AM, Curt Hagenlocher >> wrote: >> >>> That exception isn't coming from IronPython -- not directly, anyway. Can >>> you re-run with the -X:ShowClrExceptions flag? >>> >>> Have you done anything to force IronPython to run as a 32-bit app or is >>> it running as a 64-bit app (ie natively)? Is MPI.NET built against CLR 2.0? >>> >>> On Wed, Jul 2, 2008 at 9:49 AM, Liwei Peng >>> wrote: >>> >>>> Hi, >>>> >>>> I used IronPython 2.0 Beta3 using the with statement. I got the >>>> following error: >>>> >>>> >ipy.exe a.py >>>> Traceback (most recent call last): >>>> File "a.py", line 17, in a.py >>>> SystemError: Operation could destabilize the runtime. >>>> >>>> What I did: >>>> 1) create a __future__.py file with 1 line: >>>> with_statement=True >>>> >>>> 2) run the following script. the error occured in the line "with >>>> MPI.Environment(argarrayref) as mpienv:" >>>> >>>> from __future__ import with_statement >>>> import sys >>>> import clr >>>> import System >>>> >>>> sys.path.append("C:\Program Files (x86)\MPI.NET \Lib") >>>> clr.AddReferenceToFile("MPI.dll") >>>> import MPI >>>> >>>> argarray = System.Array[str](sys.argv) >>>> argarrayref = clr.Reference[ System.Array[str] ]( argarray ) >>>> with MPI.Environment(argarrayref) as mpienv: >>>> n=100 >>>> Question: how can I fix it? thanks, >>>> >>>> Liwei >>>> >>>> _______________________________________________ >>>> 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 dinov at exchange.microsoft.com Wed Jul 2 20:36:05 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 2 Jul 2008 11:36:05 -0700 Subject: [IronPython] 2.0 beta3: with statement: SystemError: Operation could destabilize the runtime. In-Reply-To: References: Message-ID: <7AD436E4270DD54A94238001769C2227012C93298C2B@DF-GRTDANE-MSG.exchange.corp.microsoft.com> One more command line option - can you run with -X:SaveAssemblies? You'll get a Snippets.dll written out to disk that you could send to us and we can see why the code isn't verifiable (or you can run peverify on it and report the verification errors). It looks like it could be a DLR code gen bug. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Liwei Peng Sent: Wednesday, July 02, 2008 11:33 AM To: Discussion of IronPython Subject: Re: [IronPython] 2.0 beta3: with statement: SystemError: Operation could destabilize the runtime. Thanks for the help. The following is what I got: d:\tools\IronPython-2.0B3>ipy.exe -X:ExceptionDetail a.py Operation could destabilize the runtime. at _stub_$36##33(Closure , CallSite , CodeContext , Object , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update3[T,T0,T1,T2,TRet](CallSite site , T0 arg0, T1 arg1, T2 arg2) at S$2.Initialize(CodeContext ) at IronPython.Hosting.PythonCommandLine.RunFileWorker(String fileName) at IronPython.Hosting.PythonCommandLine.RunFile(String fileName) SystemError: Operation could destabilize the runtime. Liwei On Wed, Jul 2, 2008 at 11:20 AM, Curt Hagenlocher > wrote: I'm sorry -- Dino's right, I should have said "-X:ExceptionDetail". Could you run again with that? On Wed, Jul 2, 2008 at 10:36 AM, Liwei Peng > wrote: Thanks for the help. The following are more details: 1) d:\tools\IronPython-2.0B3>ipy.exe -X:ShowClrExceptions a.py Traceback (most recent call last): File "a.py", line 17, in a.py SystemError: Operation could destabilize the runtime. CLR Exception: VerificationException : Operation could destabilize the runtime. 2) I didn't do anything at force IronPython to run as a 32-bit app or 64-bit app. My OS is x64 W2K8 server. ipy.exe is a 32-bit binary. 3) MPI.net is built from CLR 2.0. thanks, Liwei On Wed, Jul 2, 2008 at 9:57 AM, Curt Hagenlocher > wrote: That exception isn't coming from IronPython -- not directly, anyway. Can you re-run with the -X:ShowClrExceptions flag? Have you done anything to force IronPython to run as a 32-bit app or is it running as a 64-bit app (ie natively)? Is MPI.NET built against CLR 2.0? On Wed, Jul 2, 2008 at 9:49 AM, Liwei Peng > wrote: Hi, I used IronPython 2.0 Beta3 using the with statement. I got the following error: >ipy.exe a.py Traceback (most recent call last): File "a.py", line 17, in a.py SystemError: Operation could destabilize the runtime. What I did: 1) create a __future__.py file with 1 line: with_statement=True 2) run the following script. the error occured in the line "with MPI.Environment(argarrayref) as mpienv:" from __future__ import with_statement import sys import clr import System sys.path.append("C:\Program Files (x86)\MPI.NET\Lib") clr.AddReferenceToFile("MPI.dll") import MPI argarray = System.Array[str](sys.argv) argarrayref = clr.Reference[ System.Array[str] ]( argarray ) with MPI.Environment(argarrayref) as mpienv: n=100 Question: how can I fix it? thanks, Liwei _______________________________________________ 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 Shri.Borde at microsoft.com Wed Jul 2 20:46:08 2008 From: Shri.Borde at microsoft.com (Shri Borde) Date: Wed, 2 Jul 2008 11:46:08 -0700 Subject: [IronPython] IronPython 1.1.2 eta? In-Reply-To: References: <48692AFD.4040605@voidspace.org.uk><7AD436E4270DD54A94238001769C2227012C93298788@DF-GRTDANE-MSG.exchange.corp.microsoft.com><7AD436E4270DD54A94238001769C2227012C932988EE@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <7AD436E4270DD54A94238001769C2227012C93298916@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <50B69702CA6E6D4E849D30CD4989AB8EE90FD69DD4@DF-GRTDANE-MSG.exchange.corp.microsoft.com> > Not being able to build with VS 2005 will be a pain as installing VS > 2008 breaks our build environment (last time we tried anyway). I can probably build it > at home though. :-) I don't think you actually need VS2008. If you have .NET 3.5 on the machine, it will have the same version of msbuild as VS 2008, and msbuild is all you will need to build from the sln/csproj files. Thanks, Shri -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Keith J. Farmer Sent: Tuesday, July 01, 2008 7:11 PM To: Discussion of IronPython; Discussion of IronPython Subject: Re: [IronPython] IronPython 1.1.2 eta? That's basically what I said. ________________________________ From: users-bounces at lists.ironpython.com on behalf of Dino Viehland Sent: Tue 7/1/2008 8:11 AM To: Discussion of IronPython Subject: Re: [IronPython] IronPython 1.1.2 eta? Or we could use reflection to access the members we need (we've been doing that for a while to get a 2.0SP1 feature). For small features this is perfectly reasonable but for something as large as transforming our ASTs into LINQ ASTs it seems better to just move to a newer version of .NET when appropriate. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Keith J. Farmer Sent: Monday, June 30, 2008 10:20 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython 1.1.2 eta? You can just not compile a hard dependency on System.Core, and instead import it manually. Basically, create a plug-in style architecture for dealing with it: Start: DLR Import: DLR + LINQ-for-DLR plugin (+ System.Core, required by plugin) So such a plugin would be importable, and then it could register itself as a service to handle specific points in processing. If no such service is loaded and registered, processing continues as normal (eg, .NET 2.0-level). -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Monday, June 30, 2008 9:40 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython 1.1.2 eta? The good news is this is basically inevitable but will take some time to achieve :). In the latest source code, I guess currently available only through the IronRuby SVN, you'll see that the namespaces of the DLR expression trees have moved to System.Linq.Expressions. This is the completion of making the DLR expression trees into a superset of the LINQ expression trees. Unfortunately both of your features require taking a dependency on .NET 3.5 (or some future version) which we're just not quite ready to do. But ultimately this should be trivial in the future - it's just not going to happen in 1.x and probably not 2.x. But the lambdas -> expression trees is probably a little easier as it's just add some new conversion support - C# 3.0 extension methods have scoping design issues. Anyway obviously this is something we care about too but it serves as a good excuse to mention some cool recent code changes :). -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Keith J. Farmer Sent: Monday, June 30, 2008 9:26 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython 1.1.2 eta? (Python lambdas to CLR Expression Trees.. my one wish aside from C#3-style extension method resolution) (but y'all knew that, anyway) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Monday, June 30, 2008 1:00 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython 1.1.2 eta? Yeah, it's not going to happen today :) The changes are done (any bugs assigned to me and the 1.1.2 release on CodePlex will be fixed), they just need to run through a full test pass. I got started on the changes late and the test infrastructure needed to be brought back to life so it's taking a little bit longer than expected but the RC should be out soon. Beta 4 is currently planned for early August. If you're willing to try out a source release from http://www.codeplex.com/IronPython/SourceControl/ListDownloadableCommits.aspx I'd be happy to let you know when the last remaining regression is fixed (and gets uploaded there - looks like that hasn't been happening :(). We've fixed the polymorphic call site perf bug already but there's still a bug that results in massive overhead of calling simple Python functions. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Monday, June 30, 2008 11:51 AM To: Discussion of IronPython Subject: [IronPython] IronPython 1.1.2 eta? Hello guys, A while back you suggested that IronPython 1.1.2 would arrive 'some time in June'. Whilst that is still possible it seems unlikely, any news on an eta? Whilst we're at it, any idea on when IP 2 Beta 4 might be released? We'd like to test Resolver One with an updated IronPython 2 where performance isn't borked quite so much... :-) Michael -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ _______________________________________________ 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 _______________________________________________ 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 dan.eloff at gmail.com Wed Jul 2 20:57:15 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Wed, 2 Jul 2008 13:57:15 -0500 Subject: [IronPython] Importing on another Thread In-Reply-To: <486BAF93.2090200@voidspace.org.uk> References: <4817b6fc0807012253v4988c6c1q6ccd3f1a61855bae@mail.gmail.com> <486B4F8F.3010002@voidspace.org.uk> <4817b6fc0807020939gd0c76b9of2663d50d401cc8f@mail.gmail.com> <486BAF93.2090200@voidspace.org.uk> Message-ID: <4817b6fc0807021157p7daed84bya30e7bea8da08e72@mail.gmail.com> > I mean why are you using '__import__'? > > Does your background importer code work when run on the main thread? Can you > show the actual failure message rather than just printing that they failed > to import? I was using __import__ because it was easier to write the repro with, I've changed it to import, it has the same issue. It works on the main thread (it's what I use on the main thread too) but the error message is useless. It's just ImportError, could not import x, and gives no stack trace. Possibly fiddling things to get a CLR stacktrace might be more useful. Anyway here's the full code. http://cid-1f5d68261f592b63.skydrive.live.com/self.aspx/Silverlight/parallel|_import.zip -Dan From liwei.peng at gmail.com Wed Jul 2 21:08:42 2008 From: liwei.peng at gmail.com (Liwei Peng) Date: Wed, 2 Jul 2008 12:08:42 -0700 Subject: [IronPython] 2.0 beta3: with statement: SystemError: Operation could destabilize the runtime. In-Reply-To: <7AD436E4270DD54A94238001769C2227012C93298C2B@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <7AD436E4270DD54A94238001769C2227012C93298C2B@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: I got StackOverflowException. no Snippets.dll is created in my working directory. d:\tools\IronPython-2.0B3>ipy.exe -X:ExceptionDetail -X:SaveAssemblies a.py Process is terminated due to StackOverflowException. d:\tools\IronPython-2.0B3>ipy.exe -X:SaveAssemblies a.py Process is terminated due to StackOverflowException. On Wed, Jul 2, 2008 at 11:36 AM, Dino Viehland wrote: > One more command line option ? can you run with ?X:SaveAssemblies? > You'll get a Snippets.dll written out to disk that you could send to us and > we can see why the code isn't verifiable (or you can run peverify on it and > report the verification errors). It looks like it could be a DLR code gen > bug. > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Liwei Peng > *Sent:* Wednesday, July 02, 2008 11:33 AM > *To:* Discussion of IronPython > *Subject:* Re: [IronPython] 2.0 beta3: with statement: SystemError: > Operation could destabilize the runtime. > > > > Thanks for the help. The following is what I got: > > > > d:\tools\IronPython-2.0B3>ipy.exe -X:ExceptionDetail a.py > Operation could destabilize the runtime. > at _stub_$36##33(Closure , CallSite , CodeContext , Object , Object ) > at _stub_MatchCaller(Object , CallSite , Object[] ) > at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] > args) > at > Microsoft.Scripting.Actions.UpdateDelegates.Update3[T,T0,T1,T2,TRet](CallSite > site > , T0 arg0, T1 arg1, T2 arg2) > at S$2.Initialize(CodeContext ) > at IronPython.Hosting.PythonCommandLine.RunFileWorker(String fileName) > at IronPython.Hosting.PythonCommandLine.RunFile(String fileName) > SystemError: Operation could destabilize the runtime. > > > Liwei > > On Wed, Jul 2, 2008 at 11:20 AM, Curt Hagenlocher > wrote: > > I'm sorry -- Dino's right, I should have said "-X:ExceptionDetail". Could > you run again with that? > > On Wed, Jul 2, 2008 at 10:36 AM, Liwei Peng wrote: > > Thanks for the help. The following are more details: > > > > > > 1) d:\tools\IronPython-2.0B3>ipy.exe -X:ShowClrExceptions a.py > > > Traceback (most recent call last): > File "a.py", line 17, in a.py > SystemError: Operation could destabilize the runtime. > > CLR Exception: > VerificationException > : > > > Operation could destabilize the runtime. > > 2) I didn't do anything at force IronPython to run as a 32-bit app or > 64-bit app. > > My OS is x64 W2K8 server. ipy.exe is a 32-bit binary. > > 3) MPI.net is built from CLR 2.0. > > > > thanks, > > > > Liwei > > > > On Wed, Jul 2, 2008 at 9:57 AM, Curt Hagenlocher > wrote: > > That exception isn't coming from IronPython -- not directly, anyway. Can > you re-run with the -X:ShowClrExceptions flag? > > > > Have you done anything to force IronPython to run as a 32-bit app or is it > running as a 64-bit app (ie natively)? Is MPI.NET built > against CLR 2.0? > > On Wed, Jul 2, 2008 at 9:49 AM, Liwei Peng wrote: > > Hi, > > > > I used IronPython 2.0 Beta3 using the with statement. I got the following > error: > > > > >ipy.exe a.py > > Traceback (most recent call last): > File "a.py", line 17, in a.py > SystemError: Operation could destabilize the runtime. > > > > What I did: > > 1) create a __future__.py file with 1 line: > > with_statement=True > > > > 2) run the following script. the error occured in the line "with > MPI.Environment(argarrayref) as mpienv:" > > from __future__ import with_statement > import sys > import clr > import System > > sys.path.append("C:\Program Files (x86)\MPI.NET \Lib") > clr.AddReferenceToFile("MPI.dll") > import MPI > > argarray = System.Array[str](sys.argv) > argarrayref = clr.Reference[ System.Array[str] ]( argarray ) > > with MPI.Environment(argarrayref) as mpienv: > n=100 > > Question: how can I fix it? thanks, > > > > Liwei > > > > _______________________________________________ > 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 -------------- An HTML attachment was scrubbed... URL: From Jimmy.Schementi at microsoft.com Wed Jul 2 22:34:07 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Wed, 2 Jul 2008 13:34:07 -0700 Subject: [IronPython] Importing on another Thread In-Reply-To: <4817b6fc0807012253v4988c6c1q6ccd3f1a61855bae@mail.gmail.com> References: <4817b6fc0807012253v4988c6c1q6ccd3f1a61855bae@mail.gmail.com> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A32845D43AA21A@NA-EXMSG-C116.redmond.corp.microsoft.com> Dan Eloff wrote: > I started the thread like so: > > t = Thread(ThreadStart(preload)) > t.Start() > > And I used __import__ to load the modules. Dan, reason this doesn't work is because the XAP API isn't threadsave, so we fail when trying to use it from a background thread. If you take a look at Microsoft.Scripting.Silverlight/BrowserScriptHost.cs, you're hitting the "if (!DynamicApplication.InUIThread) { return null; }" line in TryGetSourceFile. DynamicApplication.DownloadContents eventually calls Application.GetResourceStream, which will throw if on a background thread. It'd be interesting to see if that API is threadsave, since it isn't UI-bound. To be honest, it might be now ... I'll double check. Today, we spend a large time in the JIT, and the JIT runs on the same thread, so JITing on the UI thread will actually hang your browser. This is what you're trying to avoid, right? In that case, just warming up the DLR on a background thread might be good enough, so we should add that to Microsoft.Scripting.Silverlight.DynamicApplication. Anyway, I'll see if we can make "import" work on a background thread. ~Jimmy From miarme at microsoft.com Wed Jul 2 22:36:23 2008 From: miarme at microsoft.com (Michael Armes) Date: Wed, 2 Jul 2008 13:36:23 -0700 Subject: [IronPython] IronPython 2.0 Beta 3 issue importing from System.Environment Message-ID: <070B17B168154D46B9743BDA2B5BEEDF0FAED506FE@NA-EXMSG-C123.redmond.corp.microsoft.com> Hello, I've recently started using Beta 3 and discovered the following issue: Microsoft Windows [Version 6.0.6001] Copyright (c) 2006 Microsoft Corporation. All rights reserved. C:\Users\miarme>ipy IronPython 2.0 Beta (2.0.0.3000) on .NET 2.0.50727.1434 Copyright (c) Microsoft Corporation. All rights reserved. >>> from System.Environment import * Traceback (most recent call last): File "", line 1, in AttributeError: 'NestedTypeTracker' object has no attribute 'get_CommandLine' >>> from System.Environment import get_CommandLine Traceback (most recent call last): File "", line 1, in ImportError: Cannot import name get_CommandLine >>> Is this a known or expected issue? Thanks, Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jimmy.Schementi at microsoft.com Wed Jul 2 22:36:28 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Wed, 2 Jul 2008 13:36:28 -0700 Subject: [IronPython] Importing on another Thread In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A32845D43AA21A@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <4817b6fc0807012253v4988c6c1q6ccd3f1a61855bae@mail.gmail.com> <5283CA0A4168DF4FBBD71AE9ECA5A32845D43AA21A@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A32845D43AA21C@NA-EXMSG-C116.redmond.corp.microsoft.com> > DynamicApplication.DownloadContents eventually > calls Application.GetResourceStream, which will throw if on a > background thread. Note: DownloadContents is actually a misleading name, since it doesn't download anything; it just looks in the XAP for them. Those "Download" methods on DynamicApplication will be renamed in the future. ~Jimmy From Jimmy.Schementi at microsoft.com Wed Jul 2 23:23:02 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Wed, 2 Jul 2008 14:23:02 -0700 Subject: [IronPython] StaticResources + DLR + Silverlight In-Reply-To: <4817b6fc0807010632j2309472u5778dc38389c345@mail.gmail.com> References: <4817b6fc0805050643g61cf500fy91c17510b5661c6a@mail.gmail.com> <5283CA0A4168DF4FBBD71AE9ECA5A32845D42AE215@NA-EXMSG-C116.redmond.corp.microsoft.com> <4817b6fc0807010632j2309472u5778dc38389c345@mail.gmail.com> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A32845D44452C1@NA-EXMSG-C116.redmond.corp.microsoft.com> Dan Eloff wrote: > I was reading your blog and it turns out you and I are the same age. Go > figure. Great to see a youngin' around here =) > I tried this out, and it works great. There's one major problem with > it though. It doesn't work with templating. LoadComponent has no > overload that accepts a xaml string (or loaded application object). > The current workaround I'd have to use is to evaluate the template, > upload the generated xaml to the server, get a dynamic uri back, and > load the xaml back down with LoadComponent. Very nasty. Painful indeed! Does XamlReader.Load work for Resources? Are you specifically templating the Resources? If not, you could use LoadComponent for those, and then XamlReader.Load to load "normal" XAML. Anyway, if you could give me a repro of what you're trying to do I could answer these questions for you. =) Also, I'm assuming your doing the templating on the client for a reason ... =) > Please, please > push to get an lower-level overload of LoadComponent that takes xaml > instead of a Uri (probably there already is such a beast, it's just > not public.) Looking at System.Windows.dll with Reflector, Application.LoadComponent calls MS.Internal.XcpImports.Application_LoadComponentNative(IntPtr pContext, IntPtr pComponent, uint cUriStringLength, string uriString, uint cXamlStrLength, byte* pXamlStr), so yeah, there could be a wrapper. If XamlReader.Load doesn't work for this, I'll ask around. > Thanks, > -Dan ~Jimmy > On Wed, Jun 25, 2008 at 7:55 PM, Jimmy Schementi > wrote: > > > > Using a dynamic language in Silverlight is no different than in C#/VB > wrt StaticResources; you can have a app.xaml file which looks like > this: > > > > xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" > > xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" > > > x:Class="Microsoft.Scripting.Silverlight.DynamicApplication" > > > > > > > > > > > > > > > And load it in app.py like this: > > > > Application.LoadComponent(Application.current, Uri("app.xaml", > UriKind.Relative)) > > > > I omit this "StaticResource XAML file" from our templates since I > figured they'd only add confusion, but do you think this should be in > there regardless? > > > > ~Jimmy > > > >> -----Original Message----- > >> From: users-bounces at lists.ironpython.com [mailto:users- > >> bounces at lists.ironpython.com] On Behalf Of Dan Eloff > >> Sent: Monday, May 05, 2008 6:44 AM > >> To: Discussion of IronPython > >> Subject: [IronPython] StaticResources + DLR + Silverlight > >> > >> I notice if you use C#/VB, you have in your main xaml > >> file. In there you can place resources that can be used from > anywhere > >> in your other xaml files. Using the {StaticResource foo} markup > >> extension. > >> > >> If you are using a dynamic language, there is no > > >> equivalent (please correct me if I'm wrong), most examples I've seen > >> use . > >> > >> The trouble is placing your resources in > makes > >> them off limit to {StaticResource foo} in any other xaml files > (again > >> please correct me if I'm wrong) > >> > >> So I find myself in a nightmare of duplicating resources across > files > >> and setting styles in code from > >> Application.Current.RootVisual.Resources['foo'], neither of which is > >> pleasant. Are there really no better alternatives? > >> > >> -Dan > >> _______________________________________________ > >> 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 dfugate at microsoft.com Thu Jul 3 01:00:52 2008 From: dfugate at microsoft.com (Dave Fugate) Date: Wed, 2 Jul 2008 16:00:52 -0700 Subject: [IronPython] IronPython 2.0 Beta 3 issue importing from System.Environment In-Reply-To: <070B17B168154D46B9743BDA2B5BEEDF0FAED506FE@NA-EXMSG-C123.redmond.corp.microsoft.com> References: <070B17B168154D46B9743BDA2B5BEEDF0FAED506FE@NA-EXMSG-C123.redmond.corp.microsoft.com> Message-ID: This is most definitely a bug (should be able to import static variables from .NET types) and thanks for spotting this Michael! Filed as CodePlex 17236. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Armes Sent: Wednesday, July 02, 2008 1:36 PM To: users at lists.ironpython.com Subject: [IronPython] IronPython 2.0 Beta 3 issue importing from System.Environment Hello, I've recently started using Beta 3 and discovered the following issue: Microsoft Windows [Version 6.0.6001] Copyright (c) 2006 Microsoft Corporation. All rights reserved. C:\Users\miarme>ipy IronPython 2.0 Beta (2.0.0.3000) on .NET 2.0.50727.1434 Copyright (c) Microsoft Corporation. All rights reserved. >>> from System.Environment import * Traceback (most recent call last): File "", line 1, in AttributeError: 'NestedTypeTracker' object has no attribute 'get_CommandLine' >>> from System.Environment import get_CommandLine Traceback (most recent call last): File "", line 1, in ImportError: Cannot import name get_CommandLine >>> Is this a known or expected issue? Thanks, Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: From curt at hagenlocher.org Thu Jul 3 01:04:26 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Wed, 2 Jul 2008 16:04:26 -0700 Subject: [IronPython] 2.0 beta3: with statement: SystemError: Operation could destabilize the runtime. In-Reply-To: References: <7AD436E4270DD54A94238001769C2227012C93298C2B@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: I can reproduce this problem in 2.0 beta 3, but not in the current sources. This means that the problem should be resolved in beta 4 -- or in the next source drop to CodePlex, assuming there is one before the next beta. The bad news is that I can't suggest any workaround for beta 3. On Wed, Jul 2, 2008 at 12:08 PM, Liwei Peng wrote: > I got StackOverflowException. no Snippets.dll is created in my working > directory. > > d:\tools\IronPython-2.0B3>ipy.exe -X:ExceptionDetail -X:SaveAssemblies a.py > > Process is terminated due to StackOverflowException. > > d:\tools\IronPython-2.0B3>ipy.exe -X:SaveAssemblies a.py > Process is terminated due to StackOverflowException. > > > On Wed, Jul 2, 2008 at 11:36 AM, Dino Viehland < > dinov at exchange.microsoft.com> wrote: > >> One more command line option ? can you run with ?X:SaveAssemblies? >> You'll get a Snippets.dll written out to disk that you could send to us and >> we can see why the code isn't verifiable (or you can run peverify on it and >> report the verification errors). It looks like it could be a DLR code gen >> bug. >> >> >> >> *From:* users-bounces at lists.ironpython.com [mailto: >> users-bounces at lists.ironpython.com] *On Behalf Of *Liwei Peng >> *Sent:* Wednesday, July 02, 2008 11:33 AM >> *To:* Discussion of IronPython >> *Subject:* Re: [IronPython] 2.0 beta3: with statement: SystemError: >> Operation could destabilize the runtime. >> >> >> >> Thanks for the help. The following is what I got: >> >> >> >> d:\tools\IronPython-2.0B3>ipy.exe -X:ExceptionDetail a.py >> Operation could destabilize the runtime. >> at _stub_$36##33(Closure , CallSite , CodeContext , Object , Object ) >> at _stub_MatchCaller(Object , CallSite , Object[] ) >> at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] >> args) >> at >> Microsoft.Scripting.Actions.UpdateDelegates.Update3[T,T0,T1,T2,TRet](CallSite >> site >> , T0 arg0, T1 arg1, T2 arg2) >> at S$2.Initialize(CodeContext ) >> at IronPython.Hosting.PythonCommandLine.RunFileWorker(String fileName) >> at IronPython.Hosting.PythonCommandLine.RunFile(String fileName) >> SystemError: Operation could destabilize the runtime. >> >> >> Liwei >> >> On Wed, Jul 2, 2008 at 11:20 AM, Curt Hagenlocher >> wrote: >> >> I'm sorry -- Dino's right, I should have said "-X:ExceptionDetail". Could >> you run again with that? >> >> On Wed, Jul 2, 2008 at 10:36 AM, Liwei Peng wrote: >> >> Thanks for the help. The following are more details: >> >> >> >> >> >> 1) d:\tools\IronPython-2.0B3>ipy.exe -X:ShowClrExceptions a.py >> >> >> Traceback (most recent call last): >> File "a.py", line 17, in a.py >> SystemError: Operation could destabilize the runtime. >> >> CLR Exception: >> VerificationException >> : >> >> >> Operation could destabilize the runtime. >> >> 2) I didn't do anything at force IronPython to run as a 32-bit app or >> 64-bit app. >> >> My OS is x64 W2K8 server. ipy.exe is a 32-bit binary. >> >> 3) MPI.net is built from CLR 2.0. >> >> >> >> thanks, >> >> >> >> Liwei >> >> >> >> On Wed, Jul 2, 2008 at 9:57 AM, Curt Hagenlocher >> wrote: >> >> That exception isn't coming from IronPython -- not directly, anyway. Can >> you re-run with the -X:ShowClrExceptions flag? >> >> >> >> Have you done anything to force IronPython to run as a 32-bit app or is it >> running as a 64-bit app (ie natively)? Is MPI.NET built against CLR 2.0? >> >> On Wed, Jul 2, 2008 at 9:49 AM, Liwei Peng wrote: >> >> Hi, >> >> >> >> I used IronPython 2.0 Beta3 using the with statement. I got the following >> error: >> >> >> >> >ipy.exe a.py >> >> Traceback (most recent call last): >> File "a.py", line 17, in a.py >> SystemError: Operation could destabilize the runtime. >> >> >> >> What I did: >> >> 1) create a __future__.py file with 1 line: >> >> with_statement=True >> >> >> >> 2) run the following script. the error occured in the line "with >> MPI.Environment(argarrayref) as mpienv:" >> >> from __future__ import with_statement >> import sys >> import clr >> import System >> >> sys.path.append("C:\Program Files (x86)\MPI.NET \Lib") >> clr.AddReferenceToFile("MPI.dll") >> import MPI >> >> argarray = System.Array[str](sys.argv) >> argarrayref = clr.Reference[ System.Array[str] ]( argarray ) >> >> with MPI.Environment(argarrayref) as mpienv: >> n=100 >> >> Question: how can I fix it? thanks, >> >> >> >> Liwei >> >> >> >> _______________________________________________ >> 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 >> >> > > _______________________________________________ > 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 liwei.peng at gmail.com Thu Jul 3 03:14:15 2008 From: liwei.peng at gmail.com (Liwei Peng) Date: Wed, 2 Jul 2008 18:14:15 -0700 Subject: [IronPython] 2.0 beta3: with statement: SystemError: Operation could destabilize the runtime. In-Reply-To: References: <7AD436E4270DD54A94238001769C2227012C93298C2B@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: Thanks. Can you tell me what's the Beta4 schedule? liwei On Wed, Jul 2, 2008 at 4:04 PM, Curt Hagenlocher wrote: > I can reproduce this problem in 2.0 beta 3, but not in the current > sources. This means that the problem should be resolved in beta 4 -- or in > the next source drop to CodePlex, assuming there is one before the next > beta. > > The bad news is that I can't suggest any workaround for beta 3. > > On Wed, Jul 2, 2008 at 12:08 PM, Liwei Peng > wrote: > >> I got StackOverflowException. no Snippets.dll is created in my working >> directory. >> >> d:\tools\IronPython-2.0B3>ipy.exe -X:ExceptionDetail -X:SaveAssemblies >> a.py >> >> Process is terminated due to StackOverflowException. >> >> d:\tools\IronPython-2.0B3>ipy.exe -X:SaveAssemblies a.py >> Process is terminated due to StackOverflowException. >> >> >> On Wed, Jul 2, 2008 at 11:36 AM, Dino Viehland < >> dinov at exchange.microsoft.com> wrote: >> >>> One more command line option ? can you run with ?X:SaveAssemblies? >>> You'll get a Snippets.dll written out to disk that you could send to us and >>> we can see why the code isn't verifiable (or you can run peverify on it and >>> report the verification errors). It looks like it could be a DLR code gen >>> bug. >>> >>> >>> >>> *From:* users-bounces at lists.ironpython.com [mailto: >>> users-bounces at lists.ironpython.com] *On Behalf Of *Liwei Peng >>> *Sent:* Wednesday, July 02, 2008 11:33 AM >>> *To:* Discussion of IronPython >>> *Subject:* Re: [IronPython] 2.0 beta3: with statement: SystemError: >>> Operation could destabilize the runtime. >>> >>> >>> >>> Thanks for the help. The following is what I got: >>> >>> >>> >>> d:\tools\IronPython-2.0B3>ipy.exe -X:ExceptionDetail a.py >>> Operation could destabilize the runtime. >>> at _stub_$36##33(Closure , CallSite , CodeContext , Object , Object ) >>> at _stub_MatchCaller(Object , CallSite , Object[] ) >>> at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] >>> args) >>> at >>> Microsoft.Scripting.Actions.UpdateDelegates.Update3[T,T0,T1,T2,TRet](CallSite >>> site >>> , T0 arg0, T1 arg1, T2 arg2) >>> at S$2.Initialize(CodeContext ) >>> at IronPython.Hosting.PythonCommandLine.RunFileWorker(String fileName) >>> at IronPython.Hosting.PythonCommandLine.RunFile(String fileName) >>> SystemError: Operation could destabilize the runtime. >>> >>> >>> Liwei >>> >>> On Wed, Jul 2, 2008 at 11:20 AM, Curt Hagenlocher >>> wrote: >>> >>> I'm sorry -- Dino's right, I should have said "-X:ExceptionDetail". >>> Could you run again with that? >>> >>> On Wed, Jul 2, 2008 at 10:36 AM, Liwei Peng >>> wrote: >>> >>> Thanks for the help. The following are more details: >>> >>> >>> >>> >>> >>> 1) d:\tools\IronPython-2.0B3>ipy.exe -X:ShowClrExceptions a.py >>> >>> >>> Traceback (most recent call last): >>> File "a.py", line 17, in a.py >>> SystemError: Operation could destabilize the runtime. >>> >>> CLR Exception: >>> VerificationException >>> : >>> >>> >>> Operation could destabilize the runtime. >>> >>> 2) I didn't do anything at force IronPython to run as a 32-bit app or >>> 64-bit app. >>> >>> My OS is x64 W2K8 server. ipy.exe is a 32-bit binary. >>> >>> 3) MPI.net is built from CLR 2.0. >>> >>> >>> >>> thanks, >>> >>> >>> >>> Liwei >>> >>> >>> >>> On Wed, Jul 2, 2008 at 9:57 AM, Curt Hagenlocher >>> wrote: >>> >>> That exception isn't coming from IronPython -- not directly, anyway. Can >>> you re-run with the -X:ShowClrExceptions flag? >>> >>> >>> >>> Have you done anything to force IronPython to run as a 32-bit app or is >>> it running as a 64-bit app (ie natively)? Is MPI.NET built against CLR 2.0? >>> >>> On Wed, Jul 2, 2008 at 9:49 AM, Liwei Peng wrote: >>> >>> Hi, >>> >>> >>> >>> I used IronPython 2.0 Beta3 using the with statement. I got the following >>> error: >>> >>> >>> >>> >ipy.exe a.py >>> >>> Traceback (most recent call last): >>> File "a.py", line 17, in a.py >>> SystemError: Operation could destabilize the runtime. >>> >>> >>> >>> What I did: >>> >>> 1) create a __future__.py file with 1 line: >>> >>> with_statement=True >>> >>> >>> >>> 2) run the following script. the error occured in the line "with >>> MPI.Environment(argarrayref) as mpienv:" >>> >>> from __future__ import with_statement >>> import sys >>> import clr >>> import System >>> >>> sys.path.append("C:\Program Files (x86)\MPI.NET \Lib") >>> clr.AddReferenceToFile("MPI.dll") >>> import MPI >>> >>> argarray = System.Array[str](sys.argv) >>> argarrayref = clr.Reference[ System.Array[str] ]( argarray ) >>> >>> with MPI.Environment(argarrayref) as mpienv: >>> n=100 >>> >>> Question: how can I fix it? thanks, >>> >>> >>> >>> Liwei >>> >>> >>> >>> _______________________________________________ >>> 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 >>> >>> >> >> _______________________________________________ >> 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 falcon at uwyo.edu Thu Jul 3 04:17:55 2008 From: falcon at uwyo.edu (Michael Stephens) Date: Wed, 2 Jul 2008 20:17:55 -0600 Subject: [IronPython] Python Generation In-Reply-To: <7AD436E4270DD54A94238001769C2227012C932988CD@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <7AD436E4270DD54A94238001769C2227012C932988CD@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: Is this a feature that will be still available in 2.0? Michael Stephens Electrical Engineering Graduate Student University of Wyoming falcon at uwyo.edu or 89iroc at gmail.com On Mon, Jun 30, 2008 at 7:33 PM, Dino Viehland wrote: > You could take a look at IronPython 1.x's CodeDom support in > IronPython.CodeDom.Provider. From there you can get the generator and throw > CodeDom trees at it. It can generate a bunch of ugliness to support > WinForms but by default it doesn't do that. Unfortunately it hasn't been > updated to 2.0 but of course the source is available J > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Michael Stephens > *Sent:* Monday, June 30, 2008 6:14 PM > *To:* Discussion of IronPython > *Subject:* [IronPython] Python Generation > > > > I am writing a macro->python translation utility for our system. I thought > I struck it rich when i found IronPython.Compiler.Ast . But there doesn't > seem to be a good way to take these things and generate python code > (strings). If anyone knows any spiffy libraries out there to do this that > would be awesome too. > > Michael Stephens > > Electrical Engineering Graduate Student > University of Wyoming > falcon at uwyo.edu or 89iroc at gmail.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 89iroc at gmail.com Thu Jul 3 04:19:51 2008 From: 89iroc at gmail.com (Michael Stephens) Date: Wed, 2 Jul 2008 20:19:51 -0600 Subject: [IronPython] IronPython Studio debugging Message-ID: I have been able to use the PythonEngine against Pythonstudio and acutally get breakpoints working. Check out my blog for details! http://tech-michael.blogspot.com/2008/07/i-was-charged-by-company-i-work-for-to.html Michael Stephens Electrical Engineering Graduate Student University of Wyoming falcon at uwyo.edu or 89iroc at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From curt at hagenlocher.org Thu Jul 3 06:09:36 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Wed, 2 Jul 2008 21:09:36 -0700 Subject: [IronPython] 2.0 beta3: with statement: SystemError: Operation could destabilize the runtime. In-Reply-To: References: <7AD436E4270DD54A94238001769C2227012C93298C2B@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: I think we're expecting to release Beta 4 in about a month, but there's some chance we'll have an intermediate source drop before then. On Wed, Jul 2, 2008 at 6:14 PM, Liwei Peng wrote: > Thanks. > > Can you tell me what's the Beta4 schedule? > > liwei > > On Wed, Jul 2, 2008 at 4:04 PM, Curt Hagenlocher > wrote: > >> I can reproduce this problem in 2.0 beta 3, but not in the current >> sources. This means that the problem should be resolved in beta 4 -- or in >> the next source drop to CodePlex, assuming there is one before the next >> beta. >> >> The bad news is that I can't suggest any workaround for beta 3. >> >> On Wed, Jul 2, 2008 at 12:08 PM, Liwei Peng >> wrote: >> >>> I got StackOverflowException. no Snippets.dll is created in my working >>> directory. >>> >>> d:\tools\IronPython-2.0B3>ipy.exe -X:ExceptionDetail -X:SaveAssemblies >>> a.py >>> >>> Process is terminated due to StackOverflowException. >>> >>> d:\tools\IronPython-2.0B3>ipy.exe -X:SaveAssemblies a.py >>> Process is terminated due to StackOverflowException. >>> >>> >>> On Wed, Jul 2, 2008 at 11:36 AM, Dino Viehland < >>> dinov at exchange.microsoft.com> wrote: >>> >>>> One more command line option ? can you run with ?X:SaveAssemblies? >>>> You'll get a Snippets.dll written out to disk that you could send to us and >>>> we can see why the code isn't verifiable (or you can run peverify on it and >>>> report the verification errors). It looks like it could be a DLR code gen >>>> bug. >>>> >>>> >>>> >>>> *From:* users-bounces at lists.ironpython.com [mailto: >>>> users-bounces at lists.ironpython.com] *On Behalf Of *Liwei Peng >>>> *Sent:* Wednesday, July 02, 2008 11:33 AM >>>> *To:* Discussion of IronPython >>>> *Subject:* Re: [IronPython] 2.0 beta3: with statement: SystemError: >>>> Operation could destabilize the runtime. >>>> >>>> >>>> >>>> Thanks for the help. The following is what I got: >>>> >>>> >>>> >>>> d:\tools\IronPython-2.0B3>ipy.exe -X:ExceptionDetail a.py >>>> Operation could destabilize the runtime. >>>> at _stub_$36##33(Closure , CallSite , CodeContext , Object , Object ) >>>> at _stub_MatchCaller(Object , CallSite , Object[] ) >>>> at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] >>>> args) >>>> at >>>> Microsoft.Scripting.Actions.UpdateDelegates.Update3[T,T0,T1,T2,TRet](CallSite >>>> site >>>> , T0 arg0, T1 arg1, T2 arg2) >>>> at S$2.Initialize(CodeContext ) >>>> at IronPython.Hosting.PythonCommandLine.RunFileWorker(String >>>> fileName) >>>> at IronPython.Hosting.PythonCommandLine.RunFile(String fileName) >>>> SystemError: Operation could destabilize the runtime. >>>> >>>> >>>> Liwei >>>> >>>> On Wed, Jul 2, 2008 at 11:20 AM, Curt Hagenlocher >>>> wrote: >>>> >>>> I'm sorry -- Dino's right, I should have said "-X:ExceptionDetail". >>>> Could you run again with that? >>>> >>>> On Wed, Jul 2, 2008 at 10:36 AM, Liwei Peng >>>> wrote: >>>> >>>> Thanks for the help. The following are more details: >>>> >>>> >>>> >>>> >>>> >>>> 1) d:\tools\IronPython-2.0B3>ipy.exe -X:ShowClrExceptions a.py >>>> >>>> >>>> Traceback (most recent call last): >>>> File "a.py", line 17, in a.py >>>> SystemError: Operation could destabilize the runtime. >>>> >>>> CLR Exception: >>>> VerificationException >>>> : >>>> >>>> >>>> Operation could destabilize the runtime. >>>> >>>> 2) I didn't do anything at force IronPython to run as a 32-bit app or >>>> 64-bit app. >>>> >>>> My OS is x64 W2K8 server. ipy.exe is a 32-bit binary. >>>> >>>> 3) MPI.net is built from CLR 2.0. >>>> >>>> >>>> >>>> thanks, >>>> >>>> >>>> >>>> Liwei >>>> >>>> >>>> >>>> On Wed, Jul 2, 2008 at 9:57 AM, Curt Hagenlocher >>>> wrote: >>>> >>>> That exception isn't coming from IronPython -- not directly, anyway. >>>> Can you re-run with the -X:ShowClrExceptions flag? >>>> >>>> >>>> >>>> Have you done anything to force IronPython to run as a 32-bit app or is >>>> it running as a 64-bit app (ie natively)? Is MPI.NET built against CLR 2.0? >>>> >>>> On Wed, Jul 2, 2008 at 9:49 AM, Liwei Peng >>>> wrote: >>>> >>>> Hi, >>>> >>>> >>>> >>>> I used IronPython 2.0 Beta3 using the with statement. I got the >>>> following error: >>>> >>>> >>>> >>>> >ipy.exe a.py >>>> >>>> Traceback (most recent call last): >>>> File "a.py", line 17, in a.py >>>> SystemError: Operation could destabilize the runtime. >>>> >>>> >>>> >>>> What I did: >>>> >>>> 1) create a __future__.py file with 1 line: >>>> >>>> with_statement=True >>>> >>>> >>>> >>>> 2) run the following script. the error occured in the line "with >>>> MPI.Environment(argarrayref) as mpienv:" >>>> >>>> from __future__ import with_statement >>>> import sys >>>> import clr >>>> import System >>>> >>>> sys.path.append("C:\Program Files (x86)\MPI.NET \Lib") >>>> clr.AddReferenceToFile("MPI.dll") >>>> import MPI >>>> >>>> argarray = System.Array[str](sys.argv) >>>> argarrayref = clr.Reference[ System.Array[str] ]( argarray ) >>>> >>>> with MPI.Environment(argarrayref) as mpienv: >>>> n=100 >>>> >>>> Question: how can I fix it? thanks, >>>> >>>> >>>> >>>> Liwei >>>> >>>> >>>> >>>> _______________________________________________ >>>> 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 >>>> >>>> >>> >>> _______________________________________________ >>> 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 dan.eloff at gmail.com Thu Jul 3 08:02:45 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Thu, 3 Jul 2008 01:02:45 -0500 Subject: [IronPython] StaticResources + DLR + Silverlight In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A32845D44452C1@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <4817b6fc0805050643g61cf500fy91c17510b5661c6a@mail.gmail.com> <5283CA0A4168DF4FBBD71AE9ECA5A32845D42AE215@NA-EXMSG-C116.redmond.corp.microsoft.com> <4817b6fc0807010632j2309472u5778dc38389c345@mail.gmail.com> <5283CA0A4168DF4FBBD71AE9ECA5A32845D44452C1@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <4817b6fc0807022302o568d371dq9e222ee090454a43@mail.gmail.com> On Wed, Jul 2, 2008 at 4:23 PM, Jimmy Schementi wrote: > > Painful indeed! Does XamlReader.Load work for Resources? Are you specifically templating the Resources? If not, you could use LoadComponent for those, and then XamlReader.Load to load "normal" XAML. Actually this is the temporary workaround I'm using now for development, but it won't work in production. > Anyway, if you could give me a repro of what you're trying to do I could answer these questions for you. =) Part of the reason I use templates is because it makes the xaml simpler, I shed about 25% of the xaml that was just repetition. It makes it much easier to maintain, especially because I edit it by hand. With templates I eliminate duplication and I only have to change things in one place. That part would hurt, but I can live without it. But the other reason I use templates is because I don't have all the information when I'm writing the xaml file. Many of the urls I use are only known at runtime and cannot be part of the xaml file. There is no easy workaround for this. > Also, I'm assuming your doing the templating on the client for a reason ... =) I have 0 xaml files, everything is templates that generate xaml. I just find it easier to create the UI and populate it with data that way. It's like with web frameworks. Sure you could use plain html and script generated markup, but it's a mess and your UI logic gets all mixed up in your backend code. It's much better if you can use a templating language like in django, pylons, or rails to keep your display logic separate from the backend code. The same is true in Silverlight, xaml is just markup like html. -Dan From dan.eloff at gmail.com Thu Jul 3 08:07:58 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Thu, 3 Jul 2008 01:07:58 -0500 Subject: [IronPython] Importing on another Thread In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A32845D43AA21A@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <4817b6fc0807012253v4988c6c1q6ccd3f1a61855bae@mail.gmail.com> <5283CA0A4168DF4FBBD71AE9ECA5A32845D43AA21A@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <4817b6fc0807022307u15460a2an8296c137598bc5d7@mail.gmail.com> On Wed, Jul 2, 2008 at 3:34 PM, Jimmy Schementi wrote: > Dan Eloff wrote: >> I started the thread like so: >> >> t = Thread(ThreadStart(preload)) >> t.Start() >> >> And I used __import__ to load the modules. > > Dan, reason this doesn't work is because the XAP API isn't threadsave, so we fail when trying to use it from a background thread. If you take a look at Microsoft.Scripting.Silverlight/BrowserScriptHost.cs, you're hitting the "if (!DynamicApplication.InUIThread) { return null; }" line in TryGetSourceFile. DynamicApplication.DownloadContents eventually calls Application.GetResourceStream, which will throw if on a background thread. Aha. I was wondering if Application.GetResourceStream might be the problem. > It'd be interesting to see if that API is threadsave, since it isn't UI-bound. To be honest, it might be now ... I'll double check. > > Today, we spend a large time in the JIT, and the JIT runs on the same thread, so JITing on the UI thread will actually hang your browser. This is what you're trying to avoid, right? In that case, just warming up the DLR on a background thread might be good enough, so we should add that to Microsoft.Scripting.Silverlight.DynamicApplication. > > Anyway, I'll see if we can make "import" work on a background thread. > Thank you, that would be great. It kind of goes against the language not to be able to import in a background thread. -Dan From fuzzyman at voidspace.org.uk Thu Jul 3 11:58:17 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 03 Jul 2008 10:58:17 +0100 Subject: [IronPython] IronPython 1.1.2 eta? In-Reply-To: <50B69702CA6E6D4E849D30CD4989AB8EE90FD69DD4@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <48692AFD.4040605@voidspace.org.uk><7AD436E4270DD54A94238001769C2227012C93298788@DF-GRTDANE-MSG.exchange.corp.microsoft.com><7AD436E4270DD54A94238001769C2227012C932988EE@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <7AD436E4270DD54A94238001769C2227012C93298916@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <50B69702CA6E6D4E849D30CD4989AB8EE90FD69DD4@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <486CA2B9.9080403@voidspace.org.uk> Shri Borde wrote: >> Not being able to build with VS 2005 will be a pain as installing VS >> 2008 breaks our build environment (last time we tried anyway). I can probably build it >> at home though. :-) >> > > I don't think you actually need VS2008. If you have .NET 3.5 on the machine, it will have the same version of msbuild as VS 2008, and msbuild is all you will need to build from the sln/csproj files. > > Ah... cool. I hadn't thought of that. Thanks Michael > Thanks, > Shri > > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Keith J. Farmer > Sent: Tuesday, July 01, 2008 7:11 PM > To: Discussion of IronPython; Discussion of IronPython > Subject: Re: [IronPython] IronPython 1.1.2 eta? > > That's basically what I said. > > ________________________________ > > From: users-bounces at lists.ironpython.com on behalf of Dino Viehland > Sent: Tue 7/1/2008 8:11 AM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython 1.1.2 eta? > > > > Or we could use reflection to access the members we need (we've been doing that for a while to get a 2.0SP1 feature). For small features this is perfectly reasonable but for something as large as transforming our ASTs into LINQ ASTs it seems better to just move to a newer version of .NET when appropriate. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Keith J. Farmer > Sent: Monday, June 30, 2008 10:20 PM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython 1.1.2 eta? > > You can just not compile a hard dependency on System.Core, and instead import it manually. Basically, create a plug-in style architecture for dealing with it: > > Start: DLR > Import: DLR + LINQ-for-DLR plugin (+ System.Core, required by plugin) > > So such a plugin would be importable, and then it could register itself as a service to handle specific points in processing. If no such service is loaded and registered, processing continues as normal (eg, .NET 2.0-level). > > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland > Sent: Monday, June 30, 2008 9:40 PM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython 1.1.2 eta? > > The good news is this is basically inevitable but will take some time to achieve :). In the latest source code, I guess currently available only through the IronRuby SVN, you'll see that the namespaces of the DLR expression trees have moved to System.Linq.Expressions. This is the completion of making the DLR expression trees into a superset of the LINQ expression trees. > > Unfortunately both of your features require taking a dependency on .NET 3.5 (or some future version) which we're just not quite ready to do. But ultimately this should be trivial in the future - it's just not going to happen in 1.x and probably not 2.x. But the lambdas -> expression trees is probably a little easier as it's just add some new conversion support - C# 3.0 extension methods have scoping design issues. > > Anyway obviously this is something we care about too but it serves as a good excuse to mention some cool recent code changes :). > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Keith J. Farmer > Sent: Monday, June 30, 2008 9:26 PM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython 1.1.2 eta? > > (Python lambdas to CLR Expression Trees.. my one wish aside from C#3-style extension method resolution) > > (but y'all knew that, anyway) > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland > Sent: Monday, June 30, 2008 1:00 PM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython 1.1.2 eta? > > Yeah, it's not going to happen today :) The changes are done (any bugs assigned to me and the 1.1.2 release on CodePlex will be fixed), they just need to run through a full test pass. I got started on the changes late and the test infrastructure needed to be brought back to life so it's taking a little bit longer than expected but the RC should be out soon. > > Beta 4 is currently planned for early August. If you're willing to try out a source release from http://www.codeplex.com/IronPython/SourceControl/ListDownloadableCommits.aspx I'd be happy to let you know when the last remaining regression is fixed (and gets uploaded there - looks like that hasn't been happening :(). We've fixed the polymorphic call site perf bug already but there's still a bug that results in massive overhead of calling simple Python functions. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Monday, June 30, 2008 11:51 AM > To: Discussion of IronPython > Subject: [IronPython] IronPython 1.1.2 eta? > > Hello guys, > > A while back you suggested that IronPython 1.1.2 would arrive 'some time > in June'. Whilst that is still possible it seems unlikely, any news on > an eta? > > Whilst we're at it, any idea on when IP 2 Beta 4 might be released? We'd > like to test Resolver One with an updated IronPython 2 where performance > isn't borked quite so much... :-) > > Michael > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.resolverhacks.net/ http://www.theotherdelia.co.uk/ From barrycarr at ixian-software.com Thu Jul 3 16:34:12 2008 From: barrycarr at ixian-software.com (Barry Carr) Date: Thu, 03 Jul 2008 15:34:12 +0100 Subject: [IronPython] Returning an object from a script Message-ID: <486CE364.1080303@ixian-software.com> Hi, Using IP2B3 (on .NET 2,0), is it possible to get a IronPython script to create an object and return it or pass it back to the host application to be used later? I tried what I thought was the obvious route but got a null reference exception when I tried to use the returned object (the code is Oxygene - an Object Pascal variant): class method ConsoleApp.Main; begin PrepPython; var script := pe.CreateScriptSourceFromFile( ".\\PythonHostingTest.py" ); var scope := env.CreateScope; var obj : Object := nil; scope.SetVariable("instance", obj ); script.Execute(scope); IMigration(obj).Up; // <-- Null ref exception here Console.WriteLine('Hello World.'); end; class method ConsoleApp.PrepPython; begin env := ScriptRuntime.Create; env.LoadAssembly( typeOf(String).Assembly ); env.LoadAssembly( typeOf(Debug).Assembly ); env.LoadAssembly( typeOf(IMigration).Assembly ); pe := env.GetEngine("py"); end; And here is my IronPython Script: import System from GeoMEM.NETandCF.Migrations import * class Hello(IMigration): def __init__( self, msg = "A BIIIG Hello From Python" ): self.msg = msg def Up(self): print self.msg def Down(self): print "Down" instance = Hello() Am I close or barking up the wrong tree? Thanks. Cheers Barry Carr From curt at hagenlocher.org Thu Jul 3 17:31:27 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Thu, 3 Jul 2008 08:31:27 -0700 Subject: [IronPython] Returning an object from a script In-Reply-To: <486CE364.1080303@ixian-software.com> References: <486CE364.1080303@ixian-software.com> Message-ID: You never actually assign a value to "obj". SetVariable doesn't create a linkage between your local variable and the script-defined one. You have to explicitly fetch out the value of "instance" by using something like IMigration instance = scope.GetVariable("instance"). On Thu, Jul 3, 2008 at 7:34 AM, Barry Carr wrote: > Hi, > > Using IP2B3 (on .NET 2,0), is it possible to get a IronPython script to > create an object and return it or pass it back to the host application to be > used later? > > I tried what I thought was the obvious route but got a null reference > exception when I tried to use the returned object (the code is Oxygene - an > Object Pascal variant): > > class method ConsoleApp.Main; > begin > PrepPython; > > var script := pe.CreateScriptSourceFromFile( ".\\PythonHostingTest.py" ); > var scope := env.CreateScope; > var obj : Object := nil; > scope.SetVariable("instance", obj ); > script.Execute(scope); > IMigration(obj).Up; // <-- Null ref exception here > Console.WriteLine('Hello World.'); > end; > > class method ConsoleApp.PrepPython; > begin > env := ScriptRuntime.Create; > env.LoadAssembly( typeOf(String).Assembly ); > env.LoadAssembly( typeOf(Debug).Assembly ); > env.LoadAssembly( typeOf(IMigration).Assembly ); > pe := env.GetEngine("py"); > end; > > And here is my IronPython Script: > > import System > from GeoMEM.NETandCF.Migrations import * > > class Hello(IMigration): > def __init__( self, msg = "A BIIIG Hello From Python" ): > self.msg = msg > > def Up(self): > print self.msg > > def Down(self): > print "Down" > > > instance = Hello() > > Am I close or barking up the wrong tree? Thanks. > > Cheers > Barry Carr > _______________________________________________ > 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 barrycarr at ixian-software.com Thu Jul 3 17:40:17 2008 From: barrycarr at ixian-software.com (Barry Carr) Date: Thu, 03 Jul 2008 16:40:17 +0100 Subject: [IronPython] Returning an object from a script In-Reply-To: References: <486CE364.1080303@ixian-software.com> Message-ID: <486CF2E1.900@ixian-software.com> Hi Curt, Thanks very much. That worked a treat. I'm new to the DLR and IP2 so I didn't know about GetVariable. Cheers Barry Carr Curt Hagenlocher wrote: > You never actually assign a value to "obj". SetVariable doesn't create > a linkage between your local variable and the script-defined one. You > have to explicitly fetch out the value of "instance" by using something like > > IMigration instance = scope.GetVariable("instance"). > > On Thu, Jul 3, 2008 at 7:34 AM, Barry Carr > wrote: > > Hi, > > Using IP2B3 (on .NET 2,0), is it possible to get a IronPython script > to create an object and return it or pass it back to the host > application to be used later? > > I tried what I thought was the obvious route but got a null > reference exception when I tried to use the returned object (the > code is Oxygene - an Object Pascal variant): > > class method ConsoleApp.Main; > begin > PrepPython; > > var script := pe.CreateScriptSourceFromFile( > ".\\PythonHostingTest.py" ); > var scope := env.CreateScope; > var obj : Object := nil; > scope.SetVariable("instance", obj ); > script.Execute(scope); > IMigration(obj).Up; // <-- Null ref exception here > Console.WriteLine('Hello World.'); > end; > > class method ConsoleApp.PrepPython; > begin > env := ScriptRuntime.Create; > env.LoadAssembly( typeOf(String).Assembly ); > env.LoadAssembly( typeOf(Debug).Assembly ); > env.LoadAssembly( typeOf(IMigration).Assembly ); > pe := env.GetEngine("py"); > end; > > And here is my IronPython Script: > > import System > from GeoMEM.NETandCF.Migrations import * > > class Hello(IMigration): > def __init__( self, msg = "A BIIIG Hello From Python" ): > self.msg = msg > > def Up(self): > print self.msg > > def Down(self): > print "Down" > > > instance = Hello() > > Am I close or barking up the wrong tree? Thanks. > > Cheers > Barry Carr > _______________________________________________ > 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 falcon at uwyo.edu Fri Jul 4 01:46:53 2008 From: falcon at uwyo.edu (Michael Stephens) Date: Thu, 3 Jul 2008 17:46:53 -0600 Subject: [IronPython] CodeDom Method without class Message-ID: I'm trying to declare a method without a class but the PythonProvider .. or .net keeps throwing.. Does anyone know any clever workarounds? CodeMemberMethod meth=new CodeMemberMethod(); meth.Name = "Script"; meth.Attributes = MemberAttributes.Public; provider.??? everything throws! Michael Stephens Electrical Engineering Graduate Student University of Wyoming falcon at uwyo.edu or 89iroc at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From curt at hagenlocher.org Fri Jul 4 04:12:39 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Thu, 3 Jul 2008 19:12:39 -0700 Subject: [IronPython] CodeDom Method without class In-Reply-To: References: Message-ID: This isn't surprising, because the model exposed by the CodeDom is extremely close to the underlying CLR -- which doesn't support methods without classes. On Thu, Jul 3, 2008 at 4:46 PM, Michael Stephens wrote: > I'm trying to declare a method without a class but the PythonProvider .. or > .net keeps throwing.. Does anyone know any clever workarounds? > > CodeMemberMethod meth=new CodeMemberMethod(); > meth.Name = "Script"; > meth.Attributes = MemberAttributes.Public; > > provider.??? everything throws! > > Michael Stephens > > Electrical Engineering Graduate Student > University of Wyoming > falcon at uwyo.edu or 89iroc at gmail.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 dan.eloff at gmail.com Sat Jul 5 05:23:53 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Fri, 4 Jul 2008 22:23:53 -0500 Subject: [IronPython] Understanding the differences between IronPython and CLR classes Message-ID: <4817b6fc0807042023l396062bcp595df20d25f7895e@mail.gmail.com> I've figured out by now that IronPython classes are not the same as .NET types. However, I'm wondering if there is any way to have a Python implemented class/type that can be added to the UI in Silverlight. I think I tried to inherit from Control and then add an instance of that to the visual tree, but it didn't work. Is there any way to do this? Thanks, -Dan From fuzzyman at voidspace.org.uk Sat Jul 5 17:04:08 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sat, 05 Jul 2008 16:04:08 +0100 Subject: [IronPython] DebugMode Message-ID: <486F8D68.7090509@voidspace.org.uk> Hello all, What practical effect does setting 'DebugMode' on a ScriptRuntime have? ScriptRuntime runtime = ScriptRuntime.Create(); runtime.GlobalOptions.DebugMode = true; ScriptEngine engine = runtime.GetEngine("py"); Michael Foord -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From dinov at exchange.microsoft.com Sat Jul 5 19:12:14 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Sat, 5 Jul 2008 10:12:14 -0700 Subject: [IronPython] DebugMode In-Reply-To: <486F8D68.7090509@voidspace.org.uk> References: <486F8D68.7090509@voidspace.org.uk> Message-ID: <7AD436E4270DD54A94238001769C2227012C93298F79@DF-GRTDANE-MSG.exchange.corp.microsoft.com> It enables generation of PDBs and causes the code to be compiled in debug mode (w/o optimizations) so that it can be reasonably debugged. W/o it you won't be able to debug code from a .NET debugger. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Saturday, July 05, 2008 8:04 AM To: Discussion of IronPython Subject: [IronPython] DebugMode Hello all, What practical effect does setting 'DebugMode' on a ScriptRuntime have? ScriptRuntime runtime = ScriptRuntime.Create(); runtime.GlobalOptions.DebugMode = true; ScriptEngine engine = runtime.GetEngine("py"); Michael Foord -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From fuzzyman at voidspace.org.uk Sat Jul 5 19:14:32 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sat, 05 Jul 2008 18:14:32 +0100 Subject: [IronPython] DebugMode In-Reply-To: <7AD436E4270DD54A94238001769C2227012C93298F79@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <486F8D68.7090509@voidspace.org.uk> <7AD436E4270DD54A94238001769C2227012C93298F79@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <486FABF8.6090106@voidspace.org.uk> Dino Viehland wrote: > It enables generation of PDBs and causes the code to be compiled in debug mode (w/o optimizations) so that it can be reasonably debugged. W/o it you won't be able to debug code from a .NET debugger. > Cool, thanks Dino. Also what is the difference between ScriptSource.Execute() and ScriptSource.ExecuteProgram() ? As far as I can tell, ExecuteProgram returns an integer for propagating the exit code of a program. Is this the main reason to use it? Michael > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Saturday, July 05, 2008 8:04 AM > To: Discussion of IronPython > Subject: [IronPython] DebugMode > > Hello all, > > What practical effect does setting 'DebugMode' on a ScriptRuntime have? > > ScriptRuntime runtime = ScriptRuntime.Create(); > runtime.GlobalOptions.DebugMode = true; > ScriptEngine engine = runtime.GetEngine("py"); > > Michael Foord > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From tgruben at gmail.com Sun Jul 6 02:24:55 2008 From: tgruben at gmail.com (Todd Gruben) Date: Sat, 5 Jul 2008 19:24:55 -0500 Subject: [IronPython] Accessing C++ managed class libraries Message-ID: <97758c860807051724t251766f7of176cf3e0f1fe360@mail.gmail.com> Is there anything different about c++ class hierachies? I can access my c# clr classes, but not my c++ clr classes. Is there something special you should do? -Todd -------------- next part -------------- An HTML attachment was scrubbed... URL: From curt at hagenlocher.org Sun Jul 6 02:35:49 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Sat, 5 Jul 2008 17:35:49 -0700 Subject: [IronPython] Accessing C++ managed class libraries In-Reply-To: <97758c860807051724t251766f7of176cf3e0f1fe360@mail.gmail.com> References: <97758c860807051724t251766f7of176cf3e0f1fe360@mail.gmail.com> Message-ID: My quick-and-dirty test with a Managed C++ DLL works just fine. Your C++ classes are declared as "public ref class", right? Have you looked at the assemblies in Reflector to see if there's anything unusual about them? On Sat, Jul 5, 2008 at 5:24 PM, Todd Gruben wrote: > Is there anything different about c++ class hierachies? I can access my c# > clr classes, but not my c++ clr classes. Is there something special you > should do? > > -Todd > > _______________________________________________ > 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 jdhardy at gmail.com Sun Jul 6 07:43:42 2008 From: jdhardy at gmail.com (Jeff Hardy) Date: Sat, 5 Jul 2008 23:43:42 -0600 Subject: [IronPython] TypeLoadExceptions Message-ID: Hi, I'm consistently getting (i.e. they always occur at the same location) TypeLoadExceptions with the message "GenericArguments[0], 'Slots', on 'Microsoft.Scripting.Actions.RuleBuilder`1[T]' violates the constraint of type parameter 'T'." while trying to run Django (and CherryPy as well). I can't seem create a minimal test case for them to try and track it down. Does anybody have any idea what could be causing these exceptions? -Jeff From curt at hagenlocher.org Sun Jul 6 14:36:30 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Sun, 6 Jul 2008 05:36:30 -0700 Subject: [IronPython] TypeLoadExceptions In-Reply-To: References: Message-ID: Have you gotten this while not running in the debugger? On Sat, Jul 5, 2008 at 10:43 PM, Jeff Hardy wrote: > Hi, > I'm consistently getting (i.e. they always occur at the same location) > TypeLoadExceptions with the message "GenericArguments[0], 'Slots', on > 'Microsoft.Scripting.Actions.RuleBuilder`1[T]' violates the constraint > of type parameter 'T'." while trying to run Django (and CherryPy as > well). I can't seem create a minimal test case for them to try and > track it down. > > Does anybody have any idea what could be causing these exceptions? > > -Jeff > _______________________________________________ > 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 tgruben at gmail.com Sun Jul 6 19:40:02 2008 From: tgruben at gmail.com (Todd Gruben) Date: Sun, 6 Jul 2008 12:40:02 -0500 Subject: [IronPython] Accessing C++ managed class libraries Message-ID: <97758c860807061040u1ac3d84fr62146578bfefc483@mail.gmail.com> here is my quick and dirty class.. using namespace System; namespace dtnnet { public ref class Feed { // TODO: Add your methods for this class here. public: String^ test(void) { return "Hello World"; } }; } The Reflector says that this is the full path.. C:\Documents and Settings\tgruben\My Documents\Visual Studio 2008\Projects\dtnnet\Debug\dtnnet.dll yet here is the output of my AddReference Attempt.. C:\Documents and Settings\tgruben\My Documents\Visual Studio 2008\Projects\dtnnet\Debug>ipy IronPython 2.0 Beta (2.0.0.3000) on .NET 2.0.50727.1433 Copyright (c) Microsoft Corporation. All rights reserved. >>> import clr >>> clr.AddReferenceToFileAndPath(r"C:\Documents and Settings\tgruben\My Documents\Visual Studio 2008\Projects\dtnnet\Debug\dtnnet.dll") Traceback (most recent call last): File "", line 1, in IOError: file does not exist: C:\Documents and Settings\tgruben\My Documents\Visual Studio 2008\Projects\dtnnet\Debug\dtnnet.dll >>> yet i can do this .. f = open(r""C:\Documents and Settings\tgruben\My Documents\Visual Studio 2008\Projects\dtnnet\Debug\dtnnet.dll","r").read() and print len(f) and get 36k which is the size of the file. I'm sure its a configuration setting... if i point the addreferrence function to my c# library it just works. The c# does exactly the same thing, return a string. Also if i just try and do AddReference("dtnnet.dll") from that directory, it just says failed to load assembly I'm clueless.. -Todd -------------- next part -------------- An HTML attachment was scrubbed... URL: From curt at hagenlocher.org Sun Jul 6 20:36:01 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Sun, 6 Jul 2008 11:36:01 -0700 Subject: [IronPython] Accessing C++ managed class libraries In-Reply-To: <97758c860807061040u1ac3d84fr62146578bfefc483@mail.gmail.com> References: <97758c860807061040u1ac3d84fr62146578bfefc483@mail.gmail.com> Message-ID: Using basically this same code, it works for me. I'm using VS2008 Pro and IronPython 2.0b3. When creating the project in Visual Studio, I just picked "Class Library" under Visual C++/CLR in the "New Project" dialog. Can you email me a zipped copy of your DLL? On Sun, Jul 6, 2008 at 10:40 AM, Todd Gruben wrote: > here is my quick and dirty class.. > > > > using namespace System; > > namespace dtnnet { > > public ref class Feed > { > // TODO: Add your methods for this class here. > public: > > String^ test(void) > { > return "Hello World"; > } > }; > } > > > The Reflector says that this is the full path.. > C:\Documents and Settings\tgruben\My Documents\Visual Studio > 2008\Projects\dtnnet\Debug\dtnnet.dll > > > yet here is the output of my AddReference Attempt.. > > > C:\Documents and Settings\tgruben\My Documents\Visual Studio > 2008\Projects\dtnnet\Debug>ipy > IronPython 2.0 Beta (2.0.0.3000) on .NET 2.0.50727.1433 > Copyright (c) Microsoft Corporation. All rights reserved. > >>> import clr > >>> clr.AddReferenceToFileAndPath(r"C:\Documents and Settings\tgruben\My > Documents\Visual Studio 2008\Projects\dtnnet\Debug\dtnnet.dll") > Traceback (most recent call last): > File "", line 1, in > IOError: file does not exist: C:\Documents and Settings\tgruben\My > Documents\Visual Studio 2008\Projects\dtnnet\Debug\dtnnet.dll > >>> > > yet i can do this .. > f = open(r""C:\Documents and Settings\tgruben\My Documents\Visual Studio > 2008\Projects\dtnnet\Debug\dtnnet.dll","r").read() > and print len(f) and get 36k which is the size of the file. > > I'm sure its a configuration setting... if i point the addreferrence > function to my c# library it just works. The c# does exactly the same > thing, return a string. > > > Also if i just try and do AddReference("dtnnet.dll") from that directory, > it just says failed to load assembly > > > I'm clueless.. > > -Todd > > > _______________________________________________ > 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 jdhardy at gmail.com Mon Jul 7 15:37:37 2008 From: jdhardy at gmail.com (Jeff Hardy) Date: Mon, 7 Jul 2008 07:37:37 -0600 Subject: [IronPython] TypeLoadExceptions In-Reply-To: References: Message-ID: Haven't tried, actually. I'll give it a try later and see what happens. On Sun, Jul 6, 2008 at 6:36 AM, Curt Hagenlocher wrote: > Have you gotten this while not running in the debugger? > > On Sat, Jul 5, 2008 at 10:43 PM, Jeff Hardy wrote: >> >> Hi, >> I'm consistently getting (i.e. they always occur at the same location) >> TypeLoadExceptions with the message "GenericArguments[0], 'Slots', on >> 'Microsoft.Scripting.Actions.RuleBuilder`1[T]' violates the constraint >> of type parameter 'T'." while trying to run Django (and CherryPy as >> well). I can't seem create a minimal test case for them to try and >> track it down. >> >> Does anybody have any idea what could be causing these exceptions? >> >> -Jeff >> _______________________________________________ >> 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 Jul 7 18:34:52 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 7 Jul 2008 09:34:52 -0700 Subject: [IronPython] DebugMode In-Reply-To: <486FABF8.6090106@voidspace.org.uk> References: <486F8D68.7090509@voidspace.org.uk> <7AD436E4270DD54A94238001769C2227012C93298F79@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <486FABF8.6090106@voidspace.org.uk> Message-ID: <7AD436E4270DD54A94238001769C2227012C93298FED@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Yep, it's all about propagating the exit code. For example in IronPython we support getting the error code from a SystemExit exception. If there was a C Script it might support getting the exit code returned from int main(). -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Saturday, July 05, 2008 10:15 AM To: Discussion of IronPython Subject: Re: [IronPython] DebugMode Dino Viehland wrote: > It enables generation of PDBs and causes the code to be compiled in debug mode (w/o optimizations) so that it can be reasonably debugged. W/o it you won't be able to debug code from a .NET debugger. > Cool, thanks Dino. Also what is the difference between ScriptSource.Execute() and ScriptSource.ExecuteProgram() ? As far as I can tell, ExecuteProgram returns an integer for propagating the exit code of a program. Is this the main reason to use it? Michael > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Saturday, July 05, 2008 8:04 AM > To: Discussion of IronPython > Subject: [IronPython] DebugMode > > Hello all, > > What practical effect does setting 'DebugMode' on a ScriptRuntime have? > > ScriptRuntime runtime = ScriptRuntime.Create(); > runtime.GlobalOptions.DebugMode = true; > ScriptEngine engine = runtime.GetEngine("py"); > > Michael Foord > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dan.eloff at gmail.com Mon Jul 7 22:21:39 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Mon, 7 Jul 2008 15:21:39 -0500 Subject: [IronPython] Is there a way to see CLR tracebacks? In-Reply-To: References: <4817b6fc0806281951x6054cd5ewa72dc7505bee06cf@mail.gmail.com> Message-ID: <4817b6fc0807071321i4887f1e8j1722bb5786b005cf@mail.gmail.com> Thanks Curt, Is there any equivalent in Silverlight? -Dan On Sat, Jun 28, 2008 at 10:04 PM, Curt Hagenlocher wrote: > Launch ipy.exe with the flag -X:ShowClrExceptions. > > On Sat, Jun 28, 2008 at 7:51 PM, Dan Eloff wrote: >> >> I notice that tracebacks show only the IronPython stack trace. Is >> there any way to see the CLR stack trace (as well?) if the error >> occurred in a call to a CLR assembly? >> >> -Dan >> _______________________________________________ >> 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 Jimmy.Schementi at microsoft.com Mon Jul 7 23:21:09 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Mon, 7 Jul 2008 14:21:09 -0700 Subject: [IronPython] Is there a way to see CLR tracebacks? In-Reply-To: <4817b6fc0807071321i4887f1e8j1722bb5786b005cf@mail.gmail.com> References: <4817b6fc0806281951x6054cd5ewa72dc7505bee06cf@mail.gmail.com> <4817b6fc0807071321i4887f1e8j1722bb5786b005cf@mail.gmail.com> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A32845D4446089@NA-EXMSG-C116.redmond.corp.microsoft.com> http://blog.jimmy.schementi.com/2008/05/error-reporting-in-silverlight-ruby-and.html Yep, pass the "exceptionDetail" initParam flag: ~js > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Dan Eloff > Sent: Monday, July 07, 2008 1:22 PM > To: Discussion of IronPython > Subject: Re: [IronPython] Is there a way to see CLR tracebacks? > > Thanks Curt, > > Is there any equivalent in Silverlight? > > -Dan > > On Sat, Jun 28, 2008 at 10:04 PM, Curt Hagenlocher > wrote: > > Launch ipy.exe with the flag -X:ShowClrExceptions. > > > > On Sat, Jun 28, 2008 at 7:51 PM, Dan Eloff > wrote: > >> > >> I notice that tracebacks show only the IronPython stack trace. Is > >> there any way to see the CLR stack trace (as well?) if the error > >> occurred in a call to a CLR assembly? > >> > >> -Dan > >> _______________________________________________ > >> 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 dan.eloff at gmail.com Mon Jul 7 23:27:34 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Mon, 7 Jul 2008 16:27:34 -0500 Subject: [IronPython] Is there a way to see CLR tracebacks? In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A32845D4446089@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <4817b6fc0806281951x6054cd5ewa72dc7505bee06cf@mail.gmail.com> <4817b6fc0807071321i4887f1e8j1722bb5786b005cf@mail.gmail.com> <5283CA0A4168DF4FBBD71AE9ECA5A32845D4446089@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <4817b6fc0807071427v378a357dxb5bbd02568fb97e2@mail.gmail.com> Excellent! Thanks Jimmy! On Mon, Jul 7, 2008 at 4:21 PM, Jimmy Schementi wrote: > http://blog.jimmy.schementi.com/2008/05/error-reporting-in-silverlight-ruby-and.html > > Yep, pass the "exceptionDetail" initParam flag: > > > > ~js > >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users- >> bounces at lists.ironpython.com] On Behalf Of Dan Eloff >> Sent: Monday, July 07, 2008 1:22 PM >> To: Discussion of IronPython >> Subject: Re: [IronPython] Is there a way to see CLR tracebacks? >> >> Thanks Curt, >> >> Is there any equivalent in Silverlight? >> >> -Dan >> >> On Sat, Jun 28, 2008 at 10:04 PM, Curt Hagenlocher >> wrote: >> > Launch ipy.exe with the flag -X:ShowClrExceptions. >> > >> > On Sat, Jun 28, 2008 at 7:51 PM, Dan Eloff >> wrote: >> >> >> >> I notice that tracebacks show only the IronPython stack trace. Is >> >> there any way to see the CLR stack trace (as well?) if the error >> >> occurred in a call to a CLR assembly? >> >> >> >> -Dan >> >> _______________________________________________ >> >> 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 Jimmy.Schementi at microsoft.com Mon Jul 7 23:32:54 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Mon, 7 Jul 2008 14:32:54 -0700 Subject: [IronPython] Is there a way to see CLR tracebacks? In-Reply-To: <4817b6fc0807071427v378a357dxb5bbd02568fb97e2@mail.gmail.com> References: <4817b6fc0806281951x6054cd5ewa72dc7505bee06cf@mail.gmail.com> <4817b6fc0807071321i4887f1e8j1722bb5786b005cf@mail.gmail.com> <5283CA0A4168DF4FBBD71AE9ECA5A32845D4446089@NA-EXMSG-C116.redmond.corp.microsoft.com> <4817b6fc0807071427v378a357dxb5bbd02568fb97e2@mail.gmail.com> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A32845D44460A6@NA-EXMSG-C116.redmond.corp.microsoft.com> Woops, according to *my* blog: "exceptionDetail only has an effect on Ruby code; Python and JScript always show a dynamic stack trace." So I stand corrected, by myself. =) This was the behavior in Beta1, not sure if I checked it for Beta2. Let me know if it works for you. ~js > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Dan Eloff > Sent: Monday, July 07, 2008 2:28 PM > To: Discussion of IronPython > Subject: Re: [IronPython] Is there a way to see CLR tracebacks? > > Excellent! Thanks Jimmy! > > On Mon, Jul 7, 2008 at 4:21 PM, Jimmy Schementi > wrote: > > http://blog.jimmy.schementi.com/2008/05/error-reporting-in- > silverlight-ruby-and.html > > > > Yep, pass the "exceptionDetail" initParam flag: > > > > > > > > ~js > > > >> -----Original Message----- > >> From: users-bounces at lists.ironpython.com [mailto:users- > >> bounces at lists.ironpython.com] On Behalf Of Dan Eloff > >> Sent: Monday, July 07, 2008 1:22 PM > >> To: Discussion of IronPython > >> Subject: Re: [IronPython] Is there a way to see CLR tracebacks? > >> > >> Thanks Curt, > >> > >> Is there any equivalent in Silverlight? > >> > >> -Dan > >> > >> On Sat, Jun 28, 2008 at 10:04 PM, Curt Hagenlocher > >> wrote: > >> > Launch ipy.exe with the flag -X:ShowClrExceptions. > >> > > >> > On Sat, Jun 28, 2008 at 7:51 PM, Dan Eloff > >> wrote: > >> >> > >> >> I notice that tracebacks show only the IronPython stack trace. Is > >> >> there any way to see the CLR stack trace (as well?) if the error > >> >> occurred in a call to a CLR assembly? > >> >> > >> >> -Dan > >> >> _______________________________________________ > >> >> 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 From dan.eloff at gmail.com Mon Jul 7 23:50:13 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Mon, 7 Jul 2008 16:50:13 -0500 Subject: [IronPython] Is there a way to see CLR tracebacks? In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A32845D44460A6@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <4817b6fc0806281951x6054cd5ewa72dc7505bee06cf@mail.gmail.com> <4817b6fc0807071321i4887f1e8j1722bb5786b005cf@mail.gmail.com> <5283CA0A4168DF4FBBD71AE9ECA5A32845D4446089@NA-EXMSG-C116.redmond.corp.microsoft.com> <4817b6fc0807071427v378a357dxb5bbd02568fb97e2@mail.gmail.com> <5283CA0A4168DF4FBBD71AE9ECA5A32845D44460A6@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <4817b6fc0807071450t15d26ee1mca33454c7e680097@mail.gmail.com> On Mon, Jul 7, 2008 at 4:32 PM, Jimmy Schementi wrote: > Woops, according to *my* blog: > > "exceptionDetail only has an effect on Ruby code; Python and JScript always show a dynamic stack trace." > > So I stand corrected, by myself. =) This was the behavior in Beta1, not sure if I checked it for Beta2. Let me know if it works for you. > I guess that was fixed for Beta 2, because I see the dynamic stack trace followed by the full CLR stack trace (which is very helpful!) That's what you call a good "woops" :) -Dan From Jimmy.Schementi at microsoft.com Mon Jul 7 23:54:12 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Mon, 7 Jul 2008 14:54:12 -0700 Subject: [IronPython] Is there a way to see CLR tracebacks? In-Reply-To: <4817b6fc0807071450t15d26ee1mca33454c7e680097@mail.gmail.com> References: <4817b6fc0806281951x6054cd5ewa72dc7505bee06cf@mail.gmail.com> <4817b6fc0807071321i4887f1e8j1722bb5786b005cf@mail.gmail.com> <5283CA0A4168DF4FBBD71AE9ECA5A32845D4446089@NA-EXMSG-C116.redmond.corp.microsoft.com> <4817b6fc0807071427v378a357dxb5bbd02568fb97e2@mail.gmail.com> <5283CA0A4168DF4FBBD71AE9ECA5A32845D44460A6@NA-EXMSG-C116.redmond.corp.microsoft.com> <4817b6fc0807071450t15d26ee1mca33454c7e680097@mail.gmail.com> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A32845D44460E2@NA-EXMSG-C116.redmond.corp.microsoft.com> Awesome! I'll update my blog. > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Dan Eloff > Sent: Monday, July 07, 2008 2:50 PM > To: Discussion of IronPython > Subject: Re: [IronPython] Is there a way to see CLR tracebacks? > > On Mon, Jul 7, 2008 at 4:32 PM, Jimmy Schementi > wrote: > > Woops, according to *my* blog: > > > > "exceptionDetail only has an effect on Ruby code; Python and JScript > always show a dynamic stack trace." > > > > So I stand corrected, by myself. =) This was the behavior in Beta1, > not sure if I checked it for Beta2. Let me know if it works for you. > > > > I guess that was fixed for Beta 2, because I see the dynamic stack > trace followed by the full CLR stack trace (which is very helpful!) > That's what you call a good "woops" :) > > -Dan > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From jdhardy at gmail.com Tue Jul 8 01:46:29 2008 From: jdhardy at gmail.com (Jeff Hardy) Date: Mon, 7 Jul 2008 17:46:29 -0600 Subject: [IronPython] TypeLoadExceptions In-Reply-To: References: Message-ID: On Sun, Jul 6, 2008 at 6:36 AM, Curt Hagenlocher wrote: > Have you gotten this while not running in the debugger? Hi Curt, I've had a chance to try it without the debugger, and I didn't get a TypeLoadException. I still get some errors, mind you, but they seem to be known issues (namely #15399, which is supposed to be fixed in 2.0b4). Any idea what this means? -Jeff From curt at hagenlocher.org Tue Jul 8 01:57:11 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Mon, 7 Jul 2008 16:57:11 -0700 Subject: [IronPython] TypeLoadExceptions In-Reply-To: References: Message-ID: On Mon, Jul 7, 2008 at 4:46 PM, Jeff Hardy wrote: > On Sun, Jul 6, 2008 at 6:36 AM, Curt Hagenlocher > wrote: > > Have you gotten this while not running in the debugger? > > Hi Curt, > I've had a chance to try it without the debugger, and I didn't get a > TypeLoadException. I still get some errors, mind you, but they seem to > be known issues (namely #15399, which is supposed to be fixed in > 2.0b4). > > Any idea what this means? It strongly suggests that there's a bug in the managed debugger. It seems to be triggered by the use of __slots__. We generate a backing CLR class that's templated for Python classes that contain __slots__, and some of the methods on the class are themselves templated but with a different template argument. You can still debug the code with an unmanaged debugger (ie windbg) but it's a significantly less friendly experience. I haven't yet gotten around to reporting this to the managed debug folks, or creating a smaller test case. -- Curt Hagenlocher curt at hagenlocher.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From pontheangelofdeath at gmail.com Tue Jul 8 13:40:55 2008 From: pontheangelofdeath at gmail.com (TraumaPony) Date: Tue, 8 Jul 2008 21:40:55 +1000 Subject: [IronPython] Two questions regarding exposing an API. Message-ID: <55976d0f0807080440u497f830dw3f1b3f98f98d210@mail.gmail.com> Hi, I have two questions regarding the IronPython 2.0 B3. 1. I'm trying to expose only a few methods from my assembly, but I haven't the faintest idea how to do it. The best I can come up with is the following: import clr clr.AddReference("CoolEngine") def randomIntNoParams(): from CoolEngine.Engine.Scripting import ScriptManager return CoolEngine.Engine.Scripting.ScriptManager.RandomInt() def randomIntOneParam(i): from CoolEngine.Engine.Scripting import ScriptManager return CoolEngine.Engine.Scripting.ScriptManager.RandomInt(i) def randomIntTwoParams(i, j): from CoolEngine.Engine.Scripting import ScriptManager return CoolEngine.Engine.Scripting.ScriptManager.RandomInt(i, j) def randomIntThreeParams(i, j, k): from CoolEngine.Engine.Scripting import ScriptManager return CoolEngine.Engine.Scripting.ScriptManager.RandomInt(i, j, k) def randomIntThreeParamsNoReturn(i, j, k): from CoolEngine.Engine.Scripting import ScriptManager CoolEngine.Engine.Scripting.ScriptManager.RandomIntNoReturn(i, j, k) But alas, it says "name 'CoolEngine' is not defined" . What am I doing wrong there? 2. I'm trying to create a module dynamically at runtime. I have the following code which I want to be placed in a module called "Script": import clr clr.AddReference("System.Threading") def Pause(milliseconds): from System.Threading.Tasks import Task Task.CurrentTask.Wait(milliseconds) However, I have no idea how to get it into its own module from there, and including it in its own file called Script.py is out of the question; I have that code as a string resource in my assembly. I'm doing the following: * Engine.CreateScriptSourceFromString( "import imp\n"+ "import sys\n"+ "newModule = imp.new_module(moduleName)\n"+ "exec(moduleSource, newModule.__dict__)\n" + "sys.modules[moduleName] = newModule", *SourceCodeKind* .Statements).Execute(scope); * where the moduleName variable is "Script" and the moduleSource is the above source code. However, I get the following message: An unhandled exception of type 'Microsoft.Scripting.SyntaxErrorException' occurred in Unknown Module. Additional information: unexpected token '\r' Any ideas? -- /"\ \ / ASCII RIBBON CAMPAIGN X AGAINST HTML MAIL / \ This message has been encrypted with ROT-26. Any unauthorised decryption will result in prosecution to the full extent of the law. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dan.eloff at gmail.com Tue Jul 8 13:58:05 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Tue, 8 Jul 2008 06:58:05 -0500 Subject: [IronPython] Two questions regarding exposing an API. In-Reply-To: <55976d0f0807080440u497f830dw3f1b3f98f98d210@mail.gmail.com> References: <55976d0f0807080440u497f830dw3f1b3f98f98d210@mail.gmail.com> Message-ID: <4817b6fc0807080458g6927ca94l3015500ade478c4d@mail.gmail.com> Hi, exec is not a function, it's a statement. exec moduleSource in newModule.__dict__ -Dan On Tue, Jul 8, 2008 at 6:40 AM, TraumaPony wrote: > Hi, I have two questions regarding the IronPython 2.0 B3. > > 1. I'm trying to expose only a few methods from my assembly, but I haven't > the faintest idea how to do it. The best I can come up with is the > following: > > import clr > clr.AddReference("CoolEngine") > def randomIntNoParams(): > from CoolEngine.Engine.Scripting import ScriptManager > return CoolEngine.Engine.Scripting.ScriptManager.RandomInt() > def randomIntOneParam(i): > from CoolEngine.Engine.Scripting import ScriptManager > return CoolEngine.Engine.Scripting.ScriptManager.RandomInt(i) > def randomIntTwoParams(i, j): > from CoolEngine.Engine.Scripting import ScriptManager > return CoolEngine.Engine.Scripting.ScriptManager.RandomInt(i, j) > def randomIntThreeParams(i, j, k): > from CoolEngine.Engine.Scripting import ScriptManager > return CoolEngine.Engine.Scripting.ScriptManager.RandomInt(i, j, k) > def randomIntThreeParamsNoReturn(i, j, k): > from CoolEngine.Engine.Scripting import ScriptManager > CoolEngine.Engine.Scripting.ScriptManager.RandomIntNoReturn(i, j, k) > But alas, it says "name 'CoolEngine' is not defined" . What am I doing wrong > there? > > 2. I'm trying to create a module dynamically at runtime. I have the > following code which I want to be placed in a module called "Script": > > import clr > clr.AddReference("System.Threading") > def Pause(milliseconds): > from System.Threading.Tasks import Task > Task.CurrentTask.Wait(milliseconds) > > However, I have no idea how to get it into its own module from there, and > including it in its own file called Script.py is out of the question; I have > that code as a string resource in my assembly. > > I'm doing the following: > > Engine.CreateScriptSourceFromString( > > "import imp\n" > > + > > "import sys\n" > > + > > "newModule = imp.new_module(moduleName)\n" > > + > > "exec(moduleSource, newModule.__dict__)\n" > > + > > "sys.modules[moduleName] = newModule" > > , SourceCodeKind.Statements).Execute(scope); > > where the moduleName variable is "Script" and the moduleSource is the above > source code. However, I get the following message: > > An unhandled exception of type 'Microsoft.Scripting.SyntaxErrorException' > occurred in Unknown Module. > > Additional information: unexpected token '\r' > > Any ideas? > > > > -- > /"\ > \ / ASCII RIBBON CAMPAIGN > X AGAINST HTML MAIL > / \ > > This message has been encrypted with ROT-26. Any unauthorised decryption > will result in prosecution to the full extent of the law. > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > From mbarnett at uniserve.com Tue Jul 8 13:56:51 2008 From: mbarnett at uniserve.com (Mitch Barnett) Date: Tue, 8 Jul 2008 04:56:51 -0700 Subject: [IronPython] Embedded IronPython in .NET C# WinForm app error Message-ID: <001301c8e0f1$b541d5f0$6500a8c0@valleyforge> Hello, I have a .NET C# WinForm application that hosts an IronPython 1.1 engine. In the WinForm app, the scripting API is exposed through a web service interface (using Windows Communication Foundation) so that from a remote console, (over WCF), I can execute IronPython code on the computer that is running the WinForm app. The project is at: http://www.codeplex.com/gsb Works 99% of the time, but the 1% of the time that it does not work is for cases like this: >>> IronPython 1.1 (1.1) on .NET 2.0.50727.1433 >>> import clr >>> import sys >>> sys.path.append(r"c:\projects\gsbservice\gsbservice1") >>> clr.AddReferenceToFile("AgentServerObjects.dll") >>> from AgentServerObjects import * >>> a = AgentServerClass() Traceback (most recent call last): File C:\Projects\GSBService\GSBService1 \ParseInteractive.cs, line 93, in CallIPCmd File , line 0, in ##21 File , line 0, in DefaultNew##22 File , line 0, in .ctor##26 TypeError: Creating an instance of the COM component with CLSID {D45FD2FC-5C6E-11D1-9EC1- 00C04FD7081F} from the IClassFactory failed due to the following error: 80004002. >>> Of course if I try the same thing using the IPY.exe console on the same computer, using the same AgentServerObjects.dll, it works just fine. Any thoughts appreciated as to what might be going wrong. Thanks, Mitch From pontheangelofdeath at gmail.com Tue Jul 8 14:22:30 2008 From: pontheangelofdeath at gmail.com (TraumaPony) Date: Tue, 8 Jul 2008 22:22:30 +1000 Subject: [IronPython] Two questions regarding exposing an API. In-Reply-To: <4817b6fc0807080458g6927ca94l3015500ade478c4d@mail.gmail.com> References: <55976d0f0807080440u497f830dw3f1b3f98f98d210@mail.gmail.com> <4817b6fc0807080458g6927ca94l3015500ade478c4d@mail.gmail.com> Message-ID: <55976d0f0807080522w2b416192s713e682537e4a9f4@mail.gmail.com> Ah, true, however, I still get the same error. 2008/7/8 Dan Eloff : > Hi, > > exec is not a function, it's a statement. > > exec moduleSource in newModule.__dict__ > > -Dan > > On Tue, Jul 8, 2008 at 6:40 AM, TraumaPony > wrote: > > Hi, I have two questions regarding the IronPython 2.0 B3. > > > > 1. I'm trying to expose only a few methods from my assembly, but I > haven't > > the faintest idea how to do it. The best I can come up with is the > > following: > > > > import clr > > clr.AddReference("CoolEngine") > > def randomIntNoParams(): > > from CoolEngine.Engine.Scripting import ScriptManager > > return CoolEngine.Engine.Scripting.ScriptManager.RandomInt() > > def randomIntOneParam(i): > > from CoolEngine.Engine.Scripting import ScriptManager > > return CoolEngine.Engine.Scripting.ScriptManager.RandomInt(i) > > def randomIntTwoParams(i, j): > > from CoolEngine.Engine.Scripting import ScriptManager > > return CoolEngine.Engine.Scripting.ScriptManager.RandomInt(i, j) > > def randomIntThreeParams(i, j, k): > > from CoolEngine.Engine.Scripting import ScriptManager > > return CoolEngine.Engine.Scripting.ScriptManager.RandomInt(i, j, k) > > def randomIntThreeParamsNoReturn(i, j, k): > > from CoolEngine.Engine.Scripting import ScriptManager > > CoolEngine.Engine.Scripting.ScriptManager.RandomIntNoReturn(i, j, k) > > But alas, it says "name 'CoolEngine' is not defined" . What am I doing > wrong > > there? > > > > 2. I'm trying to create a module dynamically at runtime. I have the > > following code which I want to be placed in a module called "Script": > > > > import clr > > clr.AddReference("System.Threading") > > def Pause(milliseconds): > > from System.Threading.Tasks import Task > > Task.CurrentTask.Wait(milliseconds) > > > > However, I have no idea how to get it into its own module from there, and > > including it in its own file called Script.py is out of the question; I > have > > that code as a string resource in my assembly. > > > > I'm doing the following: > > > > Engine.CreateScriptSourceFromString( > > > > "import imp\n" > > > > + > > > > "import sys\n" > > > > + > > > > "newModule = imp.new_module(moduleName)\n" > > > > + > > > > "exec(moduleSource, newModule.__dict__)\n" > > > > + > > > > "sys.modules[moduleName] = newModule" > > > > , SourceCodeKind.Statements).Execute(scope); > > > > where the moduleName variable is "Script" and the moduleSource is the > above > > source code. However, I get the following message: > > > > An unhandled exception of type 'Microsoft.Scripting.SyntaxErrorException' > > occurred in Unknown Module. > > > > Additional information: unexpected token '\r' > > > > Any ideas? > > > > > > > > -- > > /"\ > > \ / ASCII RIBBON CAMPAIGN > > X AGAINST HTML MAIL > > / \ > > > > This message has been encrypted with ROT-26. Any unauthorised decryption > > will result in prosecution to the full extent of the law. > > > > _______________________________________________ > > 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 > -- /"\ \ / ASCII RIBBON CAMPAIGN X AGAINST HTML MAIL / \ This message has been encrypted with ROT-26. Any unauthorised decryption will result in prosecution to the full extent of the law. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dan.eloff at gmail.com Tue Jul 8 17:52:03 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Tue, 8 Jul 2008 10:52:03 -0500 Subject: [IronPython] Two questions regarding exposing an API. In-Reply-To: <55976d0f0807080522w2b416192s713e682537e4a9f4@mail.gmail.com> References: <55976d0f0807080440u497f830dw3f1b3f98f98d210@mail.gmail.com> <4817b6fc0807080458g6927ca94l3015500ade478c4d@mail.gmail.com> <55976d0f0807080522w2b416192s713e682537e4a9f4@mail.gmail.com> Message-ID: <4817b6fc0807080852u396de9d4hde0a996b7a2dbc9b@mail.gmail.com> Sorry, missed the unexpected token '\r' part. The error pretty much tells you what the problem is, you've got a \r (probably because you have \r\n line endings, in the the variable moduleSource. You can try to eliminate those, but you can also just do exec moduleSource.replace('\r', '') in newModule.__dict__ -Dan On Tue, Jul 8, 2008 at 7:22 AM, TraumaPony wrote: > Ah, true, however, I still get the same error. > > 2008/7/8 Dan Eloff : >> >> Hi, >> >> exec is not a function, it's a statement. >> >> exec moduleSource in newModule.__dict__ >> >> -Dan >> >> On Tue, Jul 8, 2008 at 6:40 AM, TraumaPony >> wrote: >> > Hi, I have two questions regarding the IronPython 2.0 B3. >> > >> > 1. I'm trying to expose only a few methods from my assembly, but I >> > haven't >> > the faintest idea how to do it. The best I can come up with is the >> > following: >> > >> > import clr >> > clr.AddReference("CoolEngine") >> > def randomIntNoParams(): >> > from CoolEngine.Engine.Scripting import ScriptManager >> > return CoolEngine.Engine.Scripting.ScriptManager.RandomInt() >> > def randomIntOneParam(i): >> > from CoolEngine.Engine.Scripting import ScriptManager >> > return CoolEngine.Engine.Scripting.ScriptManager.RandomInt(i) >> > def randomIntTwoParams(i, j): >> > from CoolEngine.Engine.Scripting import ScriptManager >> > return CoolEngine.Engine.Scripting.ScriptManager.RandomInt(i, j) >> > def randomIntThreeParams(i, j, k): >> > from CoolEngine.Engine.Scripting import ScriptManager >> > return CoolEngine.Engine.Scripting.ScriptManager.RandomInt(i, j, k) >> > def randomIntThreeParamsNoReturn(i, j, k): >> > from CoolEngine.Engine.Scripting import ScriptManager >> > CoolEngine.Engine.Scripting.ScriptManager.RandomIntNoReturn(i, j, k) >> > But alas, it says "name 'CoolEngine' is not defined" . What am I doing >> > wrong >> > there? >> > >> > 2. I'm trying to create a module dynamically at runtime. I have the >> > following code which I want to be placed in a module called "Script": >> > >> > import clr >> > clr.AddReference("System.Threading") >> > def Pause(milliseconds): >> > from System.Threading.Tasks import Task >> > Task.CurrentTask.Wait(milliseconds) >> > >> > However, I have no idea how to get it into its own module from there, >> > and >> > including it in its own file called Script.py is out of the question; I >> > have >> > that code as a string resource in my assembly. >> > >> > I'm doing the following: >> > >> > Engine.CreateScriptSourceFromString( >> > >> > "import imp\n" >> > >> > + >> > >> > "import sys\n" >> > >> > + >> > >> > "newModule = imp.new_module(moduleName)\n" >> > >> > + >> > >> > "exec(moduleSource, newModule.__dict__)\n" >> > >> > + >> > >> > "sys.modules[moduleName] = newModule" >> > >> > , SourceCodeKind.Statements).Execute(scope); >> > >> > where the moduleName variable is "Script" and the moduleSource is the >> > above >> > source code. However, I get the following message: >> > >> > An unhandled exception of type >> > 'Microsoft.Scripting.SyntaxErrorException' >> > occurred in Unknown Module. >> > >> > Additional information: unexpected token '\r' >> > >> > Any ideas? >> > >> > >> > >> > -- >> > /"\ >> > \ / ASCII RIBBON CAMPAIGN >> > X AGAINST HTML MAIL >> > / \ >> > >> > This message has been encrypted with ROT-26. Any unauthorised decryption >> > will result in prosecution to the full extent of the law. >> > >> > _______________________________________________ >> > 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 > > > > -- > /"\ > \ / ASCII RIBBON CAMPAIGN > X AGAINST HTML MAIL > / \ > > This message has been encrypted with ROT-26. Any unauthorised decryption > will result in prosecution to the full extent of the law. > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > From jdhardy at gmail.com Tue Jul 8 20:32:54 2008 From: jdhardy at gmail.com (Jeff Hardy) Date: Tue, 8 Jul 2008 12:32:54 -0600 Subject: [IronPython] TypeLoadExceptions In-Reply-To: References: Message-ID: Hopefully there's a workaround of some kind, because it makes debugging pretty painful. Good luck finding the root cause. I've only been able to hit it in large applications - Django and CherryPy, and haven't been able to find a minimal reproduction. On Mon, Jul 7, 2008 at 5:57 PM, Curt Hagenlocher wrote: > On Mon, Jul 7, 2008 at 4:46 PM, Jeff Hardy wrote: >> >> On Sun, Jul 6, 2008 at 6:36 AM, Curt Hagenlocher >> wrote: >> > Have you gotten this while not running in the debugger? >> >> Hi Curt, >> I've had a chance to try it without the debugger, and I didn't get a >> TypeLoadException. I still get some errors, mind you, but they seem to >> be known issues (namely #15399, which is supposed to be fixed in >> 2.0b4). >> >> Any idea what this means? > > > It strongly suggests that there's a bug in the managed debugger. It seems > to be triggered by the use of __slots__. We generate a backing CLR class > that's templated for Python classes that contain __slots__, and some of > the methods on the class are themselves templated but with a different > template argument. You can still debug the code with an unmanaged debugger > (ie windbg) but it's a significantly less friendly experience. > > I haven't yet gotten around to reporting this to the managed debug folks, or > creating a smaller test case. > > -- > Curt Hagenlocher > curt at hagenlocher.org > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > From fuzzyman at voidspace.org.uk Tue Jul 8 22:42:53 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 08 Jul 2008 21:42:53 +0100 Subject: [IronPython] Publishing a Module when Embedding Message-ID: <4873D14D.3090706@voidspace.org.uk> Hello all, I've been looking at writing some examples of publishing a module in an embedded scenario. The straightforward example (which also appears in the DLR hosting spec) is to just publish an *object*: ScriptRuntime _runtime = ScriptRuntime.Create(); _runtime.Globals.SetVariable("ModuleName", someObject); What I *really* want to do is to create a PythonModule from a dictionary of objects and publish that into the runtime globals. Creating a populated PythonModule seems to be problematic. The useful overload of PythonCOntext.CreateModule (that takes 4 arguments) isn't public (internal) - I can't see how to populate the module once I've created one. There is also an internal constructor to PythonModule that takes a Scope. These seem to be the routes taken by the importer. You can't publish a dictionary (well - except as a dictionary). How can I create and populate a PythonModule from C#? Michael Foord -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From dinov at exchange.microsoft.com Tue Jul 8 23:05:40 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 8 Jul 2008 14:05:40 -0700 Subject: [IronPython] Publishing a Module when Embedding In-Reply-To: <4873D14D.3090706@voidspace.org.uk> References: <4873D14D.3090706@voidspace.org.uk> Message-ID: <7AD436E4270DD54A94238001769C2227012C93299327@DF-GRTDANE-MSG.exchange.corp.microsoft.com> You can just expose a DLR Scope object directly - which is what IronPython does for modules internally. The name PythonModule is unfortunately a little confusing - it's actually a PythonScopeExtension where we can store additional data about the Scope (e.g. if import clr has occurred). We'll lazily create the PythonModule and associate it with the Scope if we need it. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Tuesday, July 08, 2008 1:43 PM To: Discussion of IronPython Subject: [IronPython] Publishing a Module when Embedding Hello all, I've been looking at writing some examples of publishing a module in an embedded scenario. The straightforward example (which also appears in the DLR hosting spec) is to just publish an *object*: ScriptRuntime _runtime = ScriptRuntime.Create(); _runtime.Globals.SetVariable("ModuleName", someObject); What I *really* want to do is to create a PythonModule from a dictionary of objects and publish that into the runtime globals. Creating a populated PythonModule seems to be problematic. The useful overload of PythonCOntext.CreateModule (that takes 4 arguments) isn't public (internal) - I can't see how to populate the module once I've created one. There is also an internal constructor to PythonModule that takes a Scope. These seem to be the routes taken by the importer. You can't publish a dictionary (well - except as a dictionary). How can I create and populate a PythonModule from C#? Michael Foord -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From fuzzyman at voidspace.org.uk Tue Jul 8 23:22:49 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 08 Jul 2008 22:22:49 +0100 Subject: [IronPython] Publishing a Module when Embedding In-Reply-To: <7AD436E4270DD54A94238001769C2227012C93299327@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <4873D14D.3090706@voidspace.org.uk> <7AD436E4270DD54A94238001769C2227012C93299327@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <4873DAA9.8020008@voidspace.org.uk> Dino Viehland wrote: > You can just expose a DLR Scope object directly - which is what IronPython does for modules internally. > Bah, damn - I meant to try that before posting and then forgot! Thanks Michael > The name PythonModule is unfortunately a little confusing - it's actually a PythonScopeExtension where we can store additional data about the Scope (e.g. if import clr has occurred). We'll lazily create the PythonModule and associate it with the Scope if we need it. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Tuesday, July 08, 2008 1:43 PM > To: Discussion of IronPython > Subject: [IronPython] Publishing a Module when Embedding > > Hello all, > > I've been looking at writing some examples of publishing a module in an > embedded scenario. > > The straightforward example (which also appears in the DLR hosting spec) > is to just publish an *object*: > > ScriptRuntime _runtime = ScriptRuntime.Create(); > _runtime.Globals.SetVariable("ModuleName", someObject); > > What I *really* want to do is to create a PythonModule from a dictionary > of objects and publish that into the runtime globals. > > Creating a populated PythonModule seems to be problematic. The useful > overload of PythonCOntext.CreateModule (that takes 4 arguments) isn't > public (internal) - I can't see how to populate the module once I've > created one. > > There is also an internal constructor to PythonModule that takes a > Scope. These seem to be the routes taken by the importer. > > You can't publish a dictionary (well - except as a dictionary). > > How can I create and populate a PythonModule from C#? > > Michael Foord > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From curt at hagenlocher.org Tue Jul 8 23:26:59 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Tue, 8 Jul 2008 14:26:59 -0700 Subject: [IronPython] TypeLoadExceptions In-Reply-To: References: Message-ID: Actually, the repro inside IronPython is pretty straightforward. The following bit of code will do it: import array class Array2(array.array): __slots__ = ['offset'] def __init__(self, typecode, data): self.offset = 0 a = Array2('b', [3, 6, 7, 11]) I was hoping to repro it from a much smaller C# program though :). On Tue, Jul 8, 2008 at 11:32 AM, Jeff Hardy wrote: > Hopefully there's a workaround of some kind, because it makes > debugging pretty painful. Good luck finding the root cause. I've only > been able to hit it in large applications - Django and CherryPy, and > haven't been able to find a minimal reproduction. > > On Mon, Jul 7, 2008 at 5:57 PM, Curt Hagenlocher > wrote: > > On Mon, Jul 7, 2008 at 4:46 PM, Jeff Hardy wrote: > >> > >> On Sun, Jul 6, 2008 at 6:36 AM, Curt Hagenlocher > >> wrote: > >> > Have you gotten this while not running in the debugger? > >> > >> Hi Curt, > >> I've had a chance to try it without the debugger, and I didn't get a > >> TypeLoadException. I still get some errors, mind you, but they seem to > >> be known issues (namely #15399, which is supposed to be fixed in > >> 2.0b4). > >> > >> Any idea what this means? > > > > > > It strongly suggests that there's a bug in the managed debugger. It > seems > > to be triggered by the use of __slots__. We generate a backing CLR class > > that's templated for Python classes that contain __slots__, and some of > > the methods on the class are themselves templated but with a different > > template argument. You can still debug the code with an unmanaged > debugger > > (ie windbg) but it's a significantly less friendly experience. > > > > I haven't yet gotten around to reporting this to the managed debug folks, > or > > creating a smaller test case. > > > > -- > > Curt Hagenlocher > > curt at hagenlocher.org > > _______________________________________________ > > 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 pontheangelofdeath at gmail.com Wed Jul 9 01:30:26 2008 From: pontheangelofdeath at gmail.com (TraumaPony) Date: Wed, 9 Jul 2008 09:30:26 +1000 Subject: [IronPython] Two questions regarding exposing an API. In-Reply-To: <4817b6fc0807080852u396de9d4hde0a996b7a2dbc9b@mail.gmail.com> References: <55976d0f0807080440u497f830dw3f1b3f98f98d210@mail.gmail.com> <4817b6fc0807080458g6927ca94l3015500ade478c4d@mail.gmail.com> <55976d0f0807080522w2b416192s713e682537e4a9f4@mail.gmail.com> <4817b6fc0807080852u396de9d4hde0a996b7a2dbc9b@mail.gmail.com> Message-ID: <55976d0f0807081630w7bc8a527hcd2680f1e597d01c@mail.gmail.com> Ah, thanks, for some reason I didn't even think to strip the \r's from the moduleSource. 2008/7/9 Dan Eloff : > Sorry, missed the unexpected token '\r' part. The error pretty much > tells you what the problem is, you've got a \r (probably because you > have \r\n line endings, in the the variable moduleSource. You can try > to eliminate those, but you can also just do exec > moduleSource.replace('\r', '') in newModule.__dict__ > > -Dan > > On Tue, Jul 8, 2008 at 7:22 AM, TraumaPony > wrote: > > Ah, true, however, I still get the same error. > > > > 2008/7/8 Dan Eloff : > >> > >> Hi, > >> > >> exec is not a function, it's a statement. > >> > >> exec moduleSource in newModule.__dict__ > >> > >> -Dan > >> > >> On Tue, Jul 8, 2008 at 6:40 AM, TraumaPony < > pontheangelofdeath at gmail.com> > >> wrote: > >> > Hi, I have two questions regarding the IronPython 2.0 B3. > >> > > >> > 1. I'm trying to expose only a few methods from my assembly, but I > >> > haven't > >> > the faintest idea how to do it. The best I can come up with is the > >> > following: > >> > > >> > import clr > >> > clr.AddReference("CoolEngine") > >> > def randomIntNoParams(): > >> > from CoolEngine.Engine.Scripting import ScriptManager > >> > return CoolEngine.Engine.Scripting.ScriptManager.RandomInt() > >> > def randomIntOneParam(i): > >> > from CoolEngine.Engine.Scripting import ScriptManager > >> > return CoolEngine.Engine.Scripting.ScriptManager.RandomInt(i) > >> > def randomIntTwoParams(i, j): > >> > from CoolEngine.Engine.Scripting import ScriptManager > >> > return CoolEngine.Engine.Scripting.ScriptManager.RandomInt(i, j) > >> > def randomIntThreeParams(i, j, k): > >> > from CoolEngine.Engine.Scripting import ScriptManager > >> > return CoolEngine.Engine.Scripting.ScriptManager.RandomInt(i, j, > k) > >> > def randomIntThreeParamsNoReturn(i, j, k): > >> > from CoolEngine.Engine.Scripting import ScriptManager > >> > CoolEngine.Engine.Scripting.ScriptManager.RandomIntNoReturn(i, j, > k) > >> > But alas, it says "name 'CoolEngine' is not defined" . What am I doing > >> > wrong > >> > there? > >> > > >> > 2. I'm trying to create a module dynamically at runtime. I have the > >> > following code which I want to be placed in a module called "Script": > >> > > >> > import clr > >> > clr.AddReference("System.Threading") > >> > def Pause(milliseconds): > >> > from System.Threading.Tasks import Task > >> > Task.CurrentTask.Wait(milliseconds) > >> > > >> > However, I have no idea how to get it into its own module from there, > >> > and > >> > including it in its own file called Script.py is out of the question; > I > >> > have > >> > that code as a string resource in my assembly. > >> > > >> > I'm doing the following: > >> > > >> > Engine.CreateScriptSourceFromString( > >> > > >> > "import imp\n" > >> > > >> > + > >> > > >> > "import sys\n" > >> > > >> > + > >> > > >> > "newModule = imp.new_module(moduleName)\n" > >> > > >> > + > >> > > >> > "exec(moduleSource, newModule.__dict__)\n" > >> > > >> > + > >> > > >> > "sys.modules[moduleName] = newModule" > >> > > >> > , SourceCodeKind.Statements).Execute(scope); > >> > > >> > where the moduleName variable is "Script" and the moduleSource is the > >> > above > >> > source code. However, I get the following message: > >> > > >> > An unhandled exception of type > >> > 'Microsoft.Scripting.SyntaxErrorException' > >> > occurred in Unknown Module. > >> > > >> > Additional information: unexpected token '\r' > >> > > >> > Any ideas? > >> > > >> > > >> > > >> > -- > >> > /"\ > >> > \ / ASCII RIBBON CAMPAIGN > >> > X AGAINST HTML MAIL > >> > / \ > >> > > >> > This message has been encrypted with ROT-26. Any unauthorised > decryption > >> > will result in prosecution to the full extent of the law. > >> > > >> > _______________________________________________ > >> > 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 > > > > > > > > -- > > /"\ > > \ / ASCII RIBBON CAMPAIGN > > X AGAINST HTML MAIL > > / \ > > > > This message has been encrypted with ROT-26. Any unauthorised decryption > > will result in prosecution to the full extent of the law. > > _______________________________________________ > > 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 > -- /"\ \ / ASCII RIBBON CAMPAIGN X AGAINST HTML MAIL / \ This message has been encrypted with ROT-26. Any unauthorised decryption will result in prosecution to the full extent of the law. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdhardy at gmail.com Wed Jul 9 01:30:38 2008 From: jdhardy at gmail.com (Jeff Hardy) Date: Tue, 8 Jul 2008 17:30:38 -0600 Subject: [IronPython] TypeLoadExceptions In-Reply-To: References: Message-ID: Thanks for looking into this, Curt. Best of luck getting it resolved one way or another :). -Jeff On Tue, Jul 8, 2008 at 3:26 PM, Curt Hagenlocher wrote: > Actually, the repro inside IronPython is pretty straightforward. The > following bit of code will do it: > > import array > class Array2(array.array): > __slots__ = ['offset'] > def __init__(self, typecode, data): > self.offset = 0 > > a = Array2('b', [3, 6, 7, 11]) > I was hoping to repro it from a much smaller C# program though :). > > On Tue, Jul 8, 2008 at 11:32 AM, Jeff Hardy wrote: >> >> Hopefully there's a workaround of some kind, because it makes >> debugging pretty painful. Good luck finding the root cause. I've only >> been able to hit it in large applications - Django and CherryPy, and >> haven't been able to find a minimal reproduction. >> >> On Mon, Jul 7, 2008 at 5:57 PM, Curt Hagenlocher >> wrote: >> > On Mon, Jul 7, 2008 at 4:46 PM, Jeff Hardy wrote: >> >> >> >> On Sun, Jul 6, 2008 at 6:36 AM, Curt Hagenlocher >> >> wrote: >> >> > Have you gotten this while not running in the debugger? >> >> >> >> Hi Curt, >> >> I've had a chance to try it without the debugger, and I didn't get a >> >> TypeLoadException. I still get some errors, mind you, but they seem to >> >> be known issues (namely #15399, which is supposed to be fixed in >> >> 2.0b4). >> >> >> >> Any idea what this means? >> > >> > >> > It strongly suggests that there's a bug in the managed debugger. It >> > seems >> > to be triggered by the use of __slots__. We generate a backing CLR >> > class >> > that's templated for Python classes that contain __slots__, and some of >> > the methods on the class are themselves templated but with a different >> > template argument. You can still debug the code with an unmanaged >> > debugger >> > (ie windbg) but it's a significantly less friendly experience. >> > >> > I haven't yet gotten around to reporting this to the managed debug >> > folks, or >> > creating a smaller test case. >> > >> > -- >> > Curt Hagenlocher >> > curt at hagenlocher.org >> > _______________________________________________ >> > 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 dan.eloff at gmail.com Wed Jul 9 01:37:27 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Tue, 8 Jul 2008 18:37:27 -0500 Subject: [IronPython] How to get a System.Exception inside a IronPython except: clause Message-ID: <4817b6fc0807081637y1d157d3br26c80a35c260ea12@mail.gmail.com> This may sound a little similar to some of my other posts on here, the help I received previously has enabled me to get stuck in new and exciting areas :) The stdlib traceback module can be used to format python exceptions, but unfortunately it seems to leave out some information, like clr exception data (thanks Curt and Jimmy for helping me turn that on). So now I find myself thinking how to use Application.Current.Environment.GetEngine('py').FormatException() (thanks Dino) to do a better job. The only trouble is it wants a clr Exception, not a ValueError. Is there any way to call this function with the tools available inside of an except: clause ? Thanks, -Dan From dinov at exchange.microsoft.com Wed Jul 9 01:39:35 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 8 Jul 2008 16:39:35 -0700 Subject: [IronPython] How to get a System.Exception inside a IronPython except: clause In-Reply-To: <4817b6fc0807081637y1d157d3br26c80a35c260ea12@mail.gmail.com> References: <4817b6fc0807081637y1d157d3br26c80a35c260ea12@mail.gmail.com> Message-ID: <7AD436E4270DD54A94238001769C2227012C932993E0@DF-GRTDANE-MSG.exchange.corp.microsoft.com> There's a clsException property that we add to Python exceptions that will give you the CLR Exception for the corresponding Python Exception. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff Sent: Tuesday, July 08, 2008 4:37 PM To: Discussion of IronPython Subject: [IronPython] How to get a System.Exception inside a IronPython except: clause This may sound a little similar to some of my other posts on here, the help I received previously has enabled me to get stuck in new and exciting areas :) The stdlib traceback module can be used to format python exceptions, but unfortunately it seems to leave out some information, like clr exception data (thanks Curt and Jimmy for helping me turn that on). So now I find myself thinking how to use Application.Current.Environment.GetEngine('py').FormatException() (thanks Dino) to do a better job. The only trouble is it wants a clr Exception, not a ValueError. Is there any way to call this function with the tools available inside of an except: clause ? Thanks, -Dan _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From jdhardy at gmail.com Wed Jul 9 02:27:09 2008 From: jdhardy at gmail.com (Jeff Hardy) Date: Tue, 8 Jul 2008 18:27:09 -0600 Subject: [IronPython] Code Formatting on CodePlex Issues Message-ID: Hi all, Is there a way to preserve code formatting when filing codeplex issues? I tried using {{ }} but it didn't seem to work for issues. -Jeff From dan.eloff at gmail.com Wed Jul 9 02:41:14 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Tue, 8 Jul 2008 19:41:14 -0500 Subject: [IronPython] How to get a System.Exception inside a IronPython except: clause In-Reply-To: <7AD436E4270DD54A94238001769C2227012C932993E0@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <4817b6fc0807081637y1d157d3br26c80a35c260ea12@mail.gmail.com> <7AD436E4270DD54A94238001769C2227012C932993E0@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <4817b6fc0807081741w64e29b32lc96330ebe4851f2e@mail.gmail.com> Thanks Dino, That works. Unfortunately FormatException() doesn't add the CLR stack trace, even if it has been enabled in silverlight. If the exception is on the main thread, and if it isn't thrown by the target of an invokation, and you allow the exception to reach the top of the stack, you can see the CLR stack trace. I guess for now, when I need to see the CLR stack trace, the only way around that is to rearrange code so that those conditions are met. Is there anything that can (should?) be done about that? -Dan On Tue, Jul 8, 2008 at 6:39 PM, Dino Viehland wrote: > There's a clsException property that we add to Python exceptions that will give you the CLR Exception for the corresponding Python Exception. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff > Sent: Tuesday, July 08, 2008 4:37 PM > To: Discussion of IronPython > Subject: [IronPython] How to get a System.Exception inside a IronPython except: clause > > This may sound a little similar to some of my other posts on here, the > help I received previously has enabled me to get stuck in new and > exciting areas :) > > The stdlib traceback module can be used to format python exceptions, > but unfortunately it seems to leave out some information, like clr > exception data (thanks Curt and Jimmy for helping me turn that on). So > now I find myself thinking how to use > Application.Current.Environment.GetEngine('py').FormatException() > (thanks Dino) to do a better job. The only trouble is it wants a clr > Exception, not a ValueError. Is there any way to call this function > with the tools available inside of an except: clause ? > > Thanks, > -Dan > _______________________________________________ > 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 dan.eloff at gmail.com Wed Jul 9 03:26:35 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Tue, 8 Jul 2008 20:26:35 -0500 Subject: [IronPython] Possible bug with "with" statement Message-ID: <4817b6fc0807081826m6d88b23cnd6ef1cbf6bb04795@mail.gmail.com> In silverlight, using ipy 2.0b3, I get the following error, but it goes away if I replace the with statement with it's try/finally equiv. I tried to make a minimal reproduction of this but could not. I thought I should post this traceback in case I did find a bug. -Dan ValueError: The type 'System.Void' may not be used as a type argument. beskar\parser.py Line 26: self.compiler = Compiler(self, path, context) Line 27: with file(path, 'rb') as f: Line 28: return self.parse(f.read(), path) Line 29: Line 30: def load_string(self, name, source, context): ValueError at load in beskar\parser.py, line 28 at load in beskar\loader.py, line 18 at load in game\templates\__init__.py, line 8 at load_xaml in game\templates\__init__.py, line 11 at bug in game\__init__.py, line 27 at global_hotkeys in game\hotkeys.py, line 19 CLR Stack Trace: at System.RuntimeType.ThrowIfTypeNeverValidGenericArgument(Type type) at System.RuntimeType.SanityCheckGenericArguments(Type[] genericArguments, Type[] genericParamters) at System.RuntimeType.MakeGenericType(Type[] instantiation) at Microsoft.Scripting.Actions.DynamicSiteHelpers.MakeDynamicSiteTargetType(Type[] types) at Microsoft.Scripting.Actions.DynamicSiteHelpers.MakeDynamicSiteType(Type[] types) at Microsoft.Scripting.Ast.DynamicNodeRewriter.RewriteSite(CallSiteBinder bindingInfo, Type retType, IList`1 args) at Microsoft.Scripting.Ast.DynamicNodeRewriter.Rewrite(ActionExpression node) at Microsoft.Scripting.Ast.TreeRewriter.DefaultRewriteActionExpression(TreeRewriter rewriter, Expression n) at Microsoft.Scripting.Ast.TreeRewriter.RewriteNode(Expression node) at Microsoft.Scripting.Ast.TreeRewriter.DefaultRewriteReturnStatement(TreeRewriter rewriter, Expression n) at Microsoft.Scripting.Ast.TreeRewriter.RewriteNode(Expression node) at Microsoft.Scripting.Ast.TreeRewriter.DefaultRewriteConditionalExpression(TreeRewriter rewriter, Expression n) at Microsoft.Scripting.Ast.TreeRewriter.RewriteNode(Expression node) at Microsoft.Scripting.Ast.TreeRewriter.DefaultRewriteScopeExpression(TreeRewriter rewriter, Expression n) at Microsoft.Scripting.Ast.TreeRewriter.RewriteNode(Expression node) at Microsoft.Scripting.Ast.TreeRewriter.RewriteArray(IList`1 args) at Microsoft.Scripting.Ast.TreeRewriter.DefaultRewriteBlock(TreeRewriter rewriter, Expression n) at Microsoft.Scripting.Ast.TreeRewriter.RewriteNode(Expression node) at Microsoft.Scripting.Ast.TreeRewriter.DefaultRewriteLambdaExpression(TreeRewriter rewriter, Expression n) at Microsoft.Scripting.Ast.TreeRewriter.RewriteNode(Expression node) at Microsoft.Scripting.Ast.LambdaCompiler.AnalyzeLambda(LambdaExpression& lambda) at Microsoft.Scripting.Ast.LambdaCompiler..ctor(Compiler compiler, LambdaExpression lambda, TypeGen typeGen, MethodBase mi, ILGenerator ilg, IList`1 paramTypes, ConstantPool constantPool, Boolean closure, Boolean emitDebugSymbols) at Microsoft.Scripting.Ast.LambdaCompiler.CreateDynamicLambdaCompiler(Compiler compiler, LambdaExpression lambda, String methodName, Type returnType, IList`1 paramTypes, IList`1 paramNames, ConstantPool constantPool, Boolean closure, Boolean emitDebugSymbols) at Microsoft.Scripting.Ast.LambdaCompiler.CompileLambda(LambdaExpression lambda, Type delegateType, Boolean emitDebugSymbols, MethodInfo& method) at Microsoft.Scripting.Ast.LambdaCompiler.CompileLambda[T](LambdaExpression lambda, MethodInfo& method) at Microsoft.Scripting.Actions.SmallRuleSet`1.MakeTarget() at Microsoft.Scripting.Actions.SmallRuleSet`1.GetTarget() at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update3[T,T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) at S$40.load$1320(Closure , Object self, Object path, Object context) at _stub_$3707##2295(Closure , CallSite , CodeContext , Object , Object , Object , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update5[T,T0,T1,T2,T3,T4,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4) at _stub_$3706##2294(Closure , CallSite , CodeContext , Object , Object , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update4[T,T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) at S$42.load$1489(Closure , Object path, Object namespaces) at S$42.load$1489(Closure , Object[] ) at _stub_$3668##2256(Closure , CallSite , CodeContext , Object , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update3[T,T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) at S$26.load$909(Closure , Object template) at _stub_$1047##540(Closure , CallSite , CodeContext , Object , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update3[T,T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) at S$26.load_xaml$910(Closure , Object template, Object namespaces) at S$26.load_xaml$910(Closure , Object[] ) at _stub_$3664##2252(Closure , CallSite , CodeContext , Object , String , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update4[T,T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) at S$4.bug$384(Closure ) at _stub_$375##345(Closure , CallSite , CodeContext , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update2[T,T0,T1,TRet](CallSite site, T0 arg0, T1 arg1) at S$80.global_hotkeys$3425(Closure , Object sender, Object e) at _stub_$3654##2242(Closure , CallSite , CodeContext , Object , Object , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update4[T,T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) at System.Void(Object, KeyEventArgs)(Object[] , Object , KeyEventArgs ) at System.Windows.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args) at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName) From Colin.Han at grapecity.com Wed Jul 9 03:24:48 2008 From: Colin.Han at grapecity.com (Han Kejing) Date: Wed, 9 Jul 2008 09:24:48 +0800 Subject: [IronPython] Two questions regarding exposing an API. In-Reply-To: <55976d0f0807080440u497f830dw3f1b3f98f98d210@mail.gmail.com> References: <55976d0f0807080440u497f830dw3f1b3f98f98d210@mail.gmail.com> Message-ID: <8FAE2A142FCABE4EB6B37348D78A9BFE02629EB6@XAEXG.GRAPECITY.NET> About first question, I think it should be write as follows. Because you just input ScriptManager symbol to current scope. You had not import CoolEngine into your current scope. import clr clr.AddReference("CoolEngine") def randomIntNoParams(): from CoolEngine.Engine.Scripting import ScriptManager return ScriptManager.RandomInt() def randomIntOneParam(i): from CoolEngine.Engine.Scripting import ScriptManager return ScriptManager.RandomInt(i) def randomIntTwoParams(i, j): from CoolEngine.Engine.Scripting import ScriptManager return ScriptManager.RandomInt(i, j) def randomIntThreeParams(i, j, k): from CoolEngine.Engine.Scripting import ScriptManager return ScriptManager.RandomInt(i, j, k) def randomIntThreeParamsNoReturn(i, j, k): from CoolEngine.Engine.Scripting import ScriptManager ScriptManager.RandomIntNoReturn(i, j, k) ---------------------------------------------------------------- Follow my heart Colin Han @ MultiRow Developer Team (A Strong Team) From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of TraumaPony Sent: 2008?7?8? 19:41 To: users at lists.ironpython.com Subject: [IronPython] Two questions regarding exposing an API. Hi, I have two questions regarding the IronPython 2.0 B3. 1. I'm trying to expose only a few methods from my assembly, but I haven't the faintest idea how to do it. The best I can come up with is the following: import clr clr.AddReference("CoolEngine") def randomIntNoParams(): from CoolEngine.Engine.Scripting import ScriptManager return CoolEngine.Engine.Scripting.ScriptManager.RandomInt() def randomIntOneParam(i): from CoolEngine.Engine.Scripting import ScriptManager return CoolEngine.Engine.Scripting.ScriptManager.RandomInt(i) def randomIntTwoParams(i, j): from CoolEngine.Engine.Scripting import ScriptManager return CoolEngine.Engine.Scripting.ScriptManager.RandomInt(i, j) def randomIntThreeParams(i, j, k): from CoolEngine.Engine.Scripting import ScriptManager return CoolEngine.Engine.Scripting.ScriptManager.RandomInt(i, j, k) def randomIntThreeParamsNoReturn(i, j, k): from CoolEngine.Engine.Scripting import ScriptManager CoolEngine.Engine.Scripting.ScriptManager.RandomIntNoReturn(i, j, k) But alas, it says "name 'CoolEngine' is not defined" . What am I doing wrong there? 2. I'm trying to create a module dynamically at runtime. I have the following code which I want to be placed in a module called "Script": import clr clr.AddReference("System.Threading") def Pause(milliseconds): from System.Threading.Tasks import Task Task.CurrentTask.Wait(milliseconds) However, I have no idea how to get it into its own module from there, and including it in its own file called Script.py is out of the question; I have that code as a string resource in my assembly. I'm doing the following: Engine.CreateScriptSourceFromString( "import imp\n" + "import sys\n" + "newModule = imp.new_module(moduleName)\n" + "exec(moduleSource, newModule.__dict__)\n" + "sys.modules[moduleName] = newModule" , SourceCodeKind.Statements).Execute(scope); where the moduleName variable is "Script" and the moduleSource is the above source code. However, I get the following message: An unhandled exception of type 'Microsoft.Scripting.SyntaxErrorException' occurred in Unknown Module. Additional information: unexpected token '\r' Any ideas? -- /"\ \ / ASCII RIBBON CAMPAIGN X AGAINST HTML MAIL / \ This message has been encrypted with ROT-26. Any unauthorised decryption will result in prosecution to the full extent of the law. -------------- next part -------------- An HTML attachment was scrubbed... URL: From pontheangelofdeath at gmail.com Wed Jul 9 04:47:32 2008 From: pontheangelofdeath at gmail.com (TraumaPony) Date: Wed, 9 Jul 2008 12:47:32 +1000 Subject: [IronPython] Two questions regarding exposing an API. In-Reply-To: <8FAE2A142FCABE4EB6B37348D78A9BFE02629EB6@XAEXG.GRAPECITY.NET> References: <55976d0f0807080440u497f830dw3f1b3f98f98d210@mail.gmail.com> <8FAE2A142FCABE4EB6B37348D78A9BFE02629EB6@XAEXG.GRAPECITY.NET> Message-ID: <55976d0f0807081947s295673fat8eb4ce5c0ed54d27@mail.gmail.com> Ah yeah, that worked. I'm a bit rusty on Python, heh. Thanks :D 2008/7/9 Han Kejing : > About first question, I think it should be write as follows. Because you > just input ScriptManager symbol to current scope. You had not import > CoolEngine into your current scope. > > > > import clr > clr.AddReference("CoolEngine") > def randomIntNoParams(): > from CoolEngine.Engine.Scripting import ScriptManager > return ScriptManager.RandomInt() > def randomIntOneParam(i): > from CoolEngine.Engine.Scripting import ScriptManager > return ScriptManager.RandomInt(i) > def randomIntTwoParams(i, j): > from CoolEngine.Engine.Scripting import ScriptManager > return ScriptManager.RandomInt(i, j) > def randomIntThreeParams(i, j, k): > from CoolEngine.Engine.Scripting import ScriptManager > return ScriptManager.RandomInt(i, j, k) > def randomIntThreeParamsNoReturn(i, j, k): > from CoolEngine.Engine.Scripting import ScriptManager > ScriptManager.RandomIntNoReturn(i, j, k) > > > > > > ---------------------------------------------------------------- > > Follow my heart > > *Colin Han** **@* *MultiRow Developer Team (A Strong Team)* > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *TraumaPony > *Sent:* 2008?7?8? 19:41 > *To:* users at lists.ironpython.com > *Subject:* [IronPython] Two questions regarding exposing an API. > > > > Hi, I have two questions regarding the IronPython 2.0 B3. > > > > 1. I'm trying to expose only a few methods from my assembly, but I haven't > the faintest idea how to do it. The best I can come up with is the > following: > > > > import clr > clr.AddReference("CoolEngine") > def randomIntNoParams(): > from CoolEngine.Engine.Scripting import ScriptManager > return CoolEngine.Engine.Scripting.ScriptManager.RandomInt() > def randomIntOneParam(i): > from CoolEngine.Engine.Scripting import ScriptManager > return CoolEngine.Engine.Scripting.ScriptManager.RandomInt(i) > def randomIntTwoParams(i, j): > from CoolEngine.Engine.Scripting import ScriptManager > return CoolEngine.Engine.Scripting.ScriptManager.RandomInt(i, j) > def randomIntThreeParams(i, j, k): > from CoolEngine.Engine.Scripting import ScriptManager > return CoolEngine.Engine.Scripting.ScriptManager.RandomInt(i, j, k) > def randomIntThreeParamsNoReturn(i, j, k): > from CoolEngine.Engine.Scripting import ScriptManager > CoolEngine.Engine.Scripting.ScriptManager.RandomIntNoReturn(i, j, k) > > > But alas, it says "name 'CoolEngine' is not defined" . What am I doing > wrong there? > > > > 2. I'm trying to create a module dynamically at runtime. I have the > following code which I want to be placed in a module called "Script": > > > > import clr > clr.AddReference("System.Threading") > def Pause(milliseconds): > from System.Threading.Tasks import Task > Task.CurrentTask.Wait(milliseconds) > > However, I have no idea how to get it into its own module from there, and > including it in its own file called Script.py is out of the question; I have > that code as a string resource in my assembly. > > I'm doing the following: > > *Engine.CreateScriptSourceFromString(* > > *"import imp\n"* > > *+ * > > *"import sys\n"* > > *+ * > > *"newModule = imp.new_module(moduleName)\n"* > > *+ * > > *"exec(moduleSource, newModule.__dict__)\n"* > > *+ * > > *"sys.modules[moduleName] = newModule"* > > *, *SourceCodeKind*.Statements).Execute(scope);* > > where the moduleName variable is "Script" and the moduleSource is the above > source code. However, I get the following message: > > An unhandled exception of type 'Microsoft.Scripting.SyntaxErrorException' > occurred in Unknown Module. > > Additional information: unexpected token '\r' > > Any ideas? > > > > -- > /"\ > \ / ASCII RIBBON CAMPAIGN > X AGAINST HTML MAIL > / \ > > This message has been encrypted with ROT-26. Any unauthorised decryption > will result in prosecution to the full extent of the law. > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -- /"\ \ / ASCII RIBBON CAMPAIGN X AGAINST HTML MAIL / \ This message has been encrypted with ROT-26. Any unauthorised decryption will result in prosecution to the full extent of the law. -------------- next part -------------- An HTML attachment was scrubbed... URL: From pontheangelofdeath at gmail.com Wed Jul 9 05:50:47 2008 From: pontheangelofdeath at gmail.com (TraumaPony) Date: Wed, 9 Jul 2008 13:50:47 +1000 Subject: [IronPython] Accessing static properties in 2.0b3 Message-ID: <55976d0f0807082050o7cc43ba4w2b0d456971d4e6cf@mail.gmail.com> Hi, I'm having trouble accessing static properties in my code. Here's what I have: import clr clr.AddReference("System.Threading") def CurrentTask(): from System.Threading.Tasks import Task return Task.CurrentTask def Pause(timeout): CurrentTask().Wait(timeout) However, when I call CurrentTask(), I get an error: An unhandled exception of type 'System.MissingMemberException' occurred in Unknown Module. Additional information: 'type' object has no attribute 'CurrentTask' What am I doing wrong? -------------- next part -------------- An HTML attachment was scrubbed... URL: From Colin.Han at grapecity.com Wed Jul 9 05:53:47 2008 From: Colin.Han at grapecity.com (Han Kejing) Date: Wed, 9 Jul 2008 11:53:47 +0800 Subject: [IronPython] Are there anyone had embedded IronPython or other dynamic language into a biz solution. Message-ID: <8FAE2A142FCABE4EB6B37348D78A9BFE0262A008@XAEXG.GRAPECITY.NET> Hi, all, I have some ideas. I want embed dynamic language into my biz solution. But I have some cares for this idea. I want discuss this topic in here. J If you had complete an biz solution and publish it to an user, Can you tell me: who is user of your solution? why you select dynamic language? how about user's feedback? This is an open topic, you can talk any things that you feel about this work. Thanks you all. ---------------------------------------------------------------- Do ONE thing, and do it WELL. Colin Han @ GrapeCity -------------- next part -------------- An HTML attachment was scrubbed... URL: From pontheangelofdeath at gmail.com Wed Jul 9 06:19:16 2008 From: pontheangelofdeath at gmail.com (TraumaPony) Date: Wed, 9 Jul 2008 14:19:16 +1000 Subject: [IronPython] Accessing static properties in 2.0b3 In-Reply-To: <55976d0f0807082050o7cc43ba4w2b0d456971d4e6cf@mail.gmail.com> References: <55976d0f0807082050o7cc43ba4w2b0d456971d4e6cf@mail.gmail.com> Message-ID: <55976d0f0807082119k18a6f466rda22191f0f76c543@mail.gmail.com> Sorry, please disregard this. I forgot that it was Task.Current, not CurrentTask. My bad. 2008/7/9 TraumaPony : > Hi, I'm having trouble accessing static properties in my code. Here's what > I have: > > import clr > > clr.AddReference("System.Threading") > > def CurrentTask(): > from System.Threading.Tasks import Task > return Task.CurrentTask > > def Pause(timeout): > CurrentTask().Wait(timeout) > > However, when I call CurrentTask(), I get an error: > > An unhandled exception of type 'System.MissingMemberException' occurred in > Unknown Module. > > Additional information: 'type' object has no attribute 'CurrentTask' > > What am I doing wrong? > -- /"\ \ / ASCII RIBBON CAMPAIGN X AGAINST HTML MAIL / \ This message has been encrypted with ROT-26. Any unauthorised decryption will result in prosecution to the full extent of the law. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dan.eloff at gmail.com Wed Jul 9 06:34:14 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Tue, 8 Jul 2008 23:34:14 -0500 Subject: [IronPython] Silverlight wierdness with __slots__ Message-ID: <4817b6fc0807082134w6fa44f0du65ed060fb7e24234@mail.gmail.com> Looks like I've been making work for you folks tonight :( I seem to have encountered some trouble with slots, but the very strange thing is, it only seems to happen in silverlight. I run over this code a lot in my test suite, and it passes (running with wpf.) If I comment out the __slots__ = ('blocks',) it works. Any idea if I'm doing something wrong or if it's a problem in IronPython? I thought perhaps I'm mixing assemblies by mistake, but I copied all IronPython 2.0b3 .dlls from the silverlight folder, right into my .xap Here's the traceback. Code for the offending class hierarchy is available if it will be helpful. I'm trying to figure out why I'm having so many issues I never see outside of silverlight. -Dan SystemError: Ambiguous match found. beskar\tags.py Line 97: Line 98: def __init__(self): Line 99: self.blocks = [] # stack Line 100: Line 101: def data(self, compiler, code): SystemError at __init__ in beskar\tags.py, line 99 at StartElementHandler in beskar\parser.py, line 53 at _StartElementHandler in beskar\xml.py, line 51 at Parse in beskar\xml.py, line 38 at parse in beskar\parser.py, line 37 at load in beskar\parser.py, line 27 at load in beskar\loader.py, line 18 at load in game\templates\__init__.py, line 8 at load_xaml in game\templates\__init__.py, line 11 at bug in game\__init__.py, line 27 at global_hotkeys in game\hotkeys.py, line 19 CLR Stack Trace: at System.RuntimeType.GetPropertyImpl(String name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers) at System.Type.GetProperty(String name) at IronPython.Runtime.Types.ReflectedSlotProperty.CreateSetter() at IronPython.Runtime.Types.ReflectedSlotProperty.EnsureSetter(SlotValue value) at IronPython.Runtime.Types.ReflectedSlotProperty.get_SetterMethod() at IronPython.Runtime.Operations.UserTypeOps.MakeSlotsSetTarget[T](CodeContext context, RuleBuilder`1 rule, ReflectedSlotProperty rsp, Expression value) at IronPython.Runtime.Operations.UserTypeOps.MakeSlotsSetTarget[T](CodeContext context, RuleBuilder`1 rule, ReflectedSlotProperty rsp) at IronPython.Runtime.Operations.UserTypeOps.MakeSetMemberRule[T](CodeContext context, SetMemberAction action, Object[] args) at IronPython.Runtime.Operations.UserTypeOps.GetRuleHelper[T](DynamicAction action, CodeContext context, Object[] args) at IronPython.NewTypes.System.Object_6$6.GetRule[T](DynamicAction , CodeContext , Object[] ) at IronPython.Runtime.Calls.PythonBinder.MakeRule[T](DynamicAction action, Object[] args) at Microsoft.Scripting.Actions.ActionBinder.Bind[T](DynamicAction action, Object[] args) at Microsoft.Scripting.Actions.MemberAction.Bind[T](Object[] args) at Microsoft.Scripting.Actions.CallSite`1.CreateNewRule(Rule`1 originalMonomorphicRule, Object[] args) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update3[T,T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) at S$41.__init__$1355(Closure , Object self) at _stub_$3420##2008(Closure , CallSite , CodeContext , Object , Object ) at _stub_$749##498(Closure , CallSite , CodeContext , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update2[T,T0,T1,TRet](CallSite site, T0 arg0, T1 arg1) at _stub_$3820##2408(Closure , CallSite , CodeContext , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update2[T,T0,T1,TRet](CallSite site, T0 arg0, T1 arg1) at S$40.StartElementHandler$1324(Closure , Object self, Object name, Object attrs) at _stub_$3784##2372(Closure , CallSite , CodeContext , Object , Object , Object , Object ) at _stub_$3783##2371(Closure , CallSite , CodeContext , Object , Object , Object ) at S$35._StartElementHandler$1200(Closure , Object self, Object r) at _stub_$3764##2352(Closure , CallSite , CodeContext , Object , Object , Object ) at _stub_$3763##2351(Closure , CallSite , CodeContext , Object , Object ) at S$35.Parse$1199(Closure , Object self, Object data) at _stub_$3025##1616(Closure , CallSite , CodeContext , Object , Object , Object ) at _stub_$650##430(Closure , CallSite , CodeContext , Object , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update3[T,T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) at S$40.parse$1322(Closure , Object self, Object data, Object name) at _stub_$3731##2319(Closure , CallSite , CodeContext , Object , Object , Object , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update5[T,T0,T1,T2,T3,T4,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4) at _stub_$3730##2318(Closure , CallSite , CodeContext , Object , Object , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update4[T,T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) at S$40.load$1320(Closure , Object self, Object path, Object context) at _stub_$3706##2294(Closure , CallSite , CodeContext , Object , Object , Object , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update5[T,T0,T1,T2,T3,T4,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4) at _stub_$3705##2293(Closure , CallSite , CodeContext , Object , Object , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update4[T,T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) at S$42.load$1488(Closure , Object path, Object namespaces) at S$42.load$1488(Closure , Object[] ) at _stub_$3667##2255(Closure , CallSite , CodeContext , Object , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update3[T,T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) at S$26.load$909(Closure , Object template) at _stub_$1047##540(Closure , CallSite , CodeContext , Object , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update3[T,T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) at S$26.load_xaml$910(Closure , Object template, Object namespaces) at S$26.load_xaml$910(Closure , Object[] ) at _stub_$3663##2251(Closure , CallSite , CodeContext , Object , String , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update4[T,T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) at S$4.bug$384(Closure ) at _stub_$375##345(Closure , CallSite , CodeContext , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update2[T,T0,T1,TRet](CallSite site, T0 arg0, T1 arg1) at S$80.global_hotkeys$3314(Closure , Object sender, Object e) at _stub_$3653##2241(Closure , CallSite , CodeContext , Object , Object , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update4[T,T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) at System.Void(Object, KeyEventArgs)(Object[] , Object , KeyEventArgs ) at System.Windows.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args) at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName) From Jimmy.Schementi at microsoft.com Wed Jul 9 07:09:01 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Tue, 8 Jul 2008 22:09:01 -0700 Subject: [IronPython] Silverlight wierdness with __slots__ In-Reply-To: <4817b6fc0807082134w6fa44f0du65ed060fb7e24234@mail.gmail.com> References: <4817b6fc0807082134w6fa44f0du65ed060fb7e24234@mail.gmail.com> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A32845D41AFA44@NA-EXMSG-C116.redmond.corp.microsoft.com> Yes you are :) I'll give this a try at repoing, and let you know what I find. ~js ________________________________________ From: users-bounces at lists.ironpython.com [users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff [dan.eloff at gmail.com] Sent: Tuesday, July 08, 2008 9:34 PM To: Discussion of IronPython Subject: [IronPython] Silverlight wierdness with __slots__ Looks like I've been making work for you folks tonight :( I seem to have encountered some trouble with slots, but the very strange thing is, it only seems to happen in silverlight. I run over this code a lot in my test suite, and it passes (running with wpf.) If I comment out the __slots__ = ('blocks',) it works. Any idea if I'm doing something wrong or if it's a problem in IronPython? I thought perhaps I'm mixing assemblies by mistake, but I copied all IronPython 2.0b3 .dlls from the silverlight folder, right into my .xap Here's the traceback. Code for the offending class hierarchy is available if it will be helpful. I'm trying to figure out why I'm having so many issues I never see outside of silverlight. -Dan SystemError: Ambiguous match found. beskar\tags.py Line 97: Line 98: def __init__(self): Line 99: self.blocks = [] # stack Line 100: Line 101: def data(self, compiler, code): SystemError at __init__ in beskar\tags.py, line 99 at StartElementHandler in beskar\parser.py, line 53 at _StartElementHandler in beskar\xml.py, line 51 at Parse in beskar\xml.py, line 38 at parse in beskar\parser.py, line 37 at load in beskar\parser.py, line 27 at load in beskar\loader.py, line 18 at load in game\templates\__init__.py, line 8 at load_xaml in game\templates\__init__.py, line 11 at bug in game\__init__.py, line 27 at global_hotkeys in game\hotkeys.py, line 19 CLR Stack Trace: at System.RuntimeType.GetPropertyImpl(String name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers) at System.Type.GetProperty(String name) at IronPython.Runtime.Types.ReflectedSlotProperty.CreateSetter() at IronPython.Runtime.Types.ReflectedSlotProperty.EnsureSetter(SlotValue value) at IronPython.Runtime.Types.ReflectedSlotProperty.get_SetterMethod() at IronPython.Runtime.Operations.UserTypeOps.MakeSlotsSetTarget[T](CodeContext context, RuleBuilder`1 rule, ReflectedSlotProperty rsp, Expression value) at IronPython.Runtime.Operations.UserTypeOps.MakeSlotsSetTarget[T](CodeContext context, RuleBuilder`1 rule, ReflectedSlotProperty rsp) at IronPython.Runtime.Operations.UserTypeOps.MakeSetMemberRule[T](CodeContext context, SetMemberAction action, Object[] args) at IronPython.Runtime.Operations.UserTypeOps.GetRuleHelper[T](DynamicAction action, CodeContext context, Object[] args) at IronPython.NewTypes.System.Object_6$6.GetRule[T](DynamicAction , CodeContext , Object[] ) at IronPython.Runtime.Calls.PythonBinder.MakeRule[T](DynamicAction action, Object[] args) at Microsoft.Scripting.Actions.ActionBinder.Bind[T](DynamicAction action, Object[] args) at Microsoft.Scripting.Actions.MemberAction.Bind[T](Object[] args) at Microsoft.Scripting.Actions.CallSite`1.CreateNewRule(Rule`1 originalMonomorphicRule, Object[] args) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update3[T,T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) at S$41.__init__$1355(Closure , Object self) at _stub_$3420##2008(Closure , CallSite , CodeContext , Object , Object ) at _stub_$749##498(Closure , CallSite , CodeContext , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update2[T,T0,T1,TRet](CallSite site, T0 arg0, T1 arg1) at _stub_$3820##2408(Closure , CallSite , CodeContext , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update2[T,T0,T1,TRet](CallSite site, T0 arg0, T1 arg1) at S$40.StartElementHandler$1324(Closure , Object self, Object name, Object attrs) at _stub_$3784##2372(Closure , CallSite , CodeContext , Object , Object , Object , Object ) at _stub_$3783##2371(Closure , CallSite , CodeContext , Object , Object , Object ) at S$35._StartElementHandler$1200(Closure , Object self, Object r) at _stub_$3764##2352(Closure , CallSite , CodeContext , Object , Object , Object ) at _stub_$3763##2351(Closure , CallSite , CodeContext , Object , Object ) at S$35.Parse$1199(Closure , Object self, Object data) at _stub_$3025##1616(Closure , CallSite , CodeContext , Object , Object , Object ) at _stub_$650##430(Closure , CallSite , CodeContext , Object , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update3[T,T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) at S$40.parse$1322(Closure , Object self, Object data, Object name) at _stub_$3731##2319(Closure , CallSite , CodeContext , Object , Object , Object , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update5[T,T0,T1,T2,T3,T4,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4) at _stub_$3730##2318(Closure , CallSite , CodeContext , Object , Object , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update4[T,T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) at S$40.load$1320(Closure , Object self, Object path, Object context) at _stub_$3706##2294(Closure , CallSite , CodeContext , Object , Object , Object , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update5[T,T0,T1,T2,T3,T4,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4) at _stub_$3705##2293(Closure , CallSite , CodeContext , Object , Object , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update4[T,T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) at S$42.load$1488(Closure , Object path, Object namespaces) at S$42.load$1488(Closure , Object[] ) at _stub_$3667##2255(Closure , CallSite , CodeContext , Object , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update3[T,T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) at S$26.load$909(Closure , Object template) at _stub_$1047##540(Closure , CallSite , CodeContext , Object , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update3[T,T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) at S$26.load_xaml$910(Closure , Object template, Object namespaces) at S$26.load_xaml$910(Closure , Object[] ) at _stub_$3663##2251(Closure , CallSite , CodeContext , Object , String , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update4[T,T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) at S$4.bug$384(Closure ) at _stub_$375##345(Closure , CallSite , CodeContext , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update2[T,T0,T1,TRet](CallSite site, T0 arg0, T1 arg1) at S$80.global_hotkeys$3314(Closure , Object sender, Object e) at _stub_$3653##2241(Closure , CallSite , CodeContext , Object , Object , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update4[T,T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) at System.Void(Object, KeyEventArgs)(Object[] , Object , KeyEventArgs ) at System.Windows.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args) at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName) _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dan.eloff at gmail.com Wed Jul 9 18:47:03 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Wed, 9 Jul 2008 11:47:03 -0500 Subject: [IronPython] Silverlight wierdness with __slots__ In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A32845D41AFA44@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <4817b6fc0807082134w6fa44f0du65ed060fb7e24234@mail.gmail.com> <5283CA0A4168DF4FBBD71AE9ECA5A32845D41AFA44@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <4817b6fc0807090947j4dda40e2g1d7efd70f864a620@mail.gmail.com> Here's a repro. Just ignore scroll straight to the bottom of app.py, the other stuff is boilerplate I always include. -Dan On Wed, Jul 9, 2008 at 12:09 AM, Jimmy Schementi wrote: > Yes you are :) I'll give this a try at repoing, and let you know what I find. > > ~js > ________________________________________ > From: users-bounces at lists.ironpython.com [users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff [dan.eloff at gmail.com] > Sent: Tuesday, July 08, 2008 9:34 PM > To: Discussion of IronPython > Subject: [IronPython] Silverlight wierdness with __slots__ > > Looks like I've been making work for you folks tonight :( > > I seem to have encountered some trouble with slots, but the very > strange thing is, it only seems to happen in silverlight. I run over > this code a lot in my test suite, and it passes (running with wpf.) If > I comment out the __slots__ = ('blocks',) it works. Any idea if I'm > doing something wrong or if it's a problem in IronPython? > > I thought perhaps I'm mixing assemblies by mistake, but I copied all > IronPython 2.0b3 .dlls from the silverlight folder, right into my .xap > > Here's the traceback. Code for the offending class hierarchy is > available if it will be helpful. > > I'm trying to figure out why I'm having so many issues I never see > outside of silverlight. > > -Dan > > SystemError: Ambiguous match found. > beskar\tags.py > Line 97: > Line 98: def __init__(self): > Line 99: self.blocks = [] # stack > Line 100: > Line 101: def data(self, compiler, code): > > SystemError > at __init__ in beskar\tags.py, line 99 > at StartElementHandler in beskar\parser.py, line 53 > at _StartElementHandler in beskar\xml.py, line 51 > at Parse in beskar\xml.py, line 38 > at parse in beskar\parser.py, line 37 > at load in beskar\parser.py, line 27 > at load in beskar\loader.py, line 18 > at load in game\templates\__init__.py, line 8 > at load_xaml in game\templates\__init__.py, line 11 > at bug in game\__init__.py, line 27 > at global_hotkeys in game\hotkeys.py, line 19 > CLR Stack Trace: > at System.RuntimeType.GetPropertyImpl(String name, BindingFlags > bindingAttr, Binder binder, Type returnType, Type[] types, > ParameterModifier[] modifiers) > at System.Type.GetProperty(String name) > at IronPython.Runtime.Types.ReflectedSlotProperty.CreateSetter() > at IronPython.Runtime.Types.ReflectedSlotProperty.EnsureSetter(SlotValue > value) > at IronPython.Runtime.Types.ReflectedSlotProperty.get_SetterMethod() > at IronPython.Runtime.Operations.UserTypeOps.MakeSlotsSetTarget[T](CodeContext > context, RuleBuilder`1 rule, ReflectedSlotProperty rsp, Expression > value) > at IronPython.Runtime.Operations.UserTypeOps.MakeSlotsSetTarget[T](CodeContext > context, RuleBuilder`1 rule, ReflectedSlotProperty rsp) > at IronPython.Runtime.Operations.UserTypeOps.MakeSetMemberRule[T](CodeContext > context, SetMemberAction action, Object[] args) > at IronPython.Runtime.Operations.UserTypeOps.GetRuleHelper[T](DynamicAction > action, CodeContext context, Object[] args) > at IronPython.NewTypes.System.Object_6$6.GetRule[T](DynamicAction , > CodeContext , Object[] ) > at IronPython.Runtime.Calls.PythonBinder.MakeRule[T](DynamicAction > action, Object[] args) > at Microsoft.Scripting.Actions.ActionBinder.Bind[T](DynamicAction > action, Object[] args) > at Microsoft.Scripting.Actions.MemberAction.Bind[T](Object[] args) > at Microsoft.Scripting.Actions.CallSite`1.CreateNewRule(Rule`1 > originalMonomorphicRule, Object[] args) > at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) > at Microsoft.Scripting.Actions.UpdateDelegates.Update3[T,T0,T1,T2,TRet](CallSite > site, T0 arg0, T1 arg1, T2 arg2) > at S$41.__init__$1355(Closure , Object self) > at _stub_$3420##2008(Closure , CallSite , CodeContext , Object , Object ) > at _stub_$749##498(Closure , CallSite , CodeContext , Object ) > at _stub_MatchCaller(Object , CallSite , Object[] ) > at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) > at Microsoft.Scripting.Actions.UpdateDelegates.Update2[T,T0,T1,TRet](CallSite > site, T0 arg0, T1 arg1) > at _stub_$3820##2408(Closure , CallSite , CodeContext , Object ) > at _stub_MatchCaller(Object , CallSite , Object[] ) > at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) > at Microsoft.Scripting.Actions.UpdateDelegates.Update2[T,T0,T1,TRet](CallSite > site, T0 arg0, T1 arg1) > at S$40.StartElementHandler$1324(Closure , Object self, Object > name, Object attrs) > at _stub_$3784##2372(Closure , CallSite , CodeContext , Object , > Object , Object , Object ) > at _stub_$3783##2371(Closure , CallSite , CodeContext , Object , > Object , Object ) > at S$35._StartElementHandler$1200(Closure , Object self, Object r) > at _stub_$3764##2352(Closure , CallSite , CodeContext , Object , > Object , Object ) > at _stub_$3763##2351(Closure , CallSite , CodeContext , Object , Object ) > at S$35.Parse$1199(Closure , Object self, Object data) > at _stub_$3025##1616(Closure , CallSite , CodeContext , Object , > Object , Object ) > at _stub_$650##430(Closure , CallSite , CodeContext , Object , Object ) > at _stub_MatchCaller(Object , CallSite , Object[] ) > at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) > at Microsoft.Scripting.Actions.UpdateDelegates.Update3[T,T0,T1,T2,TRet](CallSite > site, T0 arg0, T1 arg1, T2 arg2) > at S$40.parse$1322(Closure , Object self, Object data, Object name) > at _stub_$3731##2319(Closure , CallSite , CodeContext , Object , > Object , Object , Object ) > at _stub_MatchCaller(Object , CallSite , Object[] ) > at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) > at Microsoft.Scripting.Actions.UpdateDelegates.Update5[T,T0,T1,T2,T3,T4,TRet](CallSite > site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4) > at _stub_$3730##2318(Closure , CallSite , CodeContext , Object , > Object , Object ) > at _stub_MatchCaller(Object , CallSite , Object[] ) > at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) > at Microsoft.Scripting.Actions.UpdateDelegates.Update4[T,T0,T1,T2,T3,TRet](CallSite > site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) > at S$40.load$1320(Closure , Object self, Object path, Object context) > at _stub_$3706##2294(Closure , CallSite , CodeContext , Object , > Object , Object , Object ) > at _stub_MatchCaller(Object , CallSite , Object[] ) > at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) > at Microsoft.Scripting.Actions.UpdateDelegates.Update5[T,T0,T1,T2,T3,T4,TRet](CallSite > site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4) > at _stub_$3705##2293(Closure , CallSite , CodeContext , Object , > Object , Object ) > at _stub_MatchCaller(Object , CallSite , Object[] ) > at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) > at Microsoft.Scripting.Actions.UpdateDelegates.Update4[T,T0,T1,T2,T3,TRet](CallSite > site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) > at S$42.load$1488(Closure , Object path, Object namespaces) > at S$42.load$1488(Closure , Object[] ) > at _stub_$3667##2255(Closure , CallSite , CodeContext , Object , Object ) > at _stub_MatchCaller(Object , CallSite , Object[] ) > at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) > at Microsoft.Scripting.Actions.UpdateDelegates.Update3[T,T0,T1,T2,TRet](CallSite > site, T0 arg0, T1 arg1, T2 arg2) > at S$26.load$909(Closure , Object template) > at _stub_$1047##540(Closure , CallSite , CodeContext , Object , Object ) > at _stub_MatchCaller(Object , CallSite , Object[] ) > at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) > at Microsoft.Scripting.Actions.UpdateDelegates.Update3[T,T0,T1,T2,TRet](CallSite > site, T0 arg0, T1 arg1, T2 arg2) > at S$26.load_xaml$910(Closure , Object template, Object namespaces) > at S$26.load_xaml$910(Closure , Object[] ) > at _stub_$3663##2251(Closure , CallSite , CodeContext , Object , > String , Object ) > at _stub_MatchCaller(Object , CallSite , Object[] ) > at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) > at Microsoft.Scripting.Actions.UpdateDelegates.Update4[T,T0,T1,T2,T3,TRet](CallSite > site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) > at S$4.bug$384(Closure ) > at _stub_$375##345(Closure , CallSite , CodeContext , Object ) > at _stub_MatchCaller(Object , CallSite , Object[] ) > at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) > at Microsoft.Scripting.Actions.UpdateDelegates.Update2[T,T0,T1,TRet](CallSite > site, T0 arg0, T1 arg1) > at S$80.global_hotkeys$3314(Closure , Object sender, Object e) > at _stub_$3653##2241(Closure , CallSite , CodeContext , Object , > Object , Object ) > at _stub_MatchCaller(Object , CallSite , Object[] ) > at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) > at Microsoft.Scripting.Actions.UpdateDelegates.Update4[T,T0,T1,T2,T3,TRet](CallSite > site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) > at System.Void(Object, KeyEventArgs)(Object[] , Object , KeyEventArgs ) > at System.Windows.CoreInvokeHandler.InvokeEventHandler(Int32 > typeIndex, Delegate handlerDelegate, Object sender, Object args) > at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr > unmanagedObjArgs, Int32 argsTypeIndex, String eventName) > _______________________________________________ > 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: slots_bug.zip Type: application/zip Size: 5206 bytes Desc: not available URL: From dinov at exchange.microsoft.com Wed Jul 9 22:09:15 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 9 Jul 2008 13:09:15 -0700 Subject: [IronPython] Code Formatting on CodePlex Issues In-Reply-To: References: Message-ID: <7AD436E4270DD54A94238001769C2227012C9329956B@DF-GRTDANE-MSG.exchange.corp.microsoft.com> I usually click on edit and I get back the original form of the text. I realize that's not going to work for people who can't edit bugs but the good news is the formatting is preserved, it just doesn't show up when you look at it as HTML. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jeff Hardy Sent: Tuesday, July 08, 2008 5:27 PM To: Discussion of IronPython Subject: [IronPython] Code Formatting on CodePlex Issues Hi all, Is there a way to preserve code formatting when filing codeplex issues? I tried using {{ }} but it didn't seem to work for issues. -Jeff _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Wed Jul 9 22:25:33 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 9 Jul 2008 13:25:33 -0700 Subject: [IronPython] Possible bug with "with" statement In-Reply-To: <4817b6fc0807081826m6d88b23cnd6ef1cbf6bb04795@mail.gmail.com> References: <4817b6fc0807081826m6d88b23cnd6ef1cbf6bb04795@mail.gmail.com> Message-ID: <7AD436E4270DD54A94238001769C2227012C93299570@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Definitely a bug - it also repros on the desktop CLR. It repros with just: from __future__ import with_statement with file('hello.txt', 'w') as f: raise Exception so it looks like the exception code path is broken. The underlying problem is that we end up trying to dynamically convert void -> bool which doesn't work. Ultimately this is a defect in the way that we deal with return values in dynamic sites. We're doing some work to clean this up (it works on one of my enlistments already :) ) so it'll probably be fixed for beta 4. I've opened bug #17323 to track it - http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=17323. Thanks for the bug report! -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff Sent: Tuesday, July 08, 2008 6:27 PM To: Discussion of IronPython Subject: [IronPython] Possible bug with "with" statement In silverlight, using ipy 2.0b3, I get the following error, but it goes away if I replace the with statement with it's try/finally equiv. I tried to make a minimal reproduction of this but could not. I thought I should post this traceback in case I did find a bug. -Dan ValueError: The type 'System.Void' may not be used as a type argument. beskar\parser.py Line 26: self.compiler = Compiler(self, path, context) Line 27: with file(path, 'rb') as f: Line 28: return self.parse(f.read(), path) Line 29: Line 30: def load_string(self, name, source, context): ValueError at load in beskar\parser.py, line 28 at load in beskar\loader.py, line 18 at load in game\templates\__init__.py, line 8 at load_xaml in game\templates\__init__.py, line 11 at bug in game\__init__.py, line 27 at global_hotkeys in game\hotkeys.py, line 19 CLR Stack Trace: at System.RuntimeType.ThrowIfTypeNeverValidGenericArgument(Type type) at System.RuntimeType.SanityCheckGenericArguments(Type[] genericArguments, Type[] genericParamters) at System.RuntimeType.MakeGenericType(Type[] instantiation) at Microsoft.Scripting.Actions.DynamicSiteHelpers.MakeDynamicSiteTargetType(Type[] types) at Microsoft.Scripting.Actions.DynamicSiteHelpers.MakeDynamicSiteType(Type[] types) at Microsoft.Scripting.Ast.DynamicNodeRewriter.RewriteSite(CallSiteBinder bindingInfo, Type retType, IList`1 args) at Microsoft.Scripting.Ast.DynamicNodeRewriter.Rewrite(ActionExpression node) at Microsoft.Scripting.Ast.TreeRewriter.DefaultRewriteActionExpression(TreeRewriter rewriter, Expression n) at Microsoft.Scripting.Ast.TreeRewriter.RewriteNode(Expression node) at Microsoft.Scripting.Ast.TreeRewriter.DefaultRewriteReturnStatement(TreeRewriter rewriter, Expression n) at Microsoft.Scripting.Ast.TreeRewriter.RewriteNode(Expression node) at Microsoft.Scripting.Ast.TreeRewriter.DefaultRewriteConditionalExpression(TreeRewriter rewriter, Expression n) at Microsoft.Scripting.Ast.TreeRewriter.RewriteNode(Expression node) at Microsoft.Scripting.Ast.TreeRewriter.DefaultRewriteScopeExpression(TreeRewriter rewriter, Expression n) at Microsoft.Scripting.Ast.TreeRewriter.RewriteNode(Expression node) at Microsoft.Scripting.Ast.TreeRewriter.RewriteArray(IList`1 args) at Microsoft.Scripting.Ast.TreeRewriter.DefaultRewriteBlock(TreeRewriter rewriter, Expression n) at Microsoft.Scripting.Ast.TreeRewriter.RewriteNode(Expression node) at Microsoft.Scripting.Ast.TreeRewriter.DefaultRewriteLambdaExpression(TreeRewriter rewriter, Expression n) at Microsoft.Scripting.Ast.TreeRewriter.RewriteNode(Expression node) at Microsoft.Scripting.Ast.LambdaCompiler.AnalyzeLambda(LambdaExpression& lambda) at Microsoft.Scripting.Ast.LambdaCompiler..ctor(Compiler compiler, LambdaExpression lambda, TypeGen typeGen, MethodBase mi, ILGenerator ilg, IList`1 paramTypes, ConstantPool constantPool, Boolean closure, Boolean emitDebugSymbols) at Microsoft.Scripting.Ast.LambdaCompiler.CreateDynamicLambdaCompiler(Compiler compiler, LambdaExpression lambda, String methodName, Type returnType, IList`1 paramTypes, IList`1 paramNames, ConstantPool constantPool, Boolean closure, Boolean emitDebugSymbols) at Microsoft.Scripting.Ast.LambdaCompiler.CompileLambda(LambdaExpression lambda, Type delegateType, Boolean emitDebugSymbols, MethodInfo& method) at Microsoft.Scripting.Ast.LambdaCompiler.CompileLambda[T](LambdaExpression lambda, MethodInfo& method) at Microsoft.Scripting.Actions.SmallRuleSet`1.MakeTarget() at Microsoft.Scripting.Actions.SmallRuleSet`1.GetTarget() at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update3[T,T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) at S$40.load$1320(Closure , Object self, Object path, Object context) at _stub_$3707##2295(Closure , CallSite , CodeContext , Object , Object , Object , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update5[T,T0,T1,T2,T3,T4,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4) at _stub_$3706##2294(Closure , CallSite , CodeContext , Object , Object , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update4[T,T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) at S$42.load$1489(Closure , Object path, Object namespaces) at S$42.load$1489(Closure , Object[] ) at _stub_$3668##2256(Closure , CallSite , CodeContext , Object , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update3[T,T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) at S$26.load$909(Closure , Object template) at _stub_$1047##540(Closure , CallSite , CodeContext , Object , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update3[T,T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) at S$26.load_xaml$910(Closure , Object template, Object namespaces) at S$26.load_xaml$910(Closure , Object[] ) at _stub_$3664##2252(Closure , CallSite , CodeContext , Object , String , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update4[T,T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) at S$4.bug$384(Closure ) at _stub_$375##345(Closure , CallSite , CodeContext , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update2[T,T0,T1,TRet](CallSite site, T0 arg0, T1 arg1) at S$80.global_hotkeys$3425(Closure , Object sender, Object e) at _stub_$3654##2242(Closure , CallSite , CodeContext , Object , Object , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update4[T,T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) at System.Void(Object, KeyEventArgs)(Object[] , Object , KeyEventArgs ) at System.Windows.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args) at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName) _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Wed Jul 9 23:22:58 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 9 Jul 2008 14:22:58 -0700 Subject: [IronPython] upgrading to ip 2b3 in Resolver One In-Reply-To: <485BBBF7.6080804@resolversystems.com> References: <485B9AF4.1060901@resolversystems.com> <485BBBF7.6080804@resolversystems.com> Message-ID: <7AD436E4270DD54A94238001769C2227012C9329959F@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Another way to do this is to create a ScriptSource which is of kind Statements: ScriptRuntime sr = ScriptRuntime.Create(); ScriptEngine engine = sr.GetEngine("py"); ScriptSource source = engine.CreateScriptSourceFromFile("test.py", Encoding.Default, SourceCodeKind.Statements); ScriptScope scope = engine.CreateScope(); scope.SetVariable("__name__", "__main__"); source.Execute(scope); The issue here is that when you create source which is of type File we automatically set __name__ and __file__ - just like Python would if you executed a module. Given that the scope and code are decoupled from each other there's no way for us to set it in the scope until the code runs - and of course the code runs after your SetVariable call. Unless there's some reason using Statements is too onerous I'm inclined to say this is the correct behavior. Alternately we could check and see if __name__ / __file__ are already set and then not set them. But I'm worried that would lead to some surprising behavior when re-using scopes. I'm am open to suggestions though :). -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Christian Muirhead Sent: Friday, June 20, 2008 7:17 AM To: Discussion of IronPython Subject: Re: [IronPython] upgrading to ip 2b3 in Resolver One Christian Muirhead wrote: > * Another thing I saw here was that you can't set __name__ in a scope > when running a script loaded from a source file - that is, this: > > ScriptSource source = engine.CreateScriptSourceFromFile("test.py"); > ScriptScope scope = e.CreateScope(); > scope.SetVariable("__name__", "__main__"); > source.Execute(scope); > > when test.py contains > > print __name__ > > > prints "test" Oh, I forgot to say - I got around this using source.ExecuteProgram, where __name__ is set correctly. -- Christian Muirhead Resolver Systems christian.muirhead at resolversystems.com We're hiring! http://www.resolversystems.com/jobs/ Resolver Systems Ltd 17a Clerkenwell Road, London EC1M 5RD, UK VAT No.: GB 893 5643 79 Registered in England and Wales as company number 5467329. Registered address: 843 Finchley Road, London NW11 8NA, UK _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Wed Jul 9 23:33:32 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 9 Jul 2008 14:33:32 -0700 Subject: [IronPython] How to get a System.Exception inside a IronPython except: clause In-Reply-To: <4817b6fc0807081741w64e29b32lc96330ebe4851f2e@mail.gmail.com> References: <4817b6fc0807081637y1d157d3br26c80a35c260ea12@mail.gmail.com> <7AD436E4270DD54A94238001769C2227012C932993E0@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <4817b6fc0807081741w64e29b32lc96330ebe4851f2e@mail.gmail.com> Message-ID: <7AD436E4270DD54A94238001769C2227012C932995AE@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Are you getting a TargetInvocationException and trying to get the stack trace of that? Or is it just some normal exception kind? I'll have to look into why calling FormatException isn't doing the right thing - that info might help... But anyway, it looks like the Silverlight exception formatter is doing the work it's self - it's just calling .ToString() on the actual .NET exception object. So I guess I've given you the complicated answer and the simple answer is doing str(myException) + '\n' + myException.clsException.ToString(). -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff Sent: Tuesday, July 08, 2008 5:41 PM To: Discussion of IronPython Subject: Re: [IronPython] How to get a System.Exception inside a IronPython except: clause Thanks Dino, That works. Unfortunately FormatException() doesn't add the CLR stack trace, even if it has been enabled in silverlight. If the exception is on the main thread, and if it isn't thrown by the target of an invokation, and you allow the exception to reach the top of the stack, you can see the CLR stack trace. I guess for now, when I need to see the CLR stack trace, the only way around that is to rearrange code so that those conditions are met. Is there anything that can (should?) be done about that? -Dan On Tue, Jul 8, 2008 at 6:39 PM, Dino Viehland wrote: > There's a clsException property that we add to Python exceptions that will give you the CLR Exception for the corresponding Python Exception. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff > Sent: Tuesday, July 08, 2008 4:37 PM > To: Discussion of IronPython > Subject: [IronPython] How to get a System.Exception inside a IronPython except: clause > > This may sound a little similar to some of my other posts on here, the > help I received previously has enabled me to get stuck in new and > exciting areas :) > > The stdlib traceback module can be used to format python exceptions, > but unfortunately it seems to leave out some information, like clr > exception data (thanks Curt and Jimmy for helping me turn that on). So > now I find myself thinking how to use > Application.Current.Environment.GetEngine('py').FormatException() > (thanks Dino) to do a better job. The only trouble is it wants a clr > Exception, not a ValueError. Is there any way to call this function > with the tools available inside of an except: clause ? > > Thanks, > -Dan > _______________________________________________ > 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 falcon at uwyo.edu Wed Jul 9 23:34:59 2008 From: falcon at uwyo.edu (Michael Stephens) Date: Wed, 9 Jul 2008 15:34:59 -0600 Subject: [IronPython] Are there anyone had embedded IronPython or other dynamic language into a biz solution. In-Reply-To: <8FAE2A142FCABE4EB6B37348D78A9BFE0262A008@XAEXG.GRAPECITY.NET> References: <8FAE2A142FCABE4EB6B37348D78A9BFE0262A008@XAEXG.GRAPECITY.NET> Message-ID: We just went live with Iron Python Embedded. We chose IronPython because it was so simple and python is so well documented. Other solutions are pretty precarious whereas iron python implementation was really easy. Michael Stephens Electrical Engineering Graduate Student University of Wyoming falcon at uwyo.edu or 89iroc at gmail.com On Tue, Jul 8, 2008 at 9:53 PM, Han Kejing wrote: > Hi, all, > > I have some ideas. I want embed dynamic language into my biz solution. But > I have some cares for this idea. > > I want discuss this topic in here. J > > > > If you had complete an biz solution and publish it to an user, Can you tell > me: > > who is user of your solution? > > why you select dynamic language? > > how about user's feedback? > > > > This is an open topic, you can talk any things that you feel about this > work. > > > > Thanks you all. > > > > ---------------------------------------------------------------- > > Do ONE thing, and do it WELL. > > > > Colin Han* @* *GrapeCity* > > > > _______________________________________________ > 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 Colin.Han at grapecity.com Thu Jul 10 04:13:55 2008 From: Colin.Han at grapecity.com (Han Kejing) Date: Thu, 10 Jul 2008 10:13:55 +0800 Subject: [IronPython] Are there anyone had embedded IronPython or otherdynamic language into a biz solution. In-Reply-To: References: <8FAE2A142FCABE4EB6B37348D78A9BFE0262A008@XAEXG.GRAPECITY.NET> Message-ID: <8FAE2A142FCABE4EB6B37348D78A9BFE0262A30F@XAEXG.GRAPECITY.NET> Sorry, My English is so poor. Maybe some word is worry or unclear. Follow is my ideas: I will provide some ability in my WinForm application to allow user to write python script to implement his custom business logic easily and quickly. My user is not developer, he has not any experience about coding, maybe Financial Worker is a special sample. I will define some object model of my business domain to my user. He can use IronPython to control these domain objects. How about my idea? Maybe it is castle in the air? ---------------------------------------------------------------- Follow my heart Colin Han @ GrapeCity From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Stephens Sent: 2008?7?10? 5:35 To: Discussion of IronPython Subject: Re: [IronPython] Are there anyone had embedded IronPython or otherdynamic language into a biz solution. We just went live with Iron Python Embedded. We chose IronPython because it was so simple and python is so well documented. Other solutions are pretty precarious whereas iron python implementation was really easy. Michael Stephens Electrical Engineering Graduate Student University of Wyoming falcon at uwyo.edu or 89iroc at gmail.com On Tue, Jul 8, 2008 at 9:53 PM, Han Kejing wrote: Hi, all, I have some ideas. I want embed dynamic language into my biz solution. But I have some cares for this idea. I want discuss this topic in here. J If you had complete an biz solution and publish it to an user, Can you tell me: who is user of your solution? why you select dynamic language? how about user's feedback? This is an open topic, you can talk any things that you feel about this work. Thanks you all. ---------------------------------------------------------------- Do ONE thing, and do it WELL. Colin Han @ GrapeCity _______________________________________________ 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 fuzzyman at voidspace.org.uk Thu Jul 10 13:16:19 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 10 Jul 2008 12:16:19 +0100 Subject: [IronPython] PyPy meets Jython (could meet IronPython too?) Message-ID: <4875EF83.80805@voidspace.org.uk> The Jython guys are joining forces with the PyPy guys to collaborate on CPython compatibility for alternative Python platforms. http://morepypy.blogspot.com/2008/07/ep2008-pypy-meets-jython.html Suggestions that are relevant to IronPython include: # ctypes - try to create _rawffi module in Java for Jython, which will enable Jython to reuse our existing ctypes implementation (and have PyPy use the Jython-rawffi for its own for PyPy.JVM) # generally see to share work / (continue) collaborate regarding extension modules # collaborate on testing framework / benchmarking, have a common site to show test results # come up with a set of "pure Python language" tests, which would gather and refactor tests from CPython, PyPy and Jython. It would be great to see IronPython participate. A common set of language tests, written in pure Python, could greatly benefit IronPython. Additionally, an implementation of ctypes for IronPython (using the .NET FFI and building on the PyPy work) would enable IronPython to use any of the extension modules developed for Python by PyPy. More and more standard library modules are implemented using ctypes now. All the best, Michael Foord -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From fuzzyman at voidspace.org.uk Thu Jul 10 13:44:26 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 10 Jul 2008 12:44:26 +0100 Subject: [IronPython] Publishing a Module when Embedding In-Reply-To: <4873DAA9.8020008@voidspace.org.uk> References: <4873D14D.3090706@voidspace.org.uk> <7AD436E4270DD54A94238001769C2227012C93299327@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <4873DAA9.8020008@voidspace.org.uk> Message-ID: <4875F61A.6070109@voidspace.org.uk> Michael Foord wrote: > Dino Viehland wrote: >> You can just expose a DLR Scope object directly - which is what >> IronPython does for modules internally. >> > > Bah, damn - I meant to try that before posting and then forgot! Hmmm... although from inside Python code run in the engine you can still tell that it is a ScriptScope and not a 'real' module. I'm pretty sure that internally IronPython *is* using PythonModule. Not that it is a problem, publishing ScriptScopes works fine - it would be *nice* to have access to the same API that IP uses for publishing modules, but not essential. Michael > > Thanks > > Michael > > >> The name PythonModule is unfortunately a little confusing - it's >> actually a PythonScopeExtension where we can store additional data >> about the Scope (e.g. if import clr has occurred). We'll lazily >> create the PythonModule and associate it with the Scope if we need it. >> >> -----Original Message----- >> From: users-bounces at lists.ironpython.com >> [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord >> Sent: Tuesday, July 08, 2008 1:43 PM >> To: Discussion of IronPython >> Subject: [IronPython] Publishing a Module when Embedding >> >> Hello all, >> >> I've been looking at writing some examples of publishing a module in an >> embedded scenario. >> >> The straightforward example (which also appears in the DLR hosting spec) >> is to just publish an *object*: >> >> ScriptRuntime _runtime = ScriptRuntime.Create(); >> _runtime.Globals.SetVariable("ModuleName", someObject); >> >> What I *really* want to do is to create a PythonModule from a dictionary >> of objects and publish that into the runtime globals. >> >> Creating a populated PythonModule seems to be problematic. The useful >> overload of PythonCOntext.CreateModule (that takes 4 arguments) isn't >> public (internal) - I can't see how to populate the module once I've >> created one. >> >> There is also an internal constructor to PythonModule that takes a >> Scope. These seem to be the routes taken by the importer. >> >> You can't publish a dictionary (well - except as a dictionary). >> >> How can I create and populate a PythonModule from C#? >> >> Michael Foord >> >> -- >> http://www.ironpythoninaction.com/ >> http://www.voidspace.org.uk/ >> http://www.trypython.org/ >> http://www.ironpython.info/ >> http://www.theotherdelia.co.uk/ >> http://www.resolverhacks.net/ >> >> _______________________________________________ >> 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 >> > > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From fuzzyman at voidspace.org.uk Thu Jul 10 13:52:59 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 10 Jul 2008 12:52:59 +0100 Subject: [IronPython] Are there anyone had embedded IronPython or otherdynamic language into a biz solution. In-Reply-To: <8FAE2A142FCABE4EB6B37348D78A9BFE0262A30F@XAEXG.GRAPECITY.NET> References: <8FAE2A142FCABE4EB6B37348D78A9BFE0262A008@XAEXG.GRAPECITY.NET> <8FAE2A142FCABE4EB6B37348D78A9BFE0262A30F@XAEXG.GRAPECITY.NET> Message-ID: <4875F81B.1020106@voidspace.org.uk> Han Kejing wrote: > > Sorry, My English is so poor. Maybe some word is worry or unclear. > > Follow is my ideas: > > I will provide some ability in my WinForm application to allow user to > write python script to implement his custom business logic easily and > quickly. My user is not developer, he has not any experience about > coding, maybe Financial Worker is a special sample. > > I will define some object model of my business domain to my user. He > can use IronPython to control these domain objects. > Sounds very straightforward - exactly the sort of thing IronPython *should* be used for. I'm in the middle of writing chapter 15 of "IronPython in Action" on embedding - and that is one of the standard scenarios I cover. Michael > How about my idea? Maybe it is castle in the air? > > ---------------------------------------------------------------- > > Follow my heart > > /Colin Han// //@/ *GrapeCity* > > *From:* users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] *On Behalf Of *Michael > Stephens > *Sent:* 2008?7?10? 5:35 > *To:* Discussion of IronPython > *Subject:* Re: [IronPython] Are there anyone had embedded IronPython > or otherdynamic language into a biz solution. > > We just went live with Iron Python Embedded. We chose IronPython > because it was so simple and python is so well documented. Other > solutions are pretty precarious whereas iron python implementation was > really easy. > > Michael Stephens > > Electrical Engineering Graduate Student > University of Wyoming > falcon at uwyo.edu or 89iroc at gmail.com > > > On Tue, Jul 8, 2008 at 9:53 PM, Han Kejing > wrote: > > Hi, all, > > I have some ideas. I want embed dynamic language into my biz solution. > But I have some cares for this idea. > > I want discuss this topic in here. J > > If you had complete an biz solution and publish it to an user, Can you > tell me: > > who is user of your solution? > > why you select dynamic language? > > how about user's feedback? > > This is an open topic, you can talk any things that you feel about > this work. > > Thanks you all. > > ---------------------------------------------------------------- > > Do ONE thing, and do it WELL. > > Colin Han/ @/ *GrapeCity* > > > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From anto.cuni at gmail.com Thu Jul 10 14:06:21 2008 From: anto.cuni at gmail.com (Antonio Cuni) Date: Thu, 10 Jul 2008 14:06:21 +0200 Subject: [IronPython] PyPy meets Jython (could meet IronPython too?) In-Reply-To: <4875EF83.80805@voidspace.org.uk> References: <4875EF83.80805@voidspace.org.uk> Message-ID: <4875FB3D.10005@gmail.com> Michael Foord wrote: > It would be great to see IronPython participate. A common set of > language tests, written in pure Python, could greatly benefit IronPython. I (we) agree. Right now we have python compliance tests scattered all over the places: there are cpython's regression tests, and both pypy and jython has their own additional tests. I bet IronPython is not different here. It would be great to have a set of tests that defines what you can expect to be guaranteed from a python implementation, shared among all the various projects. Unfortunately I think we are all busy with other things/priorities, so I don't expect this to happen very soon. > Additionally, an implementation of ctypes for IronPython (using the .NET > FFI and building on the PyPy work) would enable IronPython to use any of > the extension modules developed for Python by PyPy. More and more > standard library modules are implemented using ctypes now. well, hopefully it would also enable pypy to run extension modules implemented by others; don't let us doing all the boring work :-). Apart from jokes, I think that it should be very easy to port ctypes to ironpython that way: pypy's ctypes implementation is mostly written in pure python as a wrapper around a tiny library called _rawffi, which enables very low level interaction with external C libraries; so, it's enough to implement _rawffi for IronPython and everything should just work. And hopefully, we could even backport that _rawffi to pypy to have a working ctypes for pypy-cli for free :-) (modulo license issues, which in an ideal world would not be a blocker, but you never know). ciao, Anto From fuzzyman at voidspace.org.uk Thu Jul 10 14:39:44 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 10 Jul 2008 13:39:44 +0100 Subject: [IronPython] PyPy meets Jython (could meet IronPython too?) In-Reply-To: <4875FB3D.10005@gmail.com> References: <4875EF83.80805@voidspace.org.uk> <4875FB3D.10005@gmail.com> Message-ID: <48760310.30206@voidspace.org.uk> Antonio Cuni wrote: > Michael Foord wrote: > >> It would be great to see IronPython participate. A common set of >> language tests, written in pure Python, could greatly benefit >> IronPython. > > I (we) agree. Right now we have python compliance tests scattered all > over the places: there are cpython's regression tests, and both pypy > and jython has their own additional tests. I bet IronPython is not > different here. > > It would be great to have a set of tests that defines what you can > expect to be guaranteed from a python implementation, shared among all > the various projects. Unfortunately I think we are all busy with > other things/priorities, so I don't expect this to happen very soon. > It would be great to see this as a separate project (pyspec?) so that CPython, IronPython, PyPy and Jython developers can work on it. Of course for maximum platform compatibility it should be based on unittest... :-) Of course internal 'legal issues' may make it hard for the IronPython team to be involved. Hopefully this a hurdle that could be overcome. Making it a separate project may make it harder to get core developers from the platform implementation excited about it - but it is hard to see how any combined effort can be made otherwise. This is one area the Ruby community leads the Python community. >> Additionally, an implementation of ctypes for IronPython (using the >> .NET FFI and building on the PyPy work) would enable IronPython to >> use any of the extension modules developed for Python by PyPy. More >> and more standard library modules are implemented using ctypes now. > > well, hopefully it would also enable pypy to run extension modules > implemented by others; don't let us doing all the boring work :-). :-) > > Apart from jokes, I think that it should be very easy to port ctypes > to ironpython that way: pypy's ctypes implementation is mostly written > in pure python as a wrapper around a tiny library called _rawffi, > which enables very low level interaction with external C libraries; > so, it's enough to implement _rawffi for IronPython and everything > should just work. > > And hopefully, we could even backport that _rawffi to pypy to have a > working ctypes for pypy-cli for free :-) (modulo license issues, which > in an ideal world would not be a blocker, but you never know). Both of these would be great - and the Microsoft license is very permissive. It would probably be more of a problem for *them* to depend on the PyPy ctypes implementation though. :-( Personally I think that a Python 2.5 implementation (IronPython 2) is incomplete without ctypes of course... Incidentally, it would probably be possible to implement _rawffi for IronPython in pure Python - building on the dynamic platform invoke work that Seo started for ctypes. Michael Foord > > ciao, > Anto > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From anto.cuni at gmail.com Thu Jul 10 15:09:48 2008 From: anto.cuni at gmail.com (Antonio Cuni) Date: Thu, 10 Jul 2008 15:09:48 +0200 Subject: [IronPython] PyPy meets Jython (could meet IronPython too?) In-Reply-To: <48760310.30206@voidspace.org.uk> References: <4875EF83.80805@voidspace.org.uk> <4875FB3D.10005@gmail.com> <48760310.30206@voidspace.org.uk> Message-ID: <48760A1C.3030803@gmail.com> Michael Foord wrote: > It would be great to see this as a separate project (pyspec?) so that > CPython, IronPython, PyPy and Jython developers can work on it. yes, that was my idea when I proposed it. > Of course for maximum platform compatibility it should be based on > unittest... > > :-) I guess there is no chance to get pypy involved in such a project without using py.test :-). > It would probably be more of a problem for *them* to depend on the PyPy > ctypes implementation though. :-( I don't know Microsoft policies, it would be a real pity if that would not be possible because of vague legal issues. But I think it would be possible to integrate it at least in fepy. > Personally I think that a Python 2.5 implementation (IronPython 2) is > incomplete without ctypes of course... +1 Moreover, having a working ctypes for all the four major python implementation would make it THE standard way to write extension modules, and the whole community would benefit from this. > Incidentally, it would probably be possible to implement _rawffi for > IronPython in pure Python - building on the dynamic platform invoke work > that Seo started for ctypes. yes, but then I'm not sure about performances. Still, a slower ctypes is much better than no ctypes :-). ciao, Anto From fuzzyman at voidspace.org.uk Thu Jul 10 15:39:52 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 10 Jul 2008 14:39:52 +0100 Subject: [IronPython] PyPy meets Jython (could meet IronPython too?) In-Reply-To: <48760A1C.3030803@gmail.com> References: <4875EF83.80805@voidspace.org.uk> <4875FB3D.10005@gmail.com> <48760310.30206@voidspace.org.uk> <48760A1C.3030803@gmail.com> Message-ID: <48761128.4090407@voidspace.org.uk> Antonio Cuni wrote: > Michael Foord wrote: > >> It would be great to see this as a separate project (pyspec?) so that >> CPython, IronPython, PyPy and Jython developers can work on it. > > yes, that was my idea when I proposed it. > >> Of course for maximum platform compatibility it should be based on >> unittest... >> >> :-) > > I guess there is no chance to get pypy involved in such a project > without using py.test :-). > > I doubt there is much chance of getting CPython developers interested if it is not based on a standard library module. There is also no py.test implementation for Jython or IronPython. I realise there is an effort underway to port py.test to Jython, but if py.test uses sys.settrace or stack frame magic then it will be a *long* time before it can run on IronPython. A 'cross-platform' testing approach that relies on platform dependent implementation details, and isn't used by the core CPython developers seems to be *much* less interesting or useful in my opinion. Michael Foord >> It would probably be more of a problem for *them* to depend on the >> PyPy ctypes implementation though. :-( > > I don't know Microsoft policies, it would be a real pity if that would > not be possible because of vague legal issues. > But I think it would be possible to integrate it at least in fepy. > >> Personally I think that a Python 2.5 implementation (IronPython 2) is >> incomplete without ctypes of course... > > +1 > > Moreover, having a working ctypes for all the four major python > implementation would make it THE standard way to write extension > modules, and the whole community would benefit from this. > >> Incidentally, it would probably be possible to implement _rawffi for >> IronPython in pure Python - building on the dynamic platform invoke >> work that Seo started for ctypes. > > yes, but then I'm not sure about performances. Still, a slower ctypes > is much better than no ctypes :-). > > ciao, > Anto > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From curt at hagenlocher.org Thu Jul 10 16:38:42 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Thu, 10 Jul 2008 07:38:42 -0700 Subject: [IronPython] PyPy meets Jython (could meet IronPython too?) In-Reply-To: <4875EF83.80805@voidspace.org.uk> References: <4875EF83.80805@voidspace.org.uk> Message-ID: I know we're definitely interested in pursuing a ctypes-based extensibility standard for Python, and we're continually pushing our lawyers to increase the allowed level of our interaction with other open source projects. Hopefully, we'll be able to provide a less vague answer than this before too much time passes. :) On Thu, Jul 10, 2008 at 4:16 AM, Michael Foord wrote: > The Jython guys are joining forces with the PyPy guys to collaborate on > CPython compatibility for alternative Python platforms. > > http://morepypy.blogspot.com/2008/07/ep2008-pypy-meets-jython.html > > Suggestions that are relevant to IronPython include: > > # ctypes - try to create _rawffi module in Java for Jython, which will > enable Jython to reuse our existing ctypes implementation (and have PyPy use > the Jython-rawffi for its own for PyPy.JVM) > > # generally see to share work / (continue) collaborate regarding extension > modules > > # collaborate on testing framework / benchmarking, have a common site to > show test results > > # come up with a set of "pure Python language" tests, which would gather > and refactor tests from CPython, PyPy and Jython. > > It would be great to see IronPython participate. A common set of language > tests, written in pure Python, could greatly benefit IronPython. > > Additionally, an implementation of ctypes for IronPython (using the .NET > FFI and building on the PyPy work) would enable IronPython to use any of the > extension modules developed for Python by PyPy. More and more standard > library modules are implemented using ctypes now. > > All the best, > > Michael Foord > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 Thu Jul 10 17:25:22 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Thu, 10 Jul 2008 08:25:22 -0700 Subject: [IronPython] Publishing a Module when Embedding In-Reply-To: <4875F61A.6070109@voidspace.org.uk> References: <4873D14D.3090706@voidspace.org.uk> <7AD436E4270DD54A94238001769C2227012C93299327@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <4873DAA9.8020008@voidspace.org.uk> <4875F61A.6070109@voidspace.org.uk> Message-ID: <7AD436E4270DD54A94238001769C2227012C934308F1@DF-GRTDANE-MSG.exchange.corp.microsoft.com> It's a little confusing but we are actually exposing Scope objects - not ScriptScope objects. The DLR APIs are separated into two halves - the hosting API half and the language API half. The hosting API objects are all remotable and expose the APIs which are needed for hosting. The language API half are all appdomain bound and expose the API that language implementers need to see. IronPython actually adds extension methods to both ScriptScope and Scope so they both work like modules but Scope has more functionality such as a correct __repr__, __new__, etc... You can either new up a Scope object directly or if you have a ScriptScope you can call HostingHelpers.GetScope. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Thursday, July 10, 2008 4:44 AM To: Discussion of IronPython Subject: Re: [IronPython] Publishing a Module when Embedding Michael Foord wrote: > Dino Viehland wrote: >> You can just expose a DLR Scope object directly - which is what >> IronPython does for modules internally. >> > > Bah, damn - I meant to try that before posting and then forgot! Hmmm... although from inside Python code run in the engine you can still tell that it is a ScriptScope and not a 'real' module. I'm pretty sure that internally IronPython *is* using PythonModule. Not that it is a problem, publishing ScriptScopes works fine - it would be *nice* to have access to the same API that IP uses for publishing modules, but not essential. Michael > > Thanks > > Michael > > >> The name PythonModule is unfortunately a little confusing - it's >> actually a PythonScopeExtension where we can store additional data >> about the Scope (e.g. if import clr has occurred). We'll lazily >> create the PythonModule and associate it with the Scope if we need it. >> >> -----Original Message----- >> From: users-bounces at lists.ironpython.com >> [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord >> Sent: Tuesday, July 08, 2008 1:43 PM >> To: Discussion of IronPython >> Subject: [IronPython] Publishing a Module when Embedding >> >> Hello all, >> >> I've been looking at writing some examples of publishing a module in an >> embedded scenario. >> >> The straightforward example (which also appears in the DLR hosting spec) >> is to just publish an *object*: >> >> ScriptRuntime _runtime = ScriptRuntime.Create(); >> _runtime.Globals.SetVariable("ModuleName", someObject); >> >> What I *really* want to do is to create a PythonModule from a dictionary >> of objects and publish that into the runtime globals. >> >> Creating a populated PythonModule seems to be problematic. The useful >> overload of PythonCOntext.CreateModule (that takes 4 arguments) isn't >> public (internal) - I can't see how to populate the module once I've >> created one. >> >> There is also an internal constructor to PythonModule that takes a >> Scope. These seem to be the routes taken by the importer. >> >> You can't publish a dictionary (well - except as a dictionary). >> >> How can I create and populate a PythonModule from C#? >> >> Michael Foord >> >> -- >> http://www.ironpythoninaction.com/ >> http://www.voidspace.org.uk/ >> http://www.trypython.org/ >> http://www.ironpython.info/ >> http://www.theotherdelia.co.uk/ >> http://www.resolverhacks.net/ >> >> _______________________________________________ >> 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 >> > > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From fuzzyman at voidspace.org.uk Thu Jul 10 18:15:34 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 10 Jul 2008 17:15:34 +0100 Subject: [IronPython] Publishing a Module when Embedding In-Reply-To: <7AD436E4270DD54A94238001769C2227012C934308F1@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <4873D14D.3090706@voidspace.org.uk> <7AD436E4270DD54A94238001769C2227012C93299327@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <4873DAA9.8020008@voidspace.org.uk> <4875F61A.6070109@voidspace.org.uk> <7AD436E4270DD54A94238001769C2227012C934308F1@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <487635A6.6050306@voidspace.org.uk> Dino Viehland wrote: > It's a little confusing but we are actually exposing Scope objects - not ScriptScope objects. The DLR APIs are separated into two halves - the hosting API half and the language API half. The hosting API objects are all remotable and expose the APIs which are needed for hosting. The language API half are all appdomain bound and expose the API that language implementers need to see. IronPython actually adds extension methods to both ScriptScope and Scope so they both work like modules but Scope has more functionality such as a correct __repr__, __new__, etc... > > You can either new up a Scope object directly or if you have a ScriptScope you can call HostingHelpers.GetScope. > :-) ScriptScopes are more convenient to work with, so I'll turn them into a Scope when I publish them onto the runtime. Thanks Michael > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Thursday, July 10, 2008 4:44 AM > To: Discussion of IronPython > Subject: Re: [IronPython] Publishing a Module when Embedding > > Michael Foord wrote: > >> Dino Viehland wrote: >> >>> You can just expose a DLR Scope object directly - which is what >>> IronPython does for modules internally. >>> >>> >> Bah, damn - I meant to try that before posting and then forgot! >> > > Hmmm... although from inside Python code run in the engine you can still > tell that it is a ScriptScope and not a 'real' module. I'm pretty sure > that internally IronPython *is* using PythonModule. > > Not that it is a problem, publishing ScriptScopes works fine - it would > be *nice* to have access to the same API that IP uses for publishing > modules, but not essential. > > Michael > > >> Thanks >> >> Michael >> >> >> >>> The name PythonModule is unfortunately a little confusing - it's >>> actually a PythonScopeExtension where we can store additional data >>> about the Scope (e.g. if import clr has occurred). We'll lazily >>> create the PythonModule and associate it with the Scope if we need it. >>> >>> -----Original Message----- >>> From: users-bounces at lists.ironpython.com >>> [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord >>> Sent: Tuesday, July 08, 2008 1:43 PM >>> To: Discussion of IronPython >>> Subject: [IronPython] Publishing a Module when Embedding >>> >>> Hello all, >>> >>> I've been looking at writing some examples of publishing a module in an >>> embedded scenario. >>> >>> The straightforward example (which also appears in the DLR hosting spec) >>> is to just publish an *object*: >>> >>> ScriptRuntime _runtime = ScriptRuntime.Create(); >>> _runtime.Globals.SetVariable("ModuleName", someObject); >>> >>> What I *really* want to do is to create a PythonModule from a dictionary >>> of objects and publish that into the runtime globals. >>> >>> Creating a populated PythonModule seems to be problematic. The useful >>> overload of PythonCOntext.CreateModule (that takes 4 arguments) isn't >>> public (internal) - I can't see how to populate the module once I've >>> created one. >>> >>> There is also an internal constructor to PythonModule that takes a >>> Scope. These seem to be the routes taken by the importer. >>> >>> You can't publish a dictionary (well - except as a dictionary). >>> >>> How can I create and populate a PythonModule from C#? >>> >>> Michael Foord >>> >>> -- >>> http://www.ironpythoninaction.com/ >>> http://www.voidspace.org.uk/ >>> http://www.trypython.org/ >>> http://www.ironpython.info/ >>> http://www.theotherdelia.co.uk/ >>> http://www.resolverhacks.net/ >>> >>> _______________________________________________ >>> 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 >>> >>> >> > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From kamil at dworakowski.name Thu Jul 10 18:53:23 2008 From: kamil at dworakowski.name (Kamil Dworakowski) Date: Thu, 10 Jul 2008 17:53:23 +0100 Subject: [IronPython] repr on c# class Message-ID: <93fc29d60807100953p2c72ba05taf78e742eedc8052@mail.gmail.com> I need to define repr method in c#, for use in IronPython. I tried: [PythonName("repr")] public static object Repr(object o) { return o.ToString(); } which didn't work. Is there a way without subclassing in Python? -- Kamil -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Thu Jul 10 18:56:36 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Thu, 10 Jul 2008 09:56:36 -0700 Subject: [IronPython] repr on c# class In-Reply-To: <93fc29d60807100953p2c72ba05taf78e742eedc8052@mail.gmail.com> References: <93fc29d60807100953p2c72ba05taf78e742eedc8052@mail.gmail.com> Message-ID: <7AD436E4270DD54A94238001769C2227012C93430932@DF-GRTDANE-MSG.exchange.corp.microsoft.com> This is 1.x, correct? You should implement the ICodeFormattable interface. That is also present in 2.0 but in 2.0 it's no longer required that you implement it for it to work, you can just define a method named __repr__. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Kamil Dworakowski Sent: Thursday, July 10, 2008 9:53 AM To: Discussion of IronPython Subject: [IronPython] repr on c# class I need to define repr method in c#, for use in IronPython. I tried: [PythonName("repr")] public static object Repr(object o) { return o.ToString(); } which didn't work. Is there a way without subclassing in Python? -- Kamil -------------- next part -------------- An HTML attachment was scrubbed... URL: From kamil at dworakowski.name Thu Jul 10 19:15:37 2008 From: kamil at dworakowski.name (Kamil Dworakowski) Date: Thu, 10 Jul 2008 18:15:37 +0100 Subject: [IronPython] repr on c# class In-Reply-To: <7AD436E4270DD54A94238001769C2227012C93430932@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <93fc29d60807100953p2c72ba05taf78e742eedc8052@mail.gmail.com> <7AD436E4270DD54A94238001769C2227012C93430932@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <529C0F90-A324-41D8-B127-7F07290340E3@dworakowski.name> Works, thank you On 10 Jul 2008, at 17:56, Dino Viehland wrote: > This is 1.x, correct? You should implement the ICodeFormattable > interface. That is also present in 2.0 but in 2.0 it?s no longer re > quired that you implement it for it to work, you can just define a m > ethod named __repr__. > > > > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com > ] On Behalf Of Kamil Dworakowski > Sent: Thursday, July 10, 2008 9:53 AM > To: Discussion of IronPython > Subject: [IronPython] repr on c# class > > > > I need to define repr method in c#, for use in IronPython. I tried: > > [PythonName("repr")] > public static object Repr(object o) { > return o.ToString(); > } > > > which didn't work. Is there a way without subclassing in Python? > > -- > Kamil > > _______________________________________________ > 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 jdhardy at gmail.com Fri Jul 11 02:27:22 2008 From: jdhardy at gmail.com (Jeff Hardy) Date: Thu, 10 Jul 2008 18:27:22 -0600 Subject: [IronPython] "Cannot import name Enum" Message-ID: Hi all, I'm hosting IronPython 2.0b3. When executing "from System import Enum", I get the error "Cannot import name Enum ". It works fine when executed from the console. Do I need to set up some references in the hosting code to make this work? -Jeff From srivatsn at microsoft.com Fri Jul 11 02:32:13 2008 From: srivatsn at microsoft.com (Srivatsn Narayanan) Date: Thu, 10 Jul 2008 17:32:13 -0700 Subject: [IronPython] "Cannot import name Enum" In-Reply-To: References: Message-ID: You will have to call LoadAssembly on your ScriptRuntime to load mscorlib.dll: scriptRuntime.LoadAssembly(typeof(string).Assembly) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jeff Hardy Sent: Thursday, July 10, 2008 5:27 PM To: Discussion of IronPython Subject: [IronPython] "Cannot import name Enum" Hi all, I'm hosting IronPython 2.0b3. When executing "from System import Enum", I get the error "Cannot import name Enum ". It works fine when executed from the console. Do I need to set up some references in the hosting code to make this work? -Jeff _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Colin.Han at grapecity.com Fri Jul 11 03:23:51 2008 From: Colin.Han at grapecity.com (Han Kejing) Date: Fri, 11 Jul 2008 09:23:51 +0800 Subject: [IronPython] "Cannot import name Enum" In-Reply-To: References: Message-ID: <8FAE2A142FCABE4EB6B37348D78A9BFE0262A6CD@XAEXG.GRAPECITY.NET> Maybe you should exec follow script first, import clr clr.AddReference("mscorlib") I'm beginner :) ---------------------------------------------------------------- Follow my heart Colin Han @ GrapeCity -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jeff Hardy Sent: 2008?7?11? 8:27 To: Discussion of IronPython Subject: [IronPython] "Cannot import name Enum" Hi all, I'm hosting IronPython 2.0b3. When executing "from System import Enum", I get the error "Cannot import name Enum ". It works fine when executed from the console. Do I need to set up some references in the hosting code to make this work? -Jeff _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From mbarnett at uniserve.com Fri Jul 11 18:35:06 2008 From: mbarnett at uniserve.com (Mitch Barnett) Date: Fri, 11 Jul 2008 09:35:06 -0700 Subject: [IronPython] Embedded IronPython in .NET C# WinForm app error References: <001301c8e0f1$b541d5f0$6500a8c0@valleyforge> Message-ID: <006801c8e374$13b2b710$6500a8c0@valleyforge> I was able to repro this error using the ParseInteractiveInput code sample from the IPy 1.1.1 help file and pasting this directly into a VS 2008 C# console project. The tutorial exercise that causes the error is Merlin the Wizard. Using the EngineOptions I was able to get more detail on the error: >>>a = AgentServerClass() Creating an instance of the COM component with CLSID {D45FD2FC-5C6E-11D1-9EC1-00 C04FD7081F} from the IClassFactory failed due to the following error: 80004002. at .ctor##21() at IronPython.Runtime.Calls.FastCallable0.Call(ICallerContext context) at IronPython.Runtime.Calls.FastCallable0.Call(ICallerContext context, Object [] args) at IronPython.Runtime.Calls.BuiltinFunction.Call(ICallerContext context, Obje ct[] args) at IronPython.Runtime.Types.DynamicType.AllocateObject(Object[] args) at IronPython.Runtime.Operations.InstanceOps.DefaultNew(ICallerContext contex t, DynamicType type?, Object[] args?) at DefaultNew##17(ICallerContext , Object ) at IronPython.Runtime.Calls.FastCallableWithContextAny.Call(ICallerContext co ntext, Object arg0) at IronPython.Runtime.Calls.FastCallableWithContextAny.Call(ICallerContext co ntext, Object[] args) at IronPython.Runtime.Calls.BuiltinFunction.Call(ICallerContext context, Obje ct[] args) at IronPython.Runtime.Operations.Ops.CallWithContext(ICallerContext context, Object func, Object[] args) at IronPython.Runtime.Types.DynamicType.CreateInstance(ICallerContext context , Object[] args, String[] names) at IronPython.Runtime.Types.DynamicType.Call(ICallerContext context, Object[] args, String[] names) at IronPython.Runtime.Types.DynamicType.Call(ICallerContext context, Object[] args) at IronPython.Runtime.Operations.Ops.CallWithContext(ICallerContext context, Object func, Object[] args) at IronPython.Runtime.Operations.Ops.CallWithContext(ICallerContext context, Object func) at ##16(ModuleScope ) at IronPython.Hosting.CompiledCode.Run(ModuleScope moduleScope) at IronPython.Hosting.PythonEngine.ExecuteToConsole(String text, EngineModule engineModule, IDictionary`2 locals) at IronPython.Hosting.PythonEngine.ExecuteToConsole(String text) at IPConsole.SimpleConsole.Run() in C:\Users\Mitch.Barnett\Documents\Visual S tudio 2008\Projects\IPConsole\IPConsole\Program.cs:line 35 TypeError: Creating an instance of the COM component with CLSID {D45FD2FC-5C6E-1 1D1-9EC1-00C04FD7081F} from the IClassFactory failed due to the following error: 80004002. CLR Exception: InvalidCastException : Creating an instance of the COM component with CLSID {D45FD2FC-5C6E-11D1-9EC1-00 C04FD7081F} from the IClassFactory failed due to the following error: 80004002. >>> Any help appreciated! Mitch -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Mitch Barnett Sent: Tuesday, July 08, 2008 4:57 AM To: users at lists.ironpython.com Subject: [IronPython] Embedded IronPython in .NET C# WinForm app error Hello, I have a .NET C# WinForm application that hosts an IronPython 1.1 engine. In the WinForm app, the scripting API is exposed through a web service interface (using Windows Communication Foundation) so that from a remote console, (over WCF), I can execute IronPython code on the computer that is running the WinForm app. The project is at: http://www.codeplex.com/gsb Works 99% of the time, but the 1% of the time that it does not work is for cases like this: >>> IronPython 1.1 (1.1) on .NET 2.0.50727.1433 >>> import clr >>> import sys >>> sys.path.append(r"c:\projects\gsbservice\gsbservice1") >>> clr.AddReferenceToFile("AgentServerObjects.dll") >>> from AgentServerObjects import * >>> a = AgentServerClass() Traceback (most recent call last): File C:\Projects\GSBService\GSBService1 \ParseInteractive.cs, line 93, in CallIPCmd File , line 0, in ##21 File , line 0, in DefaultNew##22 File , line 0, in .ctor##26 TypeError: Creating an instance of the COM component with CLSID {D45FD2FC-5C6E-11D1-9EC1- 00C04FD7081F} from the IClassFactory failed due to the following error: 80004002. >>> Of course if I try the same thing using the IPY.exe console on the same computer, using the same AgentServerObjects.dll, it works just fine. Any thoughts appreciated as to what might be going wrong. Thanks, Mitch _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Fri Jul 11 20:02:48 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Fri, 11 Jul 2008 11:02:48 -0700 Subject: [IronPython] Python Generation In-Reply-To: References: <7AD436E4270DD54A94238001769C2227012C932988CD@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <7AD436E4270DD54A94238001769C2227012C93430C20@DF-GRTDANE-MSG.exchange.corp.microsoft.com> FYI we just talked about this in our team meeting today and it looks like we'll bring this back for 2.0. We'll only bring back the generator side - that's pretty simple to port and it's not ugly like the parser and merging support is. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Stephens Sent: Wednesday, July 02, 2008 7:18 PM To: Discussion of IronPython Subject: Re: [IronPython] Python Generation Is this a feature that will be still available in 2.0? Michael Stephens Electrical Engineering Graduate Student University of Wyoming falcon at uwyo.edu or 89iroc at gmail.com On Mon, Jun 30, 2008 at 7:33 PM, Dino Viehland > wrote: You could take a look at IronPython 1.x's CodeDom support in IronPython.CodeDom.Provider. From there you can get the generator and throw CodeDom trees at it. It can generate a bunch of ugliness to support WinForms but by default it doesn't do that. Unfortunately it hasn't been updated to 2.0 but of course the source is available :) From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Stephens Sent: Monday, June 30, 2008 6:14 PM To: Discussion of IronPython Subject: [IronPython] Python Generation I am writing a macro->python translation utility for our system. I thought I struck it rich when i found IronPython.Compiler.Ast . But there doesn't seem to be a good way to take these things and generate python code (strings). If anyone knows any spiffy libraries out there to do this that would be awesome too. Michael Stephens Electrical Engineering Graduate Student University of Wyoming falcon at uwyo.edu or 89iroc at gmail.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 dan.eloff at gmail.com Sat Jul 12 07:16:02 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Sat, 12 Jul 2008 00:16:02 -0500 Subject: [IronPython] How to get a System.Exception inside a IronPython except: clause In-Reply-To: <7AD436E4270DD54A94238001769C2227012C932995AE@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <4817b6fc0807081637y1d157d3br26c80a35c260ea12@mail.gmail.com> <7AD436E4270DD54A94238001769C2227012C932993E0@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <4817b6fc0807081741w64e29b32lc96330ebe4851f2e@mail.gmail.com> <7AD436E4270DD54A94238001769C2227012C932995AE@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <4817b6fc0807112216k1ae9dcdej7ccbd2a6f8d1d74b@mail.gmail.com> On Wed, Jul 9, 2008 at 4:33 PM, Dino Viehland wrote: > Are you getting a TargetInvocationException and trying to get the stack trace of that? Or is it just some normal exception kind? I'll have to look into why calling FormatException isn't doing the right thing - that info might help... Just a normal ValueError. FormatException does work, it just only gives the python trace. > But anyway, it looks like the Silverlight exception formatter is doing the work it's self - it's just calling .ToString() on the actual .NET exception object. So I guess I've given you the complicated answer and the simple answer is doing str(myException) + '\n' + myException.clsException.ToString(). I used FormatException to get the python trace, followed by '\n' + myException.clsException.ToString() like you suggested, and it works perfectly. Go figure :) I would never have thought it was that easy. Thanks, -Dan > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff > Sent: Tuesday, July 08, 2008 5:41 PM > To: Discussion of IronPython > Subject: Re: [IronPython] How to get a System.Exception inside a IronPython except: clause > > Thanks Dino, That works. > > Unfortunately FormatException() doesn't add the CLR stack trace, even > if it has been enabled in silverlight. If the exception is on the main > thread, and if it isn't thrown by the target of an invokation, and you > allow the exception to reach the top of the stack, you can see the CLR > stack trace. I guess for now, when I need to see the CLR stack trace, > the only way around that is to rearrange code so that those conditions > are met. > > Is there anything that can (should?) be done about that? > > -Dan > > On Tue, Jul 8, 2008 at 6:39 PM, Dino Viehland > wrote: >> There's a clsException property that we add to Python exceptions that will give you the CLR Exception for the corresponding Python Exception. >> >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff >> Sent: Tuesday, July 08, 2008 4:37 PM >> To: Discussion of IronPython >> Subject: [IronPython] How to get a System.Exception inside a IronPython except: clause >> >> This may sound a little similar to some of my other posts on here, the >> help I received previously has enabled me to get stuck in new and >> exciting areas :) >> >> The stdlib traceback module can be used to format python exceptions, >> but unfortunately it seems to leave out some information, like clr >> exception data (thanks Curt and Jimmy for helping me turn that on). So >> now I find myself thinking how to use >> Application.Current.Environment.GetEngine('py').FormatException() >> (thanks Dino) to do a better job. The only trouble is it wants a clr >> Exception, not a ValueError. Is there any way to call this function >> with the tools available inside of an except: clause ? >> >> Thanks, >> -Dan >> _______________________________________________ >> 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 dan.eloff at gmail.com Sat Jul 12 08:52:56 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Sat, 12 Jul 2008 01:52:56 -0500 Subject: [IronPython] loading an image in silverlight, in xaml, from the .xap Message-ID: <4817b6fc0807112352n11f18dfexb6f7acb9fbfe69dd@mail.gmail.com> I cannot load an image from in the xap file via uri. This one has been bugging me for a long time now. I think it must have something to do with a difference between a Chiron xap and a VS built xap. Could someone on the silverlight team (Jimmy!) please take a look at the demo project and tell me what I'm doing wrong? http://silverlight.net/forums/t/17003.aspx Thanks, -Dan From Jimmy.Schementi at microsoft.com Sat Jul 12 10:57:38 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Sat, 12 Jul 2008 01:57:38 -0700 Subject: [IronPython] loading an image in silverlight, in xaml, from the .xap In-Reply-To: <4817b6fc0807112352n11f18dfexb6f7acb9fbfe69dd@mail.gmail.com> References: <4817b6fc0807112352n11f18dfexb6f7acb9fbfe69dd@mail.gmail.com> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A32845D45E268F@NA-EXMSG-C116.redmond.corp.microsoft.com> Yep, will do in the morning. In the meantime, take a look at the "CollateralDamange" JScript sample in sdk-sdk-samples; it loads images for the board from the XAP file. I *believe* it's done from XAML, but I may be wrong, but regardless, the images are in the XAP and Silverlight (either from code or xaml) is downloading it. Again, I'll double check in the morning and see if I can repro it ... ~js > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Dan Eloff > Sent: Friday, July 11, 2008 11:53 PM > To: Discussion of IronPython > Subject: [IronPython] loading an image in silverlight, in xaml, from > the .xap > > I cannot load an image from in the xap file via uri. > > This one has been bugging me for a long time now. I think it must have > something to do with a difference between a Chiron xap and a VS built > xap. > > Could someone on the silverlight team (Jimmy!) please take a look at > the demo project and tell me what I'm doing wrong? > > http://silverlight.net/forums/t/17003.aspx > > Thanks, > -Dan > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dan.eloff at gmail.com Sat Jul 12 17:40:18 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Sat, 12 Jul 2008 10:40:18 -0500 Subject: [IronPython] Possible bug in interpreter Message-ID: <4817b6fc0807120840v13dfbfb5pd86ed0834ba98a94@mail.gmail.com> Hopefully this stack trace will be enough to track this down, but if it's not please ask for any information you need. The value of attr is "__getitem__". -Dan ValueError: too many values to unpack game\models\__init__.py Line 12: except KeyError: Line 13: print attr Line 14: raise AttributeError, attr Line 15: Line 16: def set(self, key, value): ValueError at __getattr__ in game\models\__init__.py, line 14 at body in , line 369 at render in beskar\template.py, line 18 at load_xaml in game\templates\__init__.py, line 13 at __init__ in game\planet.py, line 11 at in game\window_manager.py, line 60 at ShowTab in game\tabcontrol.py, line 85 at OnTabChanged in game\tabcontrol.py, line 101 at __call__ in game\event.py, line 41 at in game\tabcontrol.py, line 34 CLR Stack Trace: at Microsoft.Scripting.Interpretation.Interpreter.InterpretTryStatement(InterpreterState state, Expression expr) at Microsoft.Scripting.Interpretation.Interpreter.Interpret(InterpreterState state, Expression expr) at Microsoft.Scripting.Interpretation.Interpreter.InterpretAndCheckFlow(InterpreterState state, Expression node, Object& result) at Microsoft.Scripting.Interpretation.Interpreter.InterpretBlock(InterpreterState state, Expression expr) at Microsoft.Scripting.Interpretation.Interpreter.Interpret(InterpreterState state, Expression expr) at Microsoft.Scripting.Interpretation.Interpreter.InterpretScopeExpression(InterpreterState state, Expression expr) at Microsoft.Scripting.Interpretation.Interpreter.Interpret(InterpreterState state, Expression expr) at Microsoft.Scripting.Interpretation.Interpreter.InterpretScopeExpression(InterpreterState state, Expression expr) at Microsoft.Scripting.Interpretation.Interpreter.Interpret(InterpreterState state, Expression expr) at Microsoft.Scripting.Interpretation.Interpreter.Execute(InterpreterState state, Expression expression) at Microsoft.Scripting.Interpretation.Interpreter.InterpretLambda(InterpreterState parentState, LambdaExpression lambda, Object[] args, Object[] array) at Microsoft.Scripting.Interpretation.LambdaInvoker.Invoke(Object[] args, Object[] array) at Interpreted_body_8(LambdaInvoker , Object ) at _stub_$688##438(Closure , CallSite , CodeContext , Object , Object ) at S$38.render$1296(Closure , Object self, Object namespaces) at S$38.render$1296(Closure , Object[] ) at _stub_$3935##2482(Closure , CallSite , CodeContext , Object , Object , Object ) at _stub_$3934##2481(Closure , CallSite , CodeContext , Object , Object ) at S$26.load_xaml$927(Closure , Object template, Object namespaces) at S$26.load_xaml$927(Closure , Object[] ) at _stub_$3454##2020(Closure , CallSite , CodeContext , Object , String , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update4[T,T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) at S$79.__init__$2342(Closure , Object self, Object planet) at _stub_$2797##1366(Closure , CallSite , CodeContext , Object , Object , Object ) at _stub_$690##440(Closure , CallSite , CodeContext , Object , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update3[T,T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) at _stub_$4077##2624(Closure , CallSite , CodeContext , Object , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update3[T,T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) at S$77.$2330(Closure ) at _stub_$375##345(Closure , CallSite , CodeContext , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update2[T,T0,T1,TRet](CallSite site, T0 arg0, T1 arg1) at S$72.ShowTab$2176(Closure , Object self, Object tab, Object silent) at _stub_$3417##1983(Closure , CallSite , CodeContext , Object , Object , Object , Object ) at _stub_$2584##1153(Closure , CallSite , CodeContext , Object , Object , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update4[T,T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) at S$72.OnTabChanged$2178(Closure , Object self, Object sender, Object e) at _stub_$705##455(Closure , CallSite , CodeContext , Object , Object , Object , Object ) at _stub_$704##454(Closure , CallSite , CodeContext , Object , Object , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update4[T,T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) at _stub_$2398##967(Closure , CallSite , CodeContext , Object , Object , Object ) at S$14.__call__$665(Closure , Object self, Object sender, Object event_args) at _stub_$705##455(Closure , CallSite , CodeContext , Object , Object , Object , Object ) at _stub_$704##454(Closure , CallSite , CodeContext , Object , Object , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update4[T,T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) at _stub_$4069##2616(Closure , CallSite , CodeContext , Object , Object , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update4[T,T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) at S$72.$2168(Closure , Object s, Object e) at _stub_$4064##2611(Closure , CallSite , CodeContext , Object , Object , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update4[T,T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) at System.Void(Object, SelectionChangedEventArgs)(Object[] , Object , SelectionChangedEventArgs ) at System.Windows.Controls.ListBox.OnSelectionChanged(SelectionChangedEventArgs e) at System.Windows.Controls.ListBox.ProcessSelectionPropertyChange(DependencyProperty changedProperty, Object oldValue, Object newValue) at System.Windows.Controls.ListBox.OnSelectedItemChanged(Object oldValue, Object newValue) at System.Windows.Controls.ListBox.OnSelectedItemChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) at System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyProperty dp, Object newValue, Object oldValue) at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean isSetByStyle, Boolean isSetByBuiltInStyle) at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value) at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value) at System.Windows.Controls.ListBox.set_SelectedItem(Object value) at System.Windows.Controls.ListBox.SetSelectedItem(Object item) at System.Windows.Controls.ListBox.NotifyListItemClicked(ListBoxItem listBoxItem) at System.Windows.Controls.ListBoxItem.OnMouseLeftButtonDown(MouseButtonEventArgs e) at System.Windows.Controls.ListBoxItem.<.ctor>b__0(Object sender, MouseButtonEventArgs e) at System.Windows.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args) at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName) From dan.eloff at gmail.com Sat Jul 12 19:11:43 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Sat, 12 Jul 2008 12:11:43 -0500 Subject: [IronPython] Possible bug in interpreter In-Reply-To: <4817b6fc0807120840v13dfbfb5pd86ed0834ba98a94@mail.gmail.com> References: <4817b6fc0807120840v13dfbfb5pd86ed0834ba98a94@mail.gmail.com> Message-ID: <4817b6fc0807121011s2e95e200t1faf2b57545e6cf@mail.gmail.com> This error is exploding all around me. I can get you a dozen more stack traces from different places in my code. There's some kind of unpacking happening (at Microsoft.Scripting.Interpretation.Interpreter.InterpretTryStatement(InterpreterState state, Expression expr) ?) that is breaking a lot of things. I'd love to know what is causing it so I can either avoid it, or patch it so I can move on. Here's another trace that may be useful. -Dan TypeError: argument of type 'Planet' is not iterable beskar\namespace.py Line 83: Line 84: def has(self, key): Line 85: return key in self.ns or hasattr(self.ns, key) Line 86: Line 87: def get(self, key): TypeError at has in beskar\namespace.py, line 85 at __getitem__ in beskar\context.py, line 53 at RightColumn in , line 41 at body in , line 189 at render in beskar\template.py, line 18 at load_xaml in game\templates\__init__.py, line 13 at __init__ in game\planet.py, line 11 at in game\window_manager.py, line 60 at ShowTab in game\tabcontrol.py, line 85 at OnTabChanged in game\tabcontrol.py, line 101 at __call__ in game\event.py, line 41 at in game\tabcontrol.py, line 34 CLR Stack Trace: at Microsoft.Scripting.Interpretation.Interpreter.InterpretTryStatement(InterpreterState state, Expression expr) at Microsoft.Scripting.Interpretation.Interpreter.Interpret(InterpreterState state, Expression expr) at Microsoft.Scripting.Interpretation.Interpreter.InterpretAndCheckFlow(InterpreterState state, Expression node, Object& result) at Microsoft.Scripting.Interpretation.Interpreter.InterpretBlock(InterpreterState state, Expression expr) at Microsoft.Scripting.Interpretation.Interpreter.Interpret(InterpreterState state, Expression expr) at Microsoft.Scripting.Interpretation.Interpreter.InterpretScopeExpression(InterpreterState state, Expression expr) at Microsoft.Scripting.Interpretation.Interpreter.Interpret(InterpreterState state, Expression expr) at Microsoft.Scripting.Interpretation.Interpreter.InterpretScopeExpression(InterpreterState state, Expression expr) at Microsoft.Scripting.Interpretation.Interpreter.Interpret(InterpreterState state, Expression expr) at Microsoft.Scripting.Interpretation.Interpreter.Execute(InterpreterState state, Expression expression) at Microsoft.Scripting.Interpretation.Interpreter.InterpretLambda(InterpreterState parentState, LambdaExpression lambda, Object[] args, Object[] array) at Microsoft.Scripting.Interpretation.LambdaInvoker.Invoke(Object[] args, Object[] array) at Interpreted_body_8(LambdaInvoker , Object ) at _stub_$688##438(Closure , CallSite , CodeContext , Object , Object ) at S$38.render$1313(Closure , Object self, Object namespaces) at S$38.render$1313(Closure , Object[] ) at _stub_$3950##2498(Closure , CallSite , CodeContext , Object , Object , Object ) at _stub_$3949##2497(Closure , CallSite , CodeContext , Object , Object ) at S$26.load_xaml$926(Closure , Object template, Object namespaces) at S$26.load_xaml$926(Closure , Object[] ) at _stub_$3471##2038(Closure , CallSite , CodeContext , Object , String , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update4[T,T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) at S$79.__init__$2341(Closure , Object self, Object planet) at _stub_$2796##1366(Closure , CallSite , CodeContext , Object , Object , Object ) at _stub_$690##440(Closure , CallSite , CodeContext , Object , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update3[T,T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) at _stub_$4051##2599(Closure , CallSite , CodeContext , Object , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update3[T,T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) at S$77.$2329(Closure ) at _stub_$375##345(Closure , CallSite , CodeContext , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update2[T,T0,T1,TRet](CallSite site, T0 arg0, T1 arg1) at S$72.ShowTab$2175(Closure , Object self, Object tab, Object silent) at _stub_$3434##2001(Closure , CallSite , CodeContext , Object , Object , Object , Object ) at _stub_$2583##1153(Closure , CallSite , CodeContext , Object , Object , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update4[T,T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) at S$72.OnTabChanged$2177(Closure , Object self, Object sender, Object e) at _stub_$705##455(Closure , CallSite , CodeContext , Object , Object , Object , Object ) at _stub_$704##454(Closure , CallSite , CodeContext , Object , Object , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update4[T,T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) at _stub_$2397##967(Closure , CallSite , CodeContext , Object , Object , Object ) at S$14.__call__$665(Closure , Object self, Object sender, Object event_args) at _stub_$705##455(Closure , CallSite , CodeContext , Object , Object , Object , Object ) at _stub_$704##454(Closure , CallSite , CodeContext , Object , Object , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update4[T,T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) at _stub_$4043##2591(Closure , CallSite , CodeContext , Object , Object , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update4[T,T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) at S$72.$2167(Closure , Object s, Object e) at _stub_$4038##2586(Closure , CallSite , CodeContext , Object , Object , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update4[T,T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) at System.Void(Object, SelectionChangedEventArgs)(Object[] , Object , SelectionChangedEventArgs ) at System.Windows.Controls.ListBox.OnSelectionChanged(SelectionChangedEventArgs e) at System.Windows.Controls.ListBox.ProcessSelectionPropertyChange(DependencyProperty changedProperty, Object oldValue, Object newValue) at System.Windows.Controls.ListBox.OnSelectedItemChanged(Object oldValue, Object newValue) at System.Windows.Controls.ListBox.OnSelectedItemChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) at System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyProperty dp, Object newValue, Object oldValue) at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean isSetByStyle, Boolean isSetByBuiltInStyle) at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value) at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value) at System.Windows.Controls.ListBox.set_SelectedItem(Object value) at System.Windows.Controls.ListBox.SetSelectedItem(Object item) at System.Windows.Controls.ListBox.NotifyListItemClicked(ListBoxItem listBoxItem) at System.Windows.Controls.ListBoxItem.OnMouseLeftButtonDown(MouseButtonEventArgs e) at System.Windows.Controls.ListBoxItem.<.ctor>b__0(Object sender, MouseButtonEventArgs e) at System.Windows.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args) at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName) From fuzzyman at voidspace.org.uk Sat Jul 12 19:24:37 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sat, 12 Jul 2008 18:24:37 +0100 Subject: [IronPython] Possible bug in interpreter In-Reply-To: <4817b6fc0807121011s2e95e200t1faf2b57545e6cf@mail.gmail.com> References: <4817b6fc0807120840v13dfbfb5pd86ed0834ba98a94@mail.gmail.com> <4817b6fc0807121011s2e95e200t1faf2b57545e6cf@mail.gmail.com> Message-ID: <4878E8D5.9030304@voidspace.org.uk> Dan Eloff wrote: > This error is exploding all around me. I can get you a dozen more > stack traces from different places in my code. There's some kind of > unpacking happening (at > Microsoft.Scripting.Interpretation.Interpreter.InterpretTryStatement(InterpreterState > state, Expression expr) ?) that is breaking a lot of things. I'd love > to know what is causing it so I can either avoid it, or patch it so I > can move on. Here's another trace that may be useful. > > -Dan > > TypeError: argument of type 'Planet' is not iterable > beskar\namespace.py > Line 83: > Line 84: def has(self, key): > Line 85: return key in self.ns or hasattr(self.ns, key) > Line 86: > Line 87: def get(self, key): > > Well that *looks* like a normal Python error. Is self.ns iterable? (It either needs to be iterable, have a __getitem__ that supports integer indexes or have a __contains__ method). Michael > TypeError > at has in beskar\namespace.py, line 85 > at __getitem__ in beskar\context.py, line 53 > at RightColumn in , line 41 > at body in , line 189 > at render in beskar\template.py, line 18 > at load_xaml in game\templates\__init__.py, line 13 > at __init__ in game\planet.py, line 11 > at in game\window_manager.py, line 60 > at ShowTab in game\tabcontrol.py, line 85 > at OnTabChanged in game\tabcontrol.py, line 101 > at __call__ in game\event.py, line 41 > at in game\tabcontrol.py, line 34 > CLR Stack Trace: > at Microsoft.Scripting.Interpretation.Interpreter.InterpretTryStatement(InterpreterState > state, Expression expr) > at Microsoft.Scripting.Interpretation.Interpreter.Interpret(InterpreterState > state, Expression expr) > at Microsoft.Scripting.Interpretation.Interpreter.InterpretAndCheckFlow(InterpreterState > state, Expression node, Object& result) > at Microsoft.Scripting.Interpretation.Interpreter.InterpretBlock(InterpreterState > state, Expression expr) > at Microsoft.Scripting.Interpretation.Interpreter.Interpret(InterpreterState > state, Expression expr) > at Microsoft.Scripting.Interpretation.Interpreter.InterpretScopeExpression(InterpreterState > state, Expression expr) > at Microsoft.Scripting.Interpretation.Interpreter.Interpret(InterpreterState > state, Expression expr) > at Microsoft.Scripting.Interpretation.Interpreter.InterpretScopeExpression(InterpreterState > state, Expression expr) > at Microsoft.Scripting.Interpretation.Interpreter.Interpret(InterpreterState > state, Expression expr) > at Microsoft.Scripting.Interpretation.Interpreter.Execute(InterpreterState > state, Expression expression) > at Microsoft.Scripting.Interpretation.Interpreter.InterpretLambda(InterpreterState > parentState, LambdaExpression lambda, Object[] args, Object[] array) > at Microsoft.Scripting.Interpretation.LambdaInvoker.Invoke(Object[] > args, Object[] array) > at Interpreted_body_8(LambdaInvoker , Object ) > at _stub_$688##438(Closure , CallSite , CodeContext , Object , Object ) > at S$38.render$1313(Closure , Object self, Object namespaces) > at S$38.render$1313(Closure , Object[] ) > at _stub_$3950##2498(Closure , CallSite , CodeContext , Object , > Object , Object ) > at _stub_$3949##2497(Closure , CallSite , CodeContext , Object , Object ) > at S$26.load_xaml$926(Closure , Object template, Object namespaces) > at S$26.load_xaml$926(Closure , Object[] ) > at _stub_$3471##2038(Closure , CallSite , CodeContext , Object , > String , Object ) > at _stub_MatchCaller(Object , CallSite , Object[] ) > at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) > at Microsoft.Scripting.Actions.UpdateDelegates.Update4[T,T0,T1,T2,T3,TRet](CallSite > site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) > at S$79.__init__$2341(Closure , Object self, Object planet) > at _stub_$2796##1366(Closure , CallSite , CodeContext , Object , > Object , Object ) > at _stub_$690##440(Closure , CallSite , CodeContext , Object , Object ) > at _stub_MatchCaller(Object , CallSite , Object[] ) > at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) > at Microsoft.Scripting.Actions.UpdateDelegates.Update3[T,T0,T1,T2,TRet](CallSite > site, T0 arg0, T1 arg1, T2 arg2) > at _stub_$4051##2599(Closure , CallSite , CodeContext , Object , Object ) > at _stub_MatchCaller(Object , CallSite , Object[] ) > at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) > at Microsoft.Scripting.Actions.UpdateDelegates.Update3[T,T0,T1,T2,TRet](CallSite > site, T0 arg0, T1 arg1, T2 arg2) > at S$77.$2329(Closure ) > at _stub_$375##345(Closure , CallSite , CodeContext , Object ) > at _stub_MatchCaller(Object , CallSite , Object[] ) > at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) > at Microsoft.Scripting.Actions.UpdateDelegates.Update2[T,T0,T1,TRet](CallSite > site, T0 arg0, T1 arg1) > at S$72.ShowTab$2175(Closure , Object self, Object tab, Object silent) > at _stub_$3434##2001(Closure , CallSite , CodeContext , Object , > Object , Object , Object ) > at _stub_$2583##1153(Closure , CallSite , CodeContext , Object , > Object , Object ) > at _stub_MatchCaller(Object , CallSite , Object[] ) > at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) > at Microsoft.Scripting.Actions.UpdateDelegates.Update4[T,T0,T1,T2,T3,TRet](CallSite > site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) > at S$72.OnTabChanged$2177(Closure , Object self, Object sender, Object e) > at _stub_$705##455(Closure , CallSite , CodeContext , Object , > Object , Object , Object ) > at _stub_$704##454(Closure , CallSite , CodeContext , Object , > Object , Object ) > at _stub_MatchCaller(Object , CallSite , Object[] ) > at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) > at Microsoft.Scripting.Actions.UpdateDelegates.Update4[T,T0,T1,T2,T3,TRet](CallSite > site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) > at _stub_$2397##967(Closure , CallSite , CodeContext , Object , > Object , Object ) > at S$14.__call__$665(Closure , Object self, Object sender, Object > event_args) > at _stub_$705##455(Closure , CallSite , CodeContext , Object , > Object , Object , Object ) > at _stub_$704##454(Closure , CallSite , CodeContext , Object , > Object , Object ) > at _stub_MatchCaller(Object , CallSite , Object[] ) > at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) > at Microsoft.Scripting.Actions.UpdateDelegates.Update4[T,T0,T1,T2,T3,TRet](CallSite > site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) > at _stub_$4043##2591(Closure , CallSite , CodeContext , Object , > Object , Object ) > at _stub_MatchCaller(Object , CallSite , Object[] ) > at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) > at Microsoft.Scripting.Actions.UpdateDelegates.Update4[T,T0,T1,T2,T3,TRet](CallSite > site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) > at S$72.$2167(Closure , Object s, Object e) > at _stub_$4038##2586(Closure , CallSite , CodeContext , Object , > Object , Object ) > at _stub_MatchCaller(Object , CallSite , Object[] ) > at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) > at Microsoft.Scripting.Actions.UpdateDelegates.Update4[T,T0,T1,T2,T3,TRet](CallSite > site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) > at System.Void(Object, SelectionChangedEventArgs)(Object[] , Object > , SelectionChangedEventArgs ) > at System.Windows.Controls.ListBox.OnSelectionChanged(SelectionChangedEventArgs > e) > at System.Windows.Controls.ListBox.ProcessSelectionPropertyChange(DependencyProperty > changedProperty, Object oldValue, Object newValue) > at System.Windows.Controls.ListBox.OnSelectedItemChanged(Object > oldValue, Object newValue) > at System.Windows.Controls.ListBox.OnSelectedItemChanged(DependencyObject > d, DependencyPropertyChangedEventArgs e) > at System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyProperty > dp, Object newValue, Object oldValue) > at System.Windows.DependencyObject.SetValueInternal(DependencyProperty > dp, Object value, Boolean isSetByStyle, Boolean isSetByBuiltInStyle) > at System.Windows.DependencyObject.SetValueInternal(DependencyProperty > dp, Object value) > at System.Windows.DependencyObject.SetValue(DependencyProperty dp, > Object value) > at System.Windows.Controls.ListBox.set_SelectedItem(Object value) > at System.Windows.Controls.ListBox.SetSelectedItem(Object item) > at System.Windows.Controls.ListBox.NotifyListItemClicked(ListBoxItem > listBoxItem) > at System.Windows.Controls.ListBoxItem.OnMouseLeftButtonDown(MouseButtonEventArgs > e) > at System.Windows.Controls.ListBoxItem.<.ctor>b__0(Object sender, > MouseButtonEventArgs e) > at System.Windows.CoreInvokeHandler.InvokeEventHandler(Int32 > typeIndex, Delegate handlerDelegate, Object sender, Object args) > at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr > unmanagedObjArgs, Int32 argsTypeIndex, String eventName) > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From dan.eloff at gmail.com Sat Jul 12 20:32:44 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Sat, 12 Jul 2008 13:32:44 -0500 Subject: [IronPython] Possible bug in interpreter In-Reply-To: <4878E8D5.9030304@voidspace.org.uk> References: <4817b6fc0807120840v13dfbfb5pd86ed0834ba98a94@mail.gmail.com> <4817b6fc0807121011s2e95e200t1faf2b57545e6cf@mail.gmail.com> <4878E8D5.9030304@voidspace.org.uk> Message-ID: <4817b6fc0807121132n1b004a5pd329f4658980a036@mail.gmail.com> > Well that *looks* like a normal Python error. Is self.ns iterable? (It > either needs to be iterable, have a __getitem__ that supports integer > indexes or have a __contains__ method). > Whoops. You're right, there was something wrong with my __contains__ method. None of that explains the first error in my opinion, look at the offending line of python, but perhaps that is also my fault. That's a relief! Thanks! -Dan From fuzzyman at voidspace.org.uk Sat Jul 12 22:41:27 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sat, 12 Jul 2008 21:41:27 +0100 Subject: [IronPython] Possible bug in interpreter In-Reply-To: <4817b6fc0807120840v13dfbfb5pd86ed0834ba98a94@mail.gmail.com> References: <4817b6fc0807120840v13dfbfb5pd86ed0834ba98a94@mail.gmail.com> Message-ID: <6f4025010807121341o22714bc7ydc14f49ce2354063@mail.gmail.com> 2008/7/12 Dan Eloff : > Hopefully this stack trace will be enough to track this down, but if > it's not please ask for any information you need. > > The value of attr is "__getitem__". Well - if this is a new style class then '__getitem__' shouldn't be looked through __getattr__ anyway. Apart from that, from the snippet you posted it is hard to see how it could be anything other than a bug in IronPython. Can you post a minimal repro? Michael > > > -Dan > > ValueError: too many values to unpack > game\models\__init__.py > Line 12: except KeyError: > Line 13: print attr > Line 14: raise AttributeError, attr > Line 15: > Line 16: def set(self, key, value): > > ValueError > at __getattr__ in game\models\__init__.py, line 14 > at body in , line 369 > at render in beskar\template.py, line 18 > at load_xaml in game\templates\__init__.py, line 13 > at __init__ in game\planet.py, line 11 > at in game\window_manager.py, line 60 > at ShowTab in game\tabcontrol.py, line 85 > at OnTabChanged in game\tabcontrol.py, line 101 > at __call__ in game\event.py, line 41 > at in game\tabcontrol.py, line 34 > CLR Stack Trace: > at > Microsoft.Scripting.Interpretation.Interpreter.InterpretTryStatement(InterpreterState > state, Expression expr) > at > Microsoft.Scripting.Interpretation.Interpreter.Interpret(InterpreterState > state, Expression expr) > at > Microsoft.Scripting.Interpretation.Interpreter.InterpretAndCheckFlow(InterpreterState > state, Expression node, Object& result) > at > Microsoft.Scripting.Interpretation.Interpreter.InterpretBlock(InterpreterState > state, Expression expr) > at > Microsoft.Scripting.Interpretation.Interpreter.Interpret(InterpreterState > state, Expression expr) > at > Microsoft.Scripting.Interpretation.Interpreter.InterpretScopeExpression(InterpreterState > state, Expression expr) > at > Microsoft.Scripting.Interpretation.Interpreter.Interpret(InterpreterState > state, Expression expr) > at > Microsoft.Scripting.Interpretation.Interpreter.InterpretScopeExpression(InterpreterState > state, Expression expr) > at > Microsoft.Scripting.Interpretation.Interpreter.Interpret(InterpreterState > state, Expression expr) > at > Microsoft.Scripting.Interpretation.Interpreter.Execute(InterpreterState > state, Expression expression) > at > Microsoft.Scripting.Interpretation.Interpreter.InterpretLambda(InterpreterState > parentState, LambdaExpression lambda, Object[] args, Object[] array) > at Microsoft.Scripting.Interpretation.LambdaInvoker.Invoke(Object[] > args, Object[] array) > at Interpreted_body_8(LambdaInvoker , Object ) > at _stub_$688##438(Closure , CallSite , CodeContext , Object , Object ) > at S$38.render$1296(Closure , Object self, Object namespaces) > at S$38.render$1296(Closure , Object[] ) > at _stub_$3935##2482(Closure , CallSite , CodeContext , Object , > Object , Object ) > at _stub_$3934##2481(Closure , CallSite , CodeContext , Object , Object ) > at S$26.load_xaml$927(Closure , Object template, Object namespaces) > at S$26.load_xaml$927(Closure , Object[] ) > at _stub_$3454##2020(Closure , CallSite , CodeContext , Object , > String , Object ) > at _stub_MatchCaller(Object , CallSite , Object[] ) > at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) > at > Microsoft.Scripting.Actions.UpdateDelegates.Update4[T,T0,T1,T2,T3,TRet](CallSite > site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) > at S$79.__init__$2342(Closure , Object self, Object planet) > at _stub_$2797##1366(Closure , CallSite , CodeContext , Object , > Object , Object ) > at _stub_$690##440(Closure , CallSite , CodeContext , Object , Object ) > at _stub_MatchCaller(Object , CallSite , Object[] ) > at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) > at > Microsoft.Scripting.Actions.UpdateDelegates.Update3[T,T0,T1,T2,TRet](CallSite > site, T0 arg0, T1 arg1, T2 arg2) > at _stub_$4077##2624(Closure , CallSite , CodeContext , Object , Object ) > at _stub_MatchCaller(Object , CallSite , Object[] ) > at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) > at > Microsoft.Scripting.Actions.UpdateDelegates.Update3[T,T0,T1,T2,TRet](CallSite > site, T0 arg0, T1 arg1, T2 arg2) > at S$77.$2330(Closure ) > at _stub_$375##345(Closure , CallSite , CodeContext , Object ) > at _stub_MatchCaller(Object , CallSite , Object[] ) > at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) > at > Microsoft.Scripting.Actions.UpdateDelegates.Update2[T,T0,T1,TRet](CallSite > site, T0 arg0, T1 arg1) > at S$72.ShowTab$2176(Closure , Object self, Object tab, Object silent) > at _stub_$3417##1983(Closure , CallSite , CodeContext , Object , > Object , Object , Object ) > at _stub_$2584##1153(Closure , CallSite , CodeContext , Object , > Object , Object ) > at _stub_MatchCaller(Object , CallSite , Object[] ) > at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) > at > Microsoft.Scripting.Actions.UpdateDelegates.Update4[T,T0,T1,T2,T3,TRet](CallSite > site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) > at S$72.OnTabChanged$2178(Closure , Object self, Object sender, Object e) > at _stub_$705##455(Closure , CallSite , CodeContext , Object , > Object , Object , Object ) > at _stub_$704##454(Closure , CallSite , CodeContext , Object , > Object , Object ) > at _stub_MatchCaller(Object , CallSite , Object[] ) > at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) > at > Microsoft.Scripting.Actions.UpdateDelegates.Update4[T,T0,T1,T2,T3,TRet](CallSite > site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) > at _stub_$2398##967(Closure , CallSite , CodeContext , Object , > Object , Object ) > at S$14.__call__$665(Closure , Object self, Object sender, Object > event_args) > at _stub_$705##455(Closure , CallSite , CodeContext , Object , > Object , Object , Object ) > at _stub_$704##454(Closure , CallSite , CodeContext , Object , > Object , Object ) > at _stub_MatchCaller(Object , CallSite , Object[] ) > at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) > at > Microsoft.Scripting.Actions.UpdateDelegates.Update4[T,T0,T1,T2,T3,TRet](CallSite > site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) > at _stub_$4069##2616(Closure , CallSite , CodeContext , Object , > Object , Object ) > at _stub_MatchCaller(Object , CallSite , Object[] ) > at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) > at > Microsoft.Scripting.Actions.UpdateDelegates.Update4[T,T0,T1,T2,T3,TRet](CallSite > site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) > at S$72.$2168(Closure , Object s, Object e) > at _stub_$4064##2611(Closure , CallSite , CodeContext , Object , > Object , Object ) > at _stub_MatchCaller(Object , CallSite , Object[] ) > at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) > at > Microsoft.Scripting.Actions.UpdateDelegates.Update4[T,T0,T1,T2,T3,TRet](CallSite > site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) > at System.Void(Object, SelectionChangedEventArgs)(Object[] , Object > , SelectionChangedEventArgs ) > at > System.Windows.Controls.ListBox.OnSelectionChanged(SelectionChangedEventArgs > e) > at > System.Windows.Controls.ListBox.ProcessSelectionPropertyChange(DependencyProperty > changedProperty, Object oldValue, Object newValue) > at System.Windows.Controls.ListBox.OnSelectedItemChanged(Object > oldValue, Object newValue) > at System.Windows.Controls.ListBox.OnSelectedItemChanged(DependencyObject > d, DependencyPropertyChangedEventArgs e) > at > System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyProperty > dp, Object newValue, Object oldValue) > at System.Windows.DependencyObject.SetValueInternal(DependencyProperty > dp, Object value, Boolean isSetByStyle, Boolean isSetByBuiltInStyle) > at System.Windows.DependencyObject.SetValueInternal(DependencyProperty > dp, Object value) > at System.Windows.DependencyObject.SetValue(DependencyProperty dp, > Object value) > at System.Windows.Controls.ListBox.set_SelectedItem(Object value) > at System.Windows.Controls.ListBox.SetSelectedItem(Object item) > at System.Windows.Controls.ListBox.NotifyListItemClicked(ListBoxItem > listBoxItem) > at > System.Windows.Controls.ListBoxItem.OnMouseLeftButtonDown(MouseButtonEventArgs > e) > at System.Windows.Controls.ListBoxItem.<.ctor>b__0(Object sender, > MouseButtonEventArgs e) > at System.Windows.CoreInvokeHandler.InvokeEventHandler(Int32 > typeIndex, Delegate handlerDelegate, Object sender, Object args) > at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr > unmanagedObjArgs, Int32 argsTypeIndex, String eventName) > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.theotherdelia.co.uk/ http://www.voidspace.org.uk/ http://www.ironpython.info/ http://www.resolverhacks.net/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From Colin.Han at grapecity.com Sun Jul 13 11:39:45 2008 From: Colin.Han at grapecity.com (Han Kejing) Date: Sun, 13 Jul 2008 17:39:45 +0800 Subject: [IronPython] How to load built-in models. Message-ID: <8FAE2A142FCABE4EB6B37348D78A9BFE02664A34@XAEXG.GRAPECITY.NET> Hi, all, I was write follows code in my WinForm application. But I got an SyntaxErrorException "unexpected token 'print'". ScriptRuntimeSetup runtimeSetup = new ScriptRuntimeSetup(true); this._runtime = ScriptRuntime.Create(runtimeSetup); this._engine = this._runtime.GetEngine(typeof(PythonContext)); this._scope = this._engine.CreateScope(); _engine.CreateScriptSourceFromString("print(\"test\")").Execute(_scope); I think maybe the built-ins modules is not loaded in my code. How to load it? Thanks. ---------------------------------------------------------------- Do ONE thing, and do it WELL. Colin Han @ GrapeCity -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Sun Jul 13 12:33:09 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sun, 13 Jul 2008 11:33:09 +0100 Subject: [IronPython] How to load built-in models. In-Reply-To: <8FAE2A142FCABE4EB6B37348D78A9BFE02664A34@XAEXG.GRAPECITY.NET> References: <8FAE2A142FCABE4EB6B37348D78A9BFE02664A34@XAEXG.GRAPECITY.NET> Message-ID: <4879D9E5.8050903@voidspace.org.uk> Han Kejing wrote: > > Hi, all, > > I was write follows code in my WinForm application. But I got an > SyntaxErrorException ?unexpected token 'print'?. > > ScriptRuntimeSetup runtimeSetup = new ScriptRuntimeSetup(true); > > this._runtime = ScriptRuntime.Create(runtimeSetup); > > this._engine = this._runtime.GetEngine(typeof(PythonContext)); > > this._scope = this._engine.CreateScope(); > > _engine.CreateScriptSourceFromString("print(\"test\")").Execute(_scope); > That last line should be: _engine.CreateScriptSourceFromString("print(\"test\")", SourceCodeKind.Statements).Execute(_scope); Michael > I think maybe the built-ins modules is not loaded in my code. > > How to load it? Thanks. > > ---------------------------------------------------------------- > > Do ONE thing, and do it WELL. > > Colin Han/ @/ *GrapeCity* > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From dan.eloff at gmail.com Sun Jul 13 19:05:43 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Sun, 13 Jul 2008 12:05:43 -0500 Subject: [IronPython] Possible bug in interpreter In-Reply-To: <6f4025010807121341o22714bc7ydc14f49ce2354063@mail.gmail.com> References: <4817b6fc0807120840v13dfbfb5pd86ed0834ba98a94@mail.gmail.com> <6f4025010807121341o22714bc7ydc14f49ce2354063@mail.gmail.com> Message-ID: <4817b6fc0807131005g410e7106o96a6255fd21cafb2@mail.gmail.com> On Sat, Jul 12, 2008 at 3:41 PM, Michael Foord wrote: > > Well - if this is a new style class then '__getitem__' shouldn't be looked > through __getattr__ anyway. Yes, there was an issue with the way I defined __getitem__, __contains__, etc. And of course, if they don't exist they will go through __getattr__. > Apart from that, from the snippet you posted it is hard to see how it could > be anything other than a bug in IronPython. > > Can you post a minimal repro? > That's the thing. I was unable to duplicate it outside of my application, using the exact same class. One of those things. I'm also no longer able to easily duplicate it in my application due to unrelated changes. Oh well, outa sight, outa minds says I. There are enough actual bugs between the Silverlight and IronPython betas that I'm not that interested in chasing phantoms. -Dan From dan.eloff at gmail.com Sun Jul 13 19:14:18 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Sun, 13 Jul 2008 12:14:18 -0500 Subject: [IronPython] Using Python special methods in C# Message-ID: <4817b6fc0807131014v72644dd8r9ea464631e43e147@mail.gmail.com> Something I've found a little difficult in C# is python special methods. It seems sometimes you can just declare them on the C# class, (__repr__?) and they will work, other times you need to implement an interface (__call__?) is there any place this is documented? I'm a little confused about how to add special methods on C# classes. I want to add __getattr__ to a C# class (actually a subclass of PythonDictionary), and I have no idea how. Thanks, -Dan From fuzzyman at voidspace.org.uk Sun Jul 13 19:21:17 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sun, 13 Jul 2008 18:21:17 +0100 Subject: [IronPython] Using Python special methods in C# In-Reply-To: <4817b6fc0807131014v72644dd8r9ea464631e43e147@mail.gmail.com> References: <4817b6fc0807131014v72644dd8r9ea464631e43e147@mail.gmail.com> Message-ID: <487A398D.8070109@voidspace.org.uk> Dan Eloff wrote: > Something I've found a little difficult in C# is python special > methods. It seems sometimes you can just declare them on the C# class, > (__repr__?) and they will work, other times you need to implement an > interface (__call__?) is there any place this is documented? > > I'm a little confused about how to add special methods on C# classes. > > I want to add __getattr__ to a C# class (actually a subclass of > PythonDictionary), and I have no idea how. > This example from Srivatsn shows you how: http://blogs.msdn.com/srivatsn/archive/2008/04/12/turning-your-net-object-models-dynamic-for-ironpython.aspx Michael > Thanks, > -Dan > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From dinov at exchange.microsoft.com Sun Jul 13 20:04:19 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Sun, 13 Jul 2008 11:04:19 -0700 Subject: [IronPython] Using Python special methods in C# In-Reply-To: <487A398D.8070109@voidspace.org.uk> References: <4817b6fc0807131014v72644dd8r9ea464631e43e147@mail.gmail.com> <487A398D.8070109@voidspace.org.uk> Message-ID: <7AD436E4270DD54A94238001769C2227012C93430DE7@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Srivatsn's blog is an important piece of the puzzle, but the more general answer is implementing the __*__ method directly should always work. If it doesn't then it's a bug - like where __repr__ wasn't working w/o implementing the interface until recently. But there is a good reason to not implement the __*__ method - and that's ensuring that your objects will work good in a multi-language environment. What IronPython does to expose .NET objects into Python is it maps a large number of .NET interfaces and methods into Python methods. If you'd like to see the all of the mappings they're contained entirely in TypeInfo.cs. So instead of implementing __getitem__ you can implement a C# indexer, instead of __enter__/__exit__ you can implement IDisposable - assuming you're not doing more interesting things w/ __enter__/__exit__, etc... If there's some mapping that you think should exist but we don't have let us know - for example until recently we had overlooked mapping IDisposable. To get the best interop if there's a .NET interface or operator method that maps onto the Python methods you should use that. That includes the extended operators that we've defined for the DLR default binder like GetCustomMember as Srivatsn's blog demonstrates. Otherwise fallback to the __*_- method. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Sunday, July 13, 2008 10:21 AM To: Discussion of IronPython Subject: Re: [IronPython] Using Python special methods in C# Dan Eloff wrote: > Something I've found a little difficult in C# is python special > methods. It seems sometimes you can just declare them on the C# class, > (__repr__?) and they will work, other times you need to implement an > interface (__call__?) is there any place this is documented? > > I'm a little confused about how to add special methods on C# classes. > > I want to add __getattr__ to a C# class (actually a subclass of > PythonDictionary), and I have no idea how. > This example from Srivatsn shows you how: http://blogs.msdn.com/srivatsn/archive/2008/04/12/turning-your-net-object-models-dynamic-for-ironpython.aspx Michael > Thanks, > -Dan > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dan.eloff at gmail.com Sun Jul 13 20:51:52 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Sun, 13 Jul 2008 13:51:52 -0500 Subject: [IronPython] Using Python special methods in C# In-Reply-To: <7AD436E4270DD54A94238001769C2227012C93430DE7@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <4817b6fc0807131014v72644dd8r9ea464631e43e147@mail.gmail.com> <487A398D.8070109@voidspace.org.uk> <7AD436E4270DD54A94238001769C2227012C93430DE7@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <4817b6fc0807131151q25d92d67hf13e147eee287e33@mail.gmail.com> Thanks guys. I understand this a lot better now. -Dan On Sun, Jul 13, 2008 at 1:04 PM, Dino Viehland wrote: > Srivatsn's blog is an important piece of the puzzle, but the more general answer is implementing the __*__ method directly should always work. If it doesn't then it's a bug - like where __repr__ wasn't working w/o implementing the interface until recently. > > But there is a good reason to not implement the __*__ method - and that's ensuring that your objects will work good in a multi-language environment. What IronPython does to expose .NET objects into Python is it maps a large number of .NET interfaces and methods into Python methods. If you'd like to see the all of the mappings they're contained entirely in TypeInfo.cs. So instead of implementing __getitem__ you can implement a C# indexer, instead of __enter__/__exit__ you can implement IDisposable - assuming you're not doing more interesting things w/ __enter__/__exit__, etc... If there's some mapping that you think should exist but we don't have let us know - for example until recently we had overlooked mapping IDisposable. > > To get the best interop if there's a .NET interface or operator method that maps onto the Python methods you should use that. That includes the extended operators that we've defined for the DLR default binder like GetCustomMember as Srivatsn's blog demonstrates. Otherwise fallback to the __*_- method. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Sunday, July 13, 2008 10:21 AM > To: Discussion of IronPython > Subject: Re: [IronPython] Using Python special methods in C# > > Dan Eloff wrote: >> Something I've found a little difficult in C# is python special >> methods. It seems sometimes you can just declare them on the C# class, >> (__repr__?) and they will work, other times you need to implement an >> interface (__call__?) is there any place this is documented? >> >> I'm a little confused about how to add special methods on C# classes. >> >> I want to add __getattr__ to a C# class (actually a subclass of >> PythonDictionary), and I have no idea how. >> > > This example from Srivatsn shows you how: > > http://blogs.msdn.com/srivatsn/archive/2008/04/12/turning-your-net-object-models-dynamic-for-ironpython.aspx > > Michael >> Thanks, >> -Dan >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 dan.eloff at gmail.com Mon Jul 14 01:36:48 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Sun, 13 Jul 2008 18:36:48 -0500 Subject: [IronPython] Add/remove python function to C# event in C# Message-ID: <4817b6fc0807131636m19ee6ebfocbcfe9bb01ab6ff5@mail.gmail.com> How could I add/remove a python callable to a C# event? Surely there must be a simple interface that uses ReflectedEvent/BoundEvent under the hood. Thanks, -Dan From dinov at exchange.microsoft.com Mon Jul 14 01:50:42 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Sun, 13 Jul 2008 16:50:42 -0700 Subject: [IronPython] Add/remove python function to C# event in C# In-Reply-To: <4817b6fc0807131636m19ee6ebfocbcfe9bb01ab6ff5@mail.gmail.com> References: <4817b6fc0807131636m19ee6ebfocbcfe9bb01ab6ff5@mail.gmail.com> Message-ID: <7AD436E4270DD54A94238001769C2227012C93430DF7@DF-GRTDANE-MSG.exchange.corp.microsoft.com> objOrType.someEvent += somePythonFunctionOrCallableObject And objOrType.someEvent -= somePythonFunctionOrCallableObject Should just work. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff Sent: Sunday, July 13, 2008 4:37 PM To: Discussion of IronPython Subject: [IronPython] Add/remove python function to C# event in C# How could I add/remove a python callable to a C# event? Surely there must be a simple interface that uses ReflectedEvent/BoundEvent under the hood. Thanks, -Dan _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dan.eloff at gmail.com Mon Jul 14 02:08:45 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Sun, 13 Jul 2008 19:08:45 -0500 Subject: [IronPython] Add/remove python function to C# event in C# In-Reply-To: <7AD436E4270DD54A94238001769C2227012C93430DF7@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <4817b6fc0807131636m19ee6ebfocbcfe9bb01ab6ff5@mail.gmail.com> <7AD436E4270DD54A94238001769C2227012C93430DF7@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <4817b6fc0807131708n34e5454xf303d8d3f8cf2441@mail.gmail.com> On Sun, Jul 13, 2008 at 6:50 PM, Dino Viehland wrote: > objOrType.someEvent += somePythonFunctionOrCallableObject > > And > > objOrType.someEvent -= somePythonFunctionOrCallableObject > > Should just work. It does just work, in Python. What do I do in C#? Thanks, -Dan From dinov at exchange.microsoft.com Mon Jul 14 02:20:09 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Sun, 13 Jul 2008 17:20:09 -0700 Subject: [IronPython] Add/remove python function to C# event in C# In-Reply-To: <4817b6fc0807131708n34e5454xf303d8d3f8cf2441@mail.gmail.com> References: <4817b6fc0807131636m19ee6ebfocbcfe9bb01ab6ff5@mail.gmail.com> <7AD436E4270DD54A94238001769C2227012C93430DF7@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <4817b6fc0807131708n34e5454xf303d8d3f8cf2441@mail.gmail.com> Message-ID: <7AD436E4270DD54A94238001769C2227012C93430DFA@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Ahh I see what you mean now. If you're doing this from the hosting APIs you can use the ObjectOperations class to do the conversion: someObj.someEvent += objOps.ConvertTo(obj); A Python specific solution would be doing: someObj.SomeEvent += (DelegateType)Converter.ConvertToDelegate(obj, typeof(DelegateType)); -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff Sent: Sunday, July 13, 2008 5:09 PM To: Discussion of IronPython Subject: Re: [IronPython] Add/remove python function to C# event in C# On Sun, Jul 13, 2008 at 6:50 PM, Dino Viehland wrote: > objOrType.someEvent += somePythonFunctionOrCallableObject > > And > > objOrType.someEvent -= somePythonFunctionOrCallableObject > > Should just work. It does just work, in Python. What do I do in C#? Thanks, -Dan _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From curt at hagenlocher.org Mon Jul 14 02:38:11 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Sun, 13 Jul 2008 17:38:11 -0700 Subject: [IronPython] Embedded IronPython in .NET C# WinForm app error In-Reply-To: <001301c8e0f1$b541d5f0$6500a8c0@valleyforge> References: <001301c8e0f1$b541d5f0$6500a8c0@valleyforge> Message-ID: 80004002 is an HRESULT that's E_NOINTERFACE. It's coming from the COM component itself and not from IronPython. One possible explanation is that the component isn't compatible with the apartment model of the current thread. Try changing from MTA to STA (or vice versa) and seeing if that resolves the problem. On Tue, Jul 8, 2008 at 4:56 AM, Mitch Barnett wrote: > Hello, > > I have a .NET C# WinForm application that hosts an IronPython 1.1 engine. > In the WinForm app, the scripting API is exposed through a web service > interface (using Windows Communication Foundation) so that from a remote > console, (over WCF), I can execute IronPython code on the computer that is > running the WinForm app. > > The project is at: http://www.codeplex.com/gsb > > Works 99% of the time, but the 1% of the time that it does not work is for > cases like this: > > >>> IronPython 1.1 (1.1) on .NET 2.0.50727.1433 > >>> import clr > >>> import sys > >>> sys.path.append(r"c:\projects\gsbservice\gsbservice1") > >>> clr.AddReferenceToFile("AgentServerObjects.dll") > >>> from AgentServerObjects import * > >>> a = AgentServerClass() > Traceback (most recent call last): File C:\Projects\GSBService\GSBService1 > \ParseInteractive.cs, line 93, in CallIPCmd File , line 0, in ##21 > File , line 0, in DefaultNew##22 File , line 0, in .ctor##26 TypeError: > Creating an instance of the COM component with CLSID > {D45FD2FC-5C6E-11D1-9EC1- > 00C04FD7081F} from the IClassFactory failed due to the following error: > 80004002. > >>> > > Of course if I try the same thing using the IPY.exe console on the same > computer, using the same AgentServerObjects.dll, it works just fine. > > Any thoughts appreciated as to what might be going wrong. > > Thanks, > > Mitch > > _______________________________________________ > 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 dan.eloff at gmail.com Mon Jul 14 03:12:06 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Sun, 13 Jul 2008 20:12:06 -0500 Subject: [IronPython] Add/remove python function to C# event in C# In-Reply-To: <7AD436E4270DD54A94238001769C2227012C93430DFA@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <4817b6fc0807131636m19ee6ebfocbcfe9bb01ab6ff5@mail.gmail.com> <7AD436E4270DD54A94238001769C2227012C93430DF7@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <4817b6fc0807131708n34e5454xf303d8d3f8cf2441@mail.gmail.com> <7AD436E4270DD54A94238001769C2227012C93430DFA@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <4817b6fc0807131812v2ddf16c3i6300eb8de0b2fdcc@mail.gmail.com> On Sun, Jul 13, 2008 at 7:20 PM, Dino Viehland wrote: > Ahh I see what you mean now. If you're doing this from the hosting APIs you can use the ObjectOperations class to do the conversion: > > someObj.someEvent += objOps.ConvertTo(obj); That is disturbingly easy. I knew you'd know the answer. But I wonder if that would work for removing a handler from an event? someObj.someEvent += objOps.ConvertTo(obj); someObj.someEvent -= objOps.ConvertTo(obj); One workaround might be to cache the delegate on the way in and use the cached delegate to remove it. _cache[obj] = objOps.ConvertTo(obj); someObj.someEvent += _cache[obj] someObj.someEvent -= _cache[obj] But maybe there's a better way, or maybe I'm daft and it'll just work. -Dan From dinov at exchange.microsoft.com Mon Jul 14 03:19:34 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Sun, 13 Jul 2008 18:19:34 -0700 Subject: [IronPython] Add/remove python function to C# event in C# In-Reply-To: <4817b6fc0807131812v2ddf16c3i6300eb8de0b2fdcc@mail.gmail.com> References: <4817b6fc0807131636m19ee6ebfocbcfe9bb01ab6ff5@mail.gmail.com> <7AD436E4270DD54A94238001769C2227012C93430DF7@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <4817b6fc0807131708n34e5454xf303d8d3f8cf2441@mail.gmail.com> <7AD436E4270DD54A94238001769C2227012C93430DFA@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <4817b6fc0807131812v2ddf16c3i6300eb8de0b2fdcc@mail.gmail.com> Message-ID: <7AD436E4270DD54A94238001769C2227012C93430DFB@DF-GRTDANE-MSG.exchange.corp.microsoft.com> It should just work in the next release :). There are problems with it right now but I checked in a fix to make this work last week. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff Sent: Sunday, July 13, 2008 6:12 PM To: Discussion of IronPython Subject: Re: [IronPython] Add/remove python function to C# event in C# On Sun, Jul 13, 2008 at 7:20 PM, Dino Viehland wrote: > Ahh I see what you mean now. If you're doing this from the hosting APIs you can use the ObjectOperations class to do the conversion: > > someObj.someEvent += objOps.ConvertTo(obj); That is disturbingly easy. I knew you'd know the answer. But I wonder if that would work for removing a handler from an event? someObj.someEvent += objOps.ConvertTo(obj); someObj.someEvent -= objOps.ConvertTo(obj); One workaround might be to cache the delegate on the way in and use the cached delegate to remove it. _cache[obj] = objOps.ConvertTo(obj); someObj.someEvent += _cache[obj] someObj.someEvent -= _cache[obj] But maybe there's a better way, or maybe I'm daft and it'll just work. -Dan _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Colin.Han at grapecity.com Mon Jul 14 03:59:02 2008 From: Colin.Han at grapecity.com (Han Kejing) Date: Mon, 14 Jul 2008 09:59:02 +0800 Subject: [IronPython] How to load built-in models. In-Reply-To: <4879D9E5.8050903@voidspace.org.uk> References: <8FAE2A142FCABE4EB6B37348D78A9BFE02664A34@XAEXG.GRAPECITY.NET> <4879D9E5.8050903@voidspace.org.uk> Message-ID: <8FAE2A142FCABE4EB6B37348D78A9BFE02664ACE@XAEXG.GRAPECITY.NET> Thank you so much, it is working. ---------------------------------------------------------------- Follow my heart Colin Han @ MultiRow Developer Team (A Strong Team) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: 2008?7?13? 18:33 To: Discussion of IronPython Subject: Re: [IronPython] How to load built-in models. Han Kejing wrote: > > Hi, all, > > I was write follows code in my WinForm application. But I got an > SyntaxErrorException ?unexpected token 'print'?. > > ScriptRuntimeSetup runtimeSetup = new ScriptRuntimeSetup(true); > > this._runtime = ScriptRuntime.Create(runtimeSetup); > > this._engine = this._runtime.GetEngine(typeof(PythonContext)); > > this._scope = this._engine.CreateScope(); > > _engine.CreateScriptSourceFromString("print(\"test\")").Execute(_scope); > That last line should be: _engine.CreateScriptSourceFromString("print(\"test\")", SourceCodeKind.Statements).Execute(_scope); Michael > I think maybe the built-ins modules is not loaded in my code. > > How to load it? Thanks. > > ---------------------------------------------------------------- > > Do ONE thing, and do it WELL. > > Colin Han/ @/ *GrapeCity* > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From jdhardy at gmail.com Mon Jul 14 04:21:00 2008 From: jdhardy at gmail.com (Jeff Hardy) Date: Sun, 13 Jul 2008 20:21:00 -0600 Subject: [IronPython] "Cannot import name Enum" In-Reply-To: References: Message-ID: Hi Srivatsn, That did the trick, thanks. -Jeff On Thu, Jul 10, 2008 at 6:32 PM, Srivatsn Narayanan wrote: > You will have to call LoadAssembly on your ScriptRuntime to load mscorlib.dll: > > scriptRuntime.LoadAssembly(typeof(string).Assembly) > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jeff Hardy > Sent: Thursday, July 10, 2008 5:27 PM > To: Discussion of IronPython > Subject: [IronPython] "Cannot import name Enum" > > Hi all, > I'm hosting IronPython 2.0b3. When executing "from System import > Enum", I get the error "Cannot import name Enum ". It works fine when > executed from the console. Do I need to set up some references in the > hosting code to make this work? > > -Jeff > _______________________________________________ > 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 iain at onesquared.net Mon Jul 14 05:30:20 2008 From: iain at onesquared.net (Iain Dickason) Date: Mon, 14 Jul 2008 15:30:20 +1200 Subject: [IronPython] Windows Service Message-ID: <487AC84C.6090900@onesquared.net> Has anyone used IronPython to create a native Windows Service? Thanks Iain. From dan.eloff at gmail.com Mon Jul 14 08:18:26 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Mon, 14 Jul 2008 01:18:26 -0500 Subject: [IronPython] Add/remove python function to C# event in C# In-Reply-To: <7AD436E4270DD54A94238001769C2227012C93430DFB@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <4817b6fc0807131636m19ee6ebfocbcfe9bb01ab6ff5@mail.gmail.com> <7AD436E4270DD54A94238001769C2227012C93430DF7@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <4817b6fc0807131708n34e5454xf303d8d3f8cf2441@mail.gmail.com> <7AD436E4270DD54A94238001769C2227012C93430DFA@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <4817b6fc0807131812v2ddf16c3i6300eb8de0b2fdcc@mail.gmail.com> <7AD436E4270DD54A94238001769C2227012C93430DFB@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <4817b6fc0807132318q825a514pee30c22deda6ceb4@mail.gmail.com> On Sun, Jul 13, 2008 at 8:19 PM, Dino Viehland wrote: > It should just work in the next release :). There are problems with it right now but I checked in a fix to make this work last week. Well I don't use it right away, so I'll just plumb it in like that, and it'll be working by the time I need it. Thanks for your help. -Dan > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff > Sent: Sunday, July 13, 2008 6:12 PM > To: Discussion of IronPython > Subject: Re: [IronPython] Add/remove python function to C# event in C# > > On Sun, Jul 13, 2008 at 7:20 PM, Dino Viehland > wrote: >> Ahh I see what you mean now. If you're doing this from the hosting APIs you can use the ObjectOperations class to do the conversion: >> >> someObj.someEvent += objOps.ConvertTo(obj); > > That is disturbingly easy. I knew you'd know the answer. > > But I wonder if that would work for removing a handler from an event? > > someObj.someEvent += objOps.ConvertTo(obj); > someObj.someEvent -= objOps.ConvertTo(obj); > > One workaround might be to cache the delegate on the way in and use > the cached delegate to remove it. > > _cache[obj] = objOps.ConvertTo(obj); > someObj.someEvent += _cache[obj] > > someObj.someEvent -= _cache[obj] > > But maybe there's a better way, or maybe I'm daft and it'll just work. > > -Dan > _______________________________________________ > 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 zsidoz at pragma.hu Mon Jul 14 15:19:24 2008 From: zsidoz at pragma.hu (=?iso-8859-2?Q?Zsid=F3_Zolt=E1n?=) Date: Mon, 14 Jul 2008 15:19:24 +0200 Subject: [IronPython] Matplotlib from IronPython 1.1.1 Message-ID: <00fc01c8e5b4$3c8f5700$6701a8c0@TOSHIBA> Hello All, Is it possible to use Matplotlib from IronPython 1.1.1? Regards, Zoli -------------- next part -------------- An HTML attachment was scrubbed... URL: From curt at hagenlocher.org Mon Jul 14 15:29:53 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Mon, 14 Jul 2008 06:29:53 -0700 Subject: [IronPython] Matplotlib from IronPython 1.1.1 In-Reply-To: <00fc01c8e5b4$3c8f5700$6701a8c0@TOSHIBA> References: <00fc01c8e5b4$3c8f5700$6701a8c0@TOSHIBA> Message-ID: Matplotlib requires numpy, which is a C extension. IronPython doesn't support C extensions directly, but Resolver Systems is working on an open source compatibility layer with the explicit goal of numpy support. You can find more information at http://www.resolversystems.com/documentation/index.php/Ironclad. On Mon, Jul 14, 2008 at 6:19 AM, Zsid? Zolt?n wrote: > Hello All, > > Is it possible to use Matplotlib from IronPython 1.1.1? > > Regards, > > Zoli > > > _______________________________________________ > 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 zsidoz at pragma.hu Mon Jul 14 15:40:53 2008 From: zsidoz at pragma.hu (=?iso-8859-1?Q?Zsid=F3_Zolt=E1n?=) Date: Mon, 14 Jul 2008 15:40:53 +0200 Subject: [IronPython] Matplotlib from IronPython 1.1.1 References: <00fc01c8e5b4$3c8f5700$6701a8c0@TOSHIBA> Message-ID: <011c01c8e5b7$3cad8600$6701a8c0@TOSHIBA> As I read: "Ironclad works with IronPython 2 and targets CPython 2.5. " So it won't be possible to use it with IP 1.1.1. Right? Regards, Zoli ----- Original Message ----- From: Curt Hagenlocher To: Discussion of IronPython Sent: Monday, July 14, 2008 3:29 PM Subject: Re: [IronPython] Matplotlib from IronPython 1.1.1 Matplotlib requires numpy, which is a C extension. IronPython doesn't support C extensions directly, but Resolver Systems is working on an open source compatibility layer with the explicit goal of numpy support. You can find more information at http://www.resolversystems.com/documentation/index.php/Ironclad. On Mon, Jul 14, 2008 at 6:19 AM, Zsid? Zolt?n wrote: Hello All, Is it possible to use Matplotlib from IronPython 1.1.1? Regards, Zoli _______________________________________________ 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 curt at hagenlocher.org Mon Jul 14 17:15:42 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Mon, 14 Jul 2008 08:15:42 -0700 Subject: [IronPython] Matplotlib from IronPython 1.1.1 In-Reply-To: <011c01c8e5b7$3cad8600$6701a8c0@TOSHIBA> References: <00fc01c8e5b4$3c8f5700$6701a8c0@TOSHIBA> <011c01c8e5b7$3cad8600$6701a8c0@TOSHIBA> Message-ID: Ah, I hadn't noticed that. I suspect that it wouldn't be *too* hard to port it to 1.1.1, but I can well imagine that the people working on it won't have prioritized that. On Mon, Jul 14, 2008 at 6:40 AM, Zsid? Zolt?n wrote: > As I read: "Ironclad works with IronPython 2 and targets CPython 2.5. " > So it won't be possible to use it with IP 1.1.1. Right? > > Regards, > Zoli > > ----- Original Message ----- > *From:* Curt Hagenlocher > *To:* Discussion of IronPython > *Sent:* Monday, July 14, 2008 3:29 PM > *Subject:* Re: [IronPython] Matplotlib from IronPython 1.1.1 > > Matplotlib requires numpy, which is a C extension. IronPython doesn't > support C extensions directly, but Resolver Systems is working on an open > source compatibility layer with the explicit goal of numpy support. You can > find more information at > http://www.resolversystems.com/documentation/index.php/Ironclad. > > On Mon, Jul 14, 2008 at 6:19 AM, Zsid? Zolt?n wrote: > >> Hello All, >> >> Is it possible to use Matplotlib from IronPython 1.1.1? >> >> Regards, >> >> Zoli >> >> >> _______________________________________________ >> 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 fuzzyman at voidspace.org.uk Mon Jul 14 18:29:11 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 14 Jul 2008 17:29:11 +0100 Subject: [IronPython] Matplotlib from IronPython 1.1.1 In-Reply-To: References: <00fc01c8e5b4$3c8f5700$6701a8c0@TOSHIBA> <011c01c8e5b7$3cad8600$6701a8c0@TOSHIBA> Message-ID: <487B7ED7.8040708@voidspace.org.uk> Curt Clockwatcher wrote: > Ah, I hadn't noticed that. > > I suspect that it wouldn't be *too* hard to port it to 1.1.1, but I > can well imagine that the people working on it won't have prioritized > that. Ironclad is making very good progress - but still isn't likely to be able to reliably use matplotlib for some time to come. An alternative approach is to use Python.NET to embed CPython as outlined here: http://www.voidspace.org.uk/ironpython/cpython_extensions.shtml Michael Foord > > On Mon, Jul 14, 2008 at 6:40 AM, Zsid? Zolt?n > wrote: > > As I read: "Ironclad works with IronPython 2 and targets CPython > 2.5. " > So it won't be possible to use it with IP 1.1.1. > Right? > > Regards, > Zoli > > ----- Original Message ----- > *From:* Curt Hagenlocher > *To:* Discussion of IronPython > > *Sent:* Monday, July 14, 2008 3:29 PM > *Subject:* Re: [IronPython] Matplotlib from IronPython 1.1.1 > > Matplotlib requires numpy, which is a C extension. IronPython > doesn't support C extensions directly, but Resolver Systems is > working on an open source compatibility layer with the > explicit goal of numpy support. You can find more information > at > http://www.resolversystems.com/documentation/index.php/Ironclad. > > On Mon, Jul 14, 2008 at 6:19 AM, Zsid? Zolt?n > > wrote: > > Hello All, > > Is it possible to use Matplotlib from IronPython 1.1.1? > > Regards, > > Zoli > > > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From curt at hagenlocher.org Mon Jul 14 19:18:40 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Mon, 14 Jul 2008 10:18:40 -0700 Subject: [IronPython] Matplotlib from IronPython 1.1.1 In-Reply-To: <487B7ED7.8040708@voidspace.org.uk> References: <00fc01c8e5b4$3c8f5700$6701a8c0@TOSHIBA> <011c01c8e5b7$3cad8600$6701a8c0@TOSHIBA> <487B7ED7.8040708@voidspace.org.uk> Message-ID: On Mon, Jul 14, 2008 at 9:29 AM, Michael Foord wrote: > Curt Clockwatcher wrote: > But I'm not working on perf this week! -- Curt Hagenlocher curt at hagenlocher.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Mon Jul 14 19:25:25 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 14 Jul 2008 18:25:25 +0100 Subject: [IronPython] Matplotlib from IronPython 1.1.1 In-Reply-To: References: <00fc01c8e5b4$3c8f5700$6701a8c0@TOSHIBA> <011c01c8e5b7$3cad8600$6701a8c0@TOSHIBA> <487B7ED7.8040708@voidspace.org.uk> Message-ID: <487B8C05.5040009@voidspace.org.uk> Curt Hagenlocher wrote: > On Mon, Jul 14, 2008 at 9:29 AM, Michael Foord > > wrote: > > Curt Clockwatcher wrote: > > > But I'm not working on perf this week! It was a change suggested by the spellchecker - and I liked it so I left it. :-) Michael > > -- > Curt Hagenlocher > curt at hagenlocher.org > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From dblank at brynmawr.edu Mon Jul 14 20:07:31 2008 From: dblank at brynmawr.edu (Douglas S. Blank) Date: Mon, 14 Jul 2008 14:07:31 -0400 Subject: [IronPython] Matplotlib from IronPython 1.1.1 In-Reply-To: <00fc01c8e5b4$3c8f5700$6701a8c0@TOSHIBA> References: <00fc01c8e5b4$3c8f5700$6701a8c0@TOSHIBA> Message-ID: <487B95E3.7050505@brynmawr.edu> Another approach to dealing with the missing numpy: rewrite it in C#. Has anyone looked to see what that would require? We are moving all of our artificial intelligence, and machine learning code to use the DLR and replacing numpy with a cross-language is on our list. We only use a small part of numpy (matrix multiplication) so, we can probably replace just what we need. But a complete replacement might be useful. Any ideas? -Doug Zsid? Zolt?n wrote: > Hello All, > > Is it possible to use Matplotlib from IronPython 1.1.1? > > Regards, > > Zoli > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From fuzzyman at voidspace.org.uk Mon Jul 14 20:09:08 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 14 Jul 2008 19:09:08 +0100 Subject: [IronPython] Matplotlib from IronPython 1.1.1 In-Reply-To: <487B95E3.7050505@brynmawr.edu> References: <00fc01c8e5b4$3c8f5700$6701a8c0@TOSHIBA> <487B95E3.7050505@brynmawr.edu> Message-ID: <487B9644.9050601@voidspace.org.uk> Douglas S. Blank wrote: > Another approach to dealing with the missing numpy: rewrite it in C#. > Has anyone looked to see what that would require? We are moving all of > our artificial intelligence, and machine learning code to use the DLR > and replacing numpy with a cross-language is on our list. We only use > a small part of numpy (matrix multiplication) so, we can probably > replace just what we need. But a complete replacement might be useful. > Any ideas? That would be great - let us know how you get on! Michael > > -Doug > > Zsid? Zolt?n wrote: >> Hello All, >> >> Is it possible to use Matplotlib from IronPython 1.1.1? >> >> Regards, >> >> Zoli >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> 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 -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From fuzzyman at voidspace.org.uk Mon Jul 14 20:55:02 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 14 Jul 2008 19:55:02 +0100 Subject: [IronPython] IronPython Stream Message-ID: <487BA106.7090103@voidspace.org.uk> Hello all, I'm diverting the standard ouput and standard error streams on a Python engine. I would like to provide a Stream that executes a callback on every write (rather than just collecting output as most of the examples show). Inheriting from 'Stream' is easy but requires implementing a tedious number of methods and properties. Inheriting from 'MemoryStream' and only overriding 'Write' (plus the constructor) works fine. I'm wondering if it is 'correct'? It is probably an abuse of MemoryStream - can this approach fail? internal class PythonStream: MemoryStream { TextBox _output; public PythonStream(TextBox textbox) { _output = textbox; } public override void Write(byte[] buffer, int offset, int count) { _output.AppendText(Encoding.UTF8.GetString(buffer, offset, count)); } } -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From falcon at uwyo.edu Mon Jul 14 21:09:45 2008 From: falcon at uwyo.edu (Michael Stephens) Date: Mon, 14 Jul 2008 13:09:45 -0600 Subject: [IronPython] IronPython Stream In-Reply-To: <487BA106.7090103@voidspace.org.uk> References: <487BA106.7090103@voidspace.org.uk> Message-ID: I think I ran into some threading issues writing from the stream to the ui. We wrote a callback (delegate) stream handler that we use for ironpython and some odd operations in asp.net. I wish .net made event based streams, and event based collections. Michael Stephens Electrical Engineering Graduate Student University of Wyoming falcon at uwyo.edu or 89iroc at gmail.com On Mon, Jul 14, 2008 at 12:55 PM, Michael Foord wrote: > Hello all, > > I'm diverting the standard ouput and standard error streams on a Python > engine. I would like to provide a Stream that executes a callback on every > write (rather than just collecting output as most of the examples show). > > Inheriting from 'Stream' is easy but requires implementing a tedious number > of methods and properties. Inheriting from 'MemoryStream' and only > overriding 'Write' (plus the constructor) works fine. I'm wondering if it is > 'correct'? It is probably an abuse of MemoryStream - can this approach fail? > > internal class PythonStream: MemoryStream > { > TextBox _output; > public PythonStream(TextBox textbox) > { > _output = textbox; > } > > public override void Write(byte[] buffer, int offset, int count) > { > _output.AppendText(Encoding.UTF8.GetString(buffer, offset, count)); > } > } > > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 fuzzyman at voidspace.org.uk Mon Jul 14 21:11:45 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 14 Jul 2008 20:11:45 +0100 Subject: [IronPython] IronPython Stream In-Reply-To: References: <487BA106.7090103@voidspace.org.uk> Message-ID: <487BA4F1.7000007@voidspace.org.uk> Michael Stephens wrote: > I think I ran into some threading issues writing from the stream to > the ui. I can always invoke the write. In this case their are no multi-threading concerns. Did you create your own stream or use an existing one? Michael > We wrote a callback (delegate) stream handler that we use for > ironpython and some odd operations in asp.net . I > wish .net made event based streams, and event based collections. > Michael Stephens > > Electrical Engineering Graduate Student > University of Wyoming > falcon at uwyo.edu or 89iroc at gmail.com > > > On Mon, Jul 14, 2008 at 12:55 PM, Michael Foord > > wrote: > > Hello all, > > I'm diverting the standard ouput and standard error streams on a > Python engine. I would like to provide a Stream that executes a > callback on every write (rather than just collecting output as > most of the examples show). > > Inheriting from 'Stream' is easy but requires implementing a > tedious number of methods and properties. Inheriting from > 'MemoryStream' and only overriding 'Write' (plus the constructor) > works fine. I'm wondering if it is 'correct'? It is probably an > abuse of MemoryStream - can this approach fail? > > internal class PythonStream: MemoryStream > { > TextBox _output; > public PythonStream(TextBox textbox) > { > _output = textbox; > } > > public override void Write(byte[] buffer, int offset, int count) > { > _output.AppendText(Encoding.UTF8.GetString(buffer, offset, > count)); > } > } > > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From 89iroc at gmail.com Mon Jul 14 21:14:21 2008 From: 89iroc at gmail.com (Michael Stephens) Date: Mon, 14 Jul 2008 13:14:21 -0600 Subject: [IronPython] IronPython Stream In-Reply-To: <487BA4F1.7000007@voidspace.org.uk> References: <487BA106.7090103@voidspace.org.uk> <487BA4F1.7000007@voidspace.org.uk> Message-ID: I wrote one myself. Michael Stephens Electrical Engineering Graduate Student University of Wyoming falcon at uwyo.edu or 89iroc at gmail.com On Mon, Jul 14, 2008 at 1:11 PM, Michael Foord wrote: > Michael Stephens wrote: > >> I think I ran into some threading issues writing from the stream to the >> ui. >> > > I can always invoke the write. In this case their are no multi-threading > concerns. Did you create your own stream or use an existing one? > > Michael > > We wrote a callback (delegate) stream handler that we use for ironpython >> and some odd operations in asp.net . I wish .net made >> event based streams, and event based collections. >> Michael Stephens >> >> Electrical Engineering Graduate Student >> University of Wyoming >> falcon at uwyo.edu or 89iroc at gmail.com > 89iroc at gmail.com> >> >> >> On Mon, Jul 14, 2008 at 12:55 PM, Michael Foord < >> fuzzyman at voidspace.org.uk > wrote: >> >> Hello all, >> >> I'm diverting the standard ouput and standard error streams on a >> Python engine. I would like to provide a Stream that executes a >> callback on every write (rather than just collecting output as >> most of the examples show). >> >> Inheriting from 'Stream' is easy but requires implementing a >> tedious number of methods and properties. Inheriting from >> 'MemoryStream' and only overriding 'Write' (plus the constructor) >> works fine. I'm wondering if it is 'correct'? It is probably an >> abuse of MemoryStream - can this approach fail? >> >> internal class PythonStream: MemoryStream >> { >> TextBox _output; >> public PythonStream(TextBox textbox) >> { >> _output = textbox; >> } >> >> public override void Write(byte[] buffer, int offset, int count) >> { >> _output.AppendText(Encoding.UTF8.GetString(buffer, offset, >> count)); >> } >> } >> >> >> >> -- http://www.ironpythoninaction.com/ >> http://www.voidspace.org.uk/ >> http://www.trypython.org/ >> http://www.ironpython.info/ >> http://www.theotherdelia.co.uk/ >> http://www.resolverhacks.net/ >> >> _______________________________________________ >> 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 >> >> > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 curt at hagenlocher.org Mon Jul 14 21:55:35 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Mon, 14 Jul 2008 12:55:35 -0700 Subject: [IronPython] IronPython Stream In-Reply-To: References: <487BA106.7090103@voidspace.org.uk> Message-ID: In beta 3, PythonFile and its related classes aren't thread-safe. This will be fixed in beta 4. On Mon, Jul 14, 2008 at 12:09 PM, Michael Stephens wrote: > I think I ran into some threading issues writing from the stream to the > ui. We wrote a callback (delegate) stream handler that we use for > ironpython and some odd operations in asp.net. I wish .net made event > based streams, and event based collections. > Michael Stephens > > Electrical Engineering Graduate Student > University of Wyoming > falcon at uwyo.edu or 89iroc at gmail.com > > On Mon, Jul 14, 2008 at 12:55 PM, Michael Foord > wrote: > >> Hello all, >> >> I'm diverting the standard ouput and standard error streams on a Python >> engine. I would like to provide a Stream that executes a callback on every >> write (rather than just collecting output as most of the examples show). >> >> Inheriting from 'Stream' is easy but requires implementing a tedious >> number of methods and properties. Inheriting from 'MemoryStream' and only >> overriding 'Write' (plus the constructor) works fine. I'm wondering if it is >> 'correct'? It is probably an abuse of MemoryStream - can this approach fail? >> >> internal class PythonStream: MemoryStream >> { >> TextBox _output; >> public PythonStream(TextBox textbox) >> { >> _output = textbox; >> } >> >> public override void Write(byte[] buffer, int offset, int count) >> { >> _output.AppendText(Encoding.UTF8.GetString(buffer, offset, count)); >> } >> } >> >> >> >> -- >> http://www.ironpythoninaction.com/ >> http://www.voidspace.org.uk/ >> http://www.trypython.org/ >> http://www.ironpython.info/ >> http://www.theotherdelia.co.uk/ >> http://www.resolverhacks.net/ >> >> _______________________________________________ >> 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 Jimmy.Schementi at microsoft.com Tue Jul 15 01:59:41 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Mon, 14 Jul 2008 16:59:41 -0700 Subject: [IronPython] Python in the Browser updates In-Reply-To: <4858DCF3.1000302@voidspace.org.uk> References: <4856F194.7040004@voidspace.org.uk> <485831ED.2050304@voidspace.org.uk> <5283CA0A4168DF4FBBD71AE9ECA5A32845CC6216BA@NA-EXMSG-C116.redmond.corp.microsoft.com> <4858DCF3.1000302@voidspace.org.uk> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A32845D45E2CC9@NA-EXMSG-C116.redmond.corp.microsoft.com> Michael Foord wrote: > Jimmy Schementi wrote: > > Michael, question for you: > > > > > >> On every keypress Javascript calls into IronPython (via the C#!). > >> > > > > How come you used C# to handle the onkeypress event? This should do > it in Python: > > > > > > Did you look at the code to see why? I'd be really interested to know > if > I can do what I'm doing from Python inside Silverlight, but I doubt it. > There's not much code in total, so it should be easy to follow. Yep, I looked at it, and I'm pretty sure you can do everything from python. All the native Javascript functions are callable from python, or any .NET language, especially with HtmlPage.window.eval(), so there shouldn't be any limitation. > I actually handle the onkeypress event from Javascript (onkeypress.js). > This calls into 'getSelection' (cursor_pos.js) to work out the current > selection in the textarea. Naturally this is easy to do in Firefox / > Safari and scarily awful in IE. :-) Attaching the event is simple: from System.Windows.Browser.HtmlPage import Document from System.Windows.Input import KeyEventHandler Document.myTextAreaID.AttachEvent("onkeypress", KeyEventHander(onKeyPress)) def onKeyPress(sender, eventArgs): # Do something with eventArgs.CharacterCode pass For converting the javascript to python, there are some special javascript variables that are in different places, like "window" is HtmlPage.Window, etc. > > Having worked these out (and shortcut a few specific scenarios - like > ctrl-A, ctrl-Z and ctrl-C), the Javascript then calls into IronPython > with the selection start, selection end, and the character that was > pressed. I use C# to expose a scriptable type that Javascript can call. If you hooked all the events with Python, you wouldn't need to call back into it from Javascript. This is why I prefer doing everything with Python, so I avoid having a C# shim. > I use attaching events from Python to provide the sample code. There > are > three links above the console and Python handles the 'onclick' event to > swap the examples around. Basically, if there is something pretty basic you can't do in Python that you can do from browser Javascript, it's a bug! =) > Michael Foord > > > > >
> > > > from System import EventHandler > > from System.Windows.Browser import Htmlpage, HtmlEventArgs > > > > document = System.Windows.Browser.HtmlPage.Document > > def onkeypress(s, e): > > document.result.innerHTML += "KeyPress
" > > document.code.AttachEvent("onkeypress", > EventHandler[HtmlEventArgs](onkeypress)) > > > > Anyway, just wondering if anything was blocking you from hooking HTML > events with Python. > > > > ~js > > > > > >> -----Original Message----- > >> From: users-bounces at lists.ironpython.com [mailto:users- > >> bounces at lists.ironpython.com] On Behalf Of Michael Foord > >> Sent: Tuesday, June 17, 2008 2:52 PM > >> To: Discussion of IronPython > >> Subject: Re: [IronPython] Python in the Browser updates > >> > >> Hello all, > >> > >> Sorry for the noise - but tomorrow I hope to package this for a > release > >> and if any of you get the chance to give me any feedback before > then. > >> > >> http://www.voidspace.org.uk/ironpython/silverlight- > console/console.html > >> > >> I think I have fixed all the basic usability issues (it is no longer > >> possible to screw up the console so that it refuses further input > for > >> example). To *really* fix input I ought to move execution into its > own > >> thread so that we can interrupt infinite loops [1] - but that is a > >> bigger change so I am resisting it for the moment. > >> > >> The big change is that I have added some simple code snippets - as > an > >> example of how it could be used in tutorials or for teaching Python. > >> > >> It is also easy to customize - the source code (200 lines of Python, > 70 > >> lines of Javascript, 25 lines of C#) shows how to prepopulate the > >> execution context and show the first few lines of code in the > >> interpreter. > >> > >> You can get the sourcecode from the repository of course: > >> > >> http://code.google.com/p/pythoninthebrowser/ > >> > >> All the best, > >> > >> Michael Foord > >> > >> [1] and then decide whether on windows a ctrl-c should send a > keyboard > >> interrupt or copy to the clipboard... > >> > >> Michael Foord wrote: > >> > >>> For those who are interested, I've updated "Python in the Browser". > >>> > >>> Both the repository: > >>> > >>> http://code.google.com/p/pythoninthebrowser/ > >>> > >>> And the online demo: > >>> > >>> http://www.voidspace.org.uk/ironpython/silverlight- > >>> > >> console/console.html > >> > >>> There are a few minor but nice improvements: > >>> > >>> * The Javascript now works with IE 7! > >>> * The textarea scrolls as input is printed > >>> * The context window is disabled to prevent you pasting over the > >>> > >> input > >> > >>> area - not sure if this is really an improvement though... > >>> * The input area is cleared on load - to stop browsers like Firefox > >>> and Safari repopulating the textarea for us on browser refresh > >>> * Recursion limit is set > >>> > >>> I think it is basically in a useful state now... I might push out a > >>> '0.1' release from the current SVN head. > >>> > >>> All the best, > >>> > >>> Michael Foord > >>> > >>> > >> -- > >> http://www.ironpythoninaction.com/ > >> http://www.theotherdelia.co.uk/ > >> http://www.voidspace.org.uk/ > >> http://www.ironpython.info/ > >> http://www.resolverhacks.net/ > >> > >> _______________________________________________ > >> 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 Jimmy.Schementi at microsoft.com Tue Jul 15 05:44:16 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Mon, 14 Jul 2008 20:44:16 -0700 Subject: [IronPython] XmlDocument or XDocument in Python/Silverlight In-Reply-To: References: <4858306D.2020308@voidspace.org.uk> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A32845D46D5DDC@NA-EXMSG-C116.redmond.corp.microsoft.com> Jonathan Slenders wrote: > > And another question, which is rather Silverlight then IronPython > related. I hope it's okey to ask it here. > How should I create a TextNode from Silverlight with IronPython code? > In javascript, one would: > > node = document.createTextNode("text"); element.appendChild(node); > > According to the MSDN documentation, the HtmlDocument class doesn't > have a createTextNode, and I can't find it anywhere else. Michael his > book has been extremely useful for me, but he uses innerHtml which i > really don't like. InnerHtml is is an old-style method for DOM- > manipulation, and unsafe by definition. (it allows you to insert HTML > code) Did you figure this out yet? Actually, not sure of the answer, but I "think" Silverlight doesn't support this. But it should. I sent a mail off to the Silverlight guys who work on the HTML bridge a while ago. I'll check back with them again, and get back to you. ~Jimmy From curt at hagenlocher.org Tue Jul 15 06:28:51 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Mon, 14 Jul 2008 21:28:51 -0700 Subject: [IronPython] Windows Service In-Reply-To: <487AC84C.6090900@onesquared.net> References: <487AC84C.6090900@onesquared.net> Message-ID: I looked into this a few months ago, and I seem to remember that -- practically speaking -- you'd need to write a short C# (or VB) stub to host the service. But I can't remember why, and I never actually tried to create an example. On Sun, Jul 13, 2008 at 8:30 PM, Iain Dickason wrote: > Has anyone used IronPython to create a native Windows Service? > > Thanks > > Iain. > _______________________________________________ > 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 mbarnett at uniserve.com Tue Jul 15 06:34:31 2008 From: mbarnett at uniserve.com (mbarnett at uniserve.com) Date: Mon, 14 Jul 2008 21:34:31 -0700 Subject: [IronPython] Embedded IronPython in .NET C# WinForm app error In-Reply-To: References: <001301c8e0f1$b541d5f0$6500a8c0@valleyforge> Message-ID: <1216096471.487c28d75e1bd@members.uniserve.com> Thank you Curt, that was it! Cheers, Mitch Quoting Curt Hagenlocher : > 80004002 is an HRESULT that's E_NOINTERFACE. It's coming from the COM > component itself and not from IronPython. One possible explanation is that > the component isn't compatible with the apartment model of the current > thread. Try changing from MTA to STA (or vice versa) and seeing if that > resolves the problem. > > On Tue, Jul 8, 2008 at 4:56 AM, Mitch Barnett wrote: > > > Hello, > > > > I have a .NET C# WinForm application that hosts an IronPython 1.1 engine. > > In the WinForm app, the scripting API is exposed through a web service > > interface (using Windows Communication Foundation) so that from a remote > > console, (over WCF), I can execute IronPython code on the computer that is > > running the WinForm app. > > > > The project is at: http://www.codeplex.com/gsb > > > > Works 99% of the time, but the 1% of the time that it does not work is for > > cases like this: > > > > >>> IronPython 1.1 (1.1) on .NET 2.0.50727.1433 > > >>> import clr > > >>> import sys > > >>> sys.path.append(r"c:\projects\gsbservice\gsbservice1") > > >>> clr.AddReferenceToFile("AgentServerObjects.dll") > > >>> from AgentServerObjects import * > > >>> a = AgentServerClass() > > Traceback (most recent call last): File C:\Projects\GSBService\GSBService1 > > \ParseInteractive.cs, line 93, in CallIPCmd File , line 0, in ##21 > > File , line 0, in DefaultNew##22 File , line 0, in .ctor##26 TypeError: > > Creating an instance of the COM component with CLSID > > {D45FD2FC-5C6E-11D1-9EC1- > > 00C04FD7081F} from the IClassFactory failed due to the following error: > > 80004002. > > >>> > > > > Of course if I try the same thing using the IPY.exe console on the same > > computer, using the same AgentServerObjects.dll, it works just fine. > > > > Any thoughts appreciated as to what might be going wrong. > > > > Thanks, > > > > Mitch > > > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > From srivatsn at microsoft.com Tue Jul 15 06:51:23 2008 From: srivatsn at microsoft.com (Srivatsn Narayanan) Date: Mon, 14 Jul 2008 21:51:23 -0700 Subject: [IronPython] Announcing IronPython 1.1.2 RC1 Message-ID: Hello IronPython Community, I'm pleased to announce the release of IronPython 1.1.2 RC1. In this release twenty-one CodePlex work Items that were identified as high priority on the IronPython mailing list were fixed. It's worth noting that this included the implementation of the "_winreg" CPython module and a few performance improvements in targeted areas. Please also note that there are two potentially breaking changes in this release: * nt.unlink will now throw an exception if the file doesn't exist, as it does in CPython. * The signature of IronPython.Runtime.Operations.Ops.Id() has changed and it now returns an object instead of long. This maps to the id() function in python. Note that there is no change for python caused by this and only code which is directly calling Ops.Id from a statically typed language like C# or VB will be affected. Assuming no major issues are discovered in this build, we hope to rerelease it as our last planned IronPython 1.1 release, IronPython 1.1.2, in several weeks. Please let us know if you encounter any issues as soon as possible. The following CodePlex Work Items were closed: * 16368 1.1.2: nt.access is missing * 16402 1.1.2: implement _winreg module * 15105 1.1.2: endpos is zero in IronPython 1.1.1 * 16335 1.1.2: Event handlers can cause circular references and leak memory * 16337 1.1.2: Trivial: Implement float.__lt__(float) * 16338 1.1.2: Using lambda in class definition will add into the * 16342 1.1.2: calling base class __call__ invokes constructor instead * 16343 1.1.2: problem with __slots__ and __init__ in new-style classes * 16347 1.1.2: Trivial: popen shouldn't open new window * 16348 1.1.2: Removes the inexistent file did not throw OSError in IP * 16350 1.1.2: int() doesn't convert representable longs to int * 16351 1.1.2: dict.update doesn't take keyword arguments - differs from CPython * 16353 1.1.2: Trivial: int('0x20', 16) fails to parse, long too * 16355 1.1.2: unpacking single element tuples in for-statement, listcomp and generator * 16356 1.1.2: socket.getnameinfo(...) broken under Vista * 16360 1.1.2: Class with slots and getattr not compatible * 16363 1.1.2: Can't call method w/ nullable as 1st argument w/ greater than 5 arguments * 16364 1.1.2: Backport fix for compiled regular expressions * 16365 1.1.2: Tuple hashing improvements * 16366 1.1.2: PyCF_DONT_IMPLY_DEDENT support in compile * 16749 1.1.2 (Trivial): Modifier of PythonEngine.DefaultCompilerContext(..) We'd like to thank everyone in the community who contributed to these bugs: Ronnie Maor, jackeyoo, sanxiyn, Michael Foord, Kamil Dworakowski, lthompson, romank, Jeff Brown, rridge, David Fraser, pobrien, ebaklund. You can download IronPython 1.1.2 RC1 at: http://www.codeplex.com/IronPython/Release/ProjectReleases.aspx?ReleaseId=15198 The IronPython Team -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonathan at slenders.be Tue Jul 15 07:36:22 2008 From: jonathan at slenders.be (Jonathan Slenders) Date: Tue, 15 Jul 2008 07:36:22 +0200 Subject: [IronPython] XmlDocument or XDocument in Python/Silverlight In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A32845D46D5DDC@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <4858306D.2020308@voidspace.org.uk> <5283CA0A4168DF4FBBD71AE9ECA5A32845D46D5DDC@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: Thank you, Jimmy. At the moment, I'm at a summercamp and stay there until the end of the month. Therefore, I've been inactive at this newsgroup. Jonathan 2008/7/15 Jimmy Schementi : > Jonathan Slenders wrote: > > > > And another question, which is rather Silverlight then IronPython > > related. I hope it's okey to ask it here. > > How should I create a TextNode from Silverlight with IronPython code? > > In javascript, one would: > > > > node = document.createTextNode("text"); element.appendChild(node); > > > > According to the MSDN documentation, the HtmlDocument class doesn't > > have a createTextNode, and I can't find it anywhere else. Michael his > > book has been extremely useful for me, but he uses innerHtml which i > > really don't like. InnerHtml is is an old-style method for DOM- > > manipulation, and unsafe by definition. (it allows you to insert HTML > > code) > > Did you figure this out yet? Actually, not sure of the answer, but I > "think" Silverlight doesn't support this. But it should. I sent a mail off > to the Silverlight guys who work on the HTML bridge a while ago. I'll check > back with them again, and get back to you. > > ~Jimmy > _______________________________________________ > 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 Jimmy.Schementi at microsoft.com Tue Jul 15 11:42:02 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Tue, 15 Jul 2008 02:42:02 -0700 Subject: [IronPython] XmlDocument or XDocument in Python/Silverlight In-Reply-To: References: <4858306D.2020308@voidspace.org.uk> <5283CA0A4168DF4FBBD71AE9ECA5A32845D46D5DDC@NA-EXMSG-C116.redmond.corp.microsoft.com>, Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A32845D41AFA66@NA-EXMSG-C116.redmond.corp.microsoft.com> Have fun =) Here's your answer: There is no "first class support" for createTextNode (ie. a managed API that calls directly into the browser's native code). However, any javascript function can be called from managed code with "Invoke" so you could do this: newtext = HtmlPage.Document.Invoke("createTextNode", "Some text added dynamically") HtmlPage.Document.p1.Invoke("appendChild", newtext) The "appendChild" call needs to be invoked as well, since the managed "AppendChild" equivalent only takes a HtmlElement, and Invoke will return a ScriptObject, and you can't cast a ScriptObject to a HtmlElement. ~js ________________________________________ From: users-bounces at lists.ironpython.com [users-bounces at lists.ironpython.com] On Behalf Of Jonathan Slenders [jonathan at slenders.be] Sent: Monday, July 14, 2008 10:36 PM To: Discussion of IronPython Subject: Re: [IronPython] XmlDocument or XDocument in Python/Silverlight Thank you, Jimmy. At the moment, I'm at a summercamp and stay there until the end of the month. Therefore, I've been inactive at this newsgroup. Jonathan 2008/7/15 Jimmy Schementi >: Jonathan Slenders wrote: > > And another question, which is rather Silverlight then IronPython > related. I hope it's okey to ask it here. > How should I create a TextNode from Silverlight with IronPython code? > In javascript, one would: > > node = document.createTextNode("text"); element.appendChild(node); > > According to the MSDN documentation, the HtmlDocument class doesn't > have a createTextNode, and I can't find it anywhere else. Michael his > book has been extremely useful for me, but he uses innerHtml which i > really don't like. InnerHtml is is an old-style method for DOM- > manipulation, and unsafe by definition. (it allows you to insert HTML > code) Did you figure this out yet? Actually, not sure of the answer, but I "think" Silverlight doesn't support this. But it should. I sent a mail off to the Silverlight guys who work on the HTML bridge a while ago. I'll check back with them again, and get back to you. ~Jimmy _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From fuzzyman at voidspace.org.uk Tue Jul 15 17:38:49 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 15 Jul 2008 16:38:49 +0100 Subject: [IronPython] Announcing IronPython 1.1.2 RC1 In-Reply-To: References: Message-ID: <487CC489.4070901@voidspace.org.uk> Hello guys, The only socket related issue I see in that list is: 16356 1.1.2: socket.getnameinfo(...) broken under Vista We were hoping that 1.1.2 would finally put to rest IronPython 1 issues with urllib / urllib2. Has that been done? All the best, Michael Srivatsn Narayanan wrote: > > Hello IronPython Community, > > I?m pleased to announce the release of IronPython 1.1.2 RC1. In this > release twenty-one CodePlex work Items that were identified as high > priority on the IronPython mailing list were fixed. It?s worth noting > that this included the implementation of the ?_winreg? CPython module > and a few performance improvements in targeted areas. Please also note > that there are two potentially breaking changes in this release: > > ? nt.unlink will now throw an exception if the file doesn?t exist, as > it does in CPython. > > ? The signature of IronPython.Runtime.Operations.Ops.Id() has changed > and it now returns an object instead of long. This maps to the id() > function in python. Note that there is no change for python caused by > this and only code which is directly calling Ops.Id from a statically > typed language like C# or VB will be affected. > > Assuming no major issues are discovered in this build, we hope to > rerelease it as our last planned IronPython 1.1 release, IronPython > 1.1.2, in several weeks. Please let us know if you encounter any > issues as soon as possible. > > The following CodePlex Work Items were closed: > > ? 16368 1.1.2: nt.access is missing > > ? 16402 1.1.2: implement _winreg module > > ? 15105 1.1.2: endpos is zero in IronPython 1.1.1 > > ? 16335 1.1.2: Event handlers can cause circular references and leak > memory > > ? 16337 1.1.2: Trivial: Implement float.__lt__(float) > > ? 16338 1.1.2: Using lambda in class definition will add > into the > > ? 16342 1.1.2: calling base class __call__ invokes constructor instead > > ? 16343 1.1.2: problem with __slots__ and __init__ in new-style classes > > ? 16347 1.1.2: Trivial: popen shouldn't open new window > > ? 16348 1.1.2: Removes the inexistent file did not throw OSError in IP > > ? 16350 1.1.2: int() doesn't convert representable longs to int > > ? 16351 1.1.2: dict.update doesn't take keyword arguments - differs > from CPython > > ? 16353 1.1.2: Trivial: int('0x20', 16) fails to parse, long too > > ? 16355 1.1.2: unpacking single element tuples in for-statement, > listcomp and generator > > ? 16356 1.1.2: socket.getnameinfo(...) broken under Vista > > ? 16360 1.1.2: Class with slots and getattr not compatible > > ? 16363 1.1.2: Can't call method w/ nullable as 1st argument w/ > greater than 5 arguments > > ? 16364 1.1.2: Backport fix for compiled regular expressions > > ? 16365 1.1.2: Tuple hashing improvements > > ? 16366 1.1.2: PyCF_DONT_IMPLY_DEDENT support in compile > > ? 16749 1.1.2 (Trivial): Modifier of > PythonEngine.DefaultCompilerContext(..) > > We?d like to thank everyone in the community who contributed to these > bugs: Ronnie Maor, jackeyoo, sanxiyn, Michael Foord, Kamil > Dworakowski, lthompson, romank, Jeff Brown, rridge, David Fraser, > pobrien, ebaklund. > > You can download IronPython 1.1.2 RC1 at: > http://www.codeplex.com/IronPython/Release/ProjectReleases.aspx?ReleaseId=15198 > > > The IronPython Team > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From curt at hagenlocher.org Tue Jul 15 17:53:29 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Tue, 15 Jul 2008 08:53:29 -0700 Subject: [IronPython] Announcing IronPython 1.1.2 RC1 In-Reply-To: <487CC489.4070901@voidspace.org.uk> References: <487CC489.4070901@voidspace.org.uk> Message-ID: Those changes will be in 2.0b4. Some of CPython's socket tests are problematic in the face of non-deterministic finalization. They assume, for instance, that a socket will implicitly be closed when the variable goes out of scope. Because of this, and because users haven't had a chance to bang on them yet, I wasn't confident enough in the changes I made to advocate porting them back to 1.1.2. On Tue, Jul 15, 2008 at 8:38 AM, Michael Foord wrote: > Hello guys, > > The only socket related issue I see in that list is: > > 16356 1.1.2: socket.getnameinfo(...) broken under Vista > > We were hoping that 1.1.2 would finally put to rest IronPython 1 issues > with urllib / urllib2. Has that been done? > > All the best, > > Michael > > Srivatsn Narayanan wrote: > >> >> Hello IronPython Community, >> >> I'm pleased to announce the release of IronPython 1.1.2 RC1. In this >> release twenty-one CodePlex work Items that were identified as high priority >> on the IronPython mailing list were fixed. It's worth noting that this >> included the implementation of the "_winreg" CPython module and a few >> performance improvements in targeted areas. Please also note that there are >> two potentially breaking changes in this release: >> >> ? nt.unlink will now throw an exception if the file doesn't exist, as it >> does in CPython. >> >> ? The signature of IronPython.Runtime.Operations.Ops.Id() >> has changed and it now returns an object instead of long. This maps to the >> id() function in python. Note that there is no change for python caused by >> this and only code which is directly calling Ops.Id from a statically typed >> language like C# or VB will be affected. >> >> Assuming no major issues are discovered in this build, we hope to >> rerelease it as our last planned IronPython 1.1 release, IronPython 1.1.2, >> in several weeks. Please let us know if you encounter any issues as soon as >> possible. >> >> The following CodePlex Work Items were closed: >> >> ? 16368 1.1.2: nt.access is missing >> >> ? 16402 1.1.2: implement _winreg module >> >> ? 15105 1.1.2: endpos is zero in IronPython 1.1.1 >> >> ? 16335 1.1.2: Event handlers can cause circular references and leak >> memory >> >> ? 16337 1.1.2: Trivial: Implement float.__lt__(float) >> >> ? 16338 1.1.2: Using lambda in class definition will add into >> the >> >> ? 16342 1.1.2: calling base class __call__ invokes constructor instead >> >> ? 16343 1.1.2: problem with __slots__ and __init__ in new-style classes >> >> ? 16347 1.1.2: Trivial: popen shouldn't open new window >> >> ? 16348 1.1.2: Removes the inexistent file did not throw OSError in IP >> >> ? 16350 1.1.2: int() doesn't convert representable longs to int >> >> ? 16351 1.1.2: dict.update doesn't take keyword arguments - differs from >> CPython >> >> ? 16353 1.1.2: Trivial: int('0x20', 16) fails to parse, long too >> >> ? 16355 1.1.2: unpacking single element tuples in for-statement, listcomp >> and generator >> >> ? 16356 1.1.2: socket.getnameinfo(...) broken under Vista >> >> ? 16360 1.1.2: Class with slots and getattr not compatible >> >> ? 16363 1.1.2: Can't call method w/ nullable as 1st argument w/ greater >> than 5 arguments >> >> ? 16364 1.1.2: Backport fix for compiled regular expressions >> >> ? 16365 1.1.2: Tuple hashing improvements >> >> ? 16366 1.1.2: PyCF_DONT_IMPLY_DEDENT support in compile >> >> ? 16749 1.1.2 (Trivial): Modifier of >> PythonEngine.DefaultCompilerContext(..) >> >> We'd like to thank everyone in the community who contributed to these >> bugs: Ronnie Maor, jackeyoo, sanxiyn, Michael Foord, Kamil Dworakowski, >> lthompson, romank, Jeff Brown, rridge, David Fraser, pobrien, ebaklund. >> >> You can download IronPython 1.1.2 RC1 at: >> http://www.codeplex.com/IronPython/Release/ProjectReleases.aspx?ReleaseId=15198 >> >> The IronPython Team >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 fuzzyman at voidspace.org.uk Tue Jul 15 18:24:06 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 15 Jul 2008 17:24:06 +0100 Subject: [IronPython] Announcing IronPython 1.1.2 RC1 In-Reply-To: References: <487CC489.4070901@voidspace.org.uk> Message-ID: <487CCF26.4040306@voidspace.org.uk> Curt Hagenlocher wrote: > Those changes will be in 2.0b4. > Is this your patch from March, added to the following work item? http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=10825 Michael > Some of CPython's socket tests are problematic in the face of > non-deterministic finalization. They assume, for instance, that a > socket will implicitly be closed when the variable goes out of scope. > Because of this, and because users haven't had a chance to bang on > them yet, I wasn't confident enough in the changes I made to advocate > porting them back to 1.1.2. > > On Tue, Jul 15, 2008 at 8:38 AM, Michael Foord > > wrote: > > Hello guys, > > The only socket related issue I see in that list is: > > 16356 1.1.2: socket.getnameinfo(...) broken under Vista > > We were hoping that 1.1.2 would finally put to rest IronPython 1 > issues with urllib / urllib2. Has that been done? > > All the best, > > Michael > > Srivatsn Narayanan wrote: > > > Hello IronPython Community, > > I'm pleased to announce the release of IronPython 1.1.2 RC1. > In this release twenty-one CodePlex work Items that were > identified as high priority on the IronPython mailing list > were fixed. It's worth noting that this included the > implementation of the "_winreg" CPython module and a few > performance improvements in targeted areas. Please also note > that there are two potentially breaking changes in this release: > > ? nt.unlink will now throw an exception if the file doesn't > exist, as it does in CPython. > > ? The signature of IronPython.Runtime.Operations.Ops.Id > () has changed > and it now returns an object instead of long. This maps to the > id() function in python. Note that there is no change for > python caused by this and only code which is directly calling > Ops.Id from a statically typed language like C# or VB will be > affected. > > Assuming no major issues are discovered in this build, we hope > to rerelease it as our last planned IronPython 1.1 release, > IronPython 1.1.2, in several weeks. Please let us know if you > encounter any issues as soon as possible. > > The following CodePlex Work Items were closed: > > ? 16368 1.1.2: nt.access is missing > > ? 16402 1.1.2: implement _winreg module > > ? 15105 1.1.2: endpos is zero in IronPython 1.1.1 > > ? 16335 1.1.2: Event handlers can cause circular references > and leak memory > > ? 16337 1.1.2: Trivial: Implement float.__lt__(float) > > ? 16338 1.1.2: Using lambda in class definition will add > into the > > ? 16342 1.1.2: calling base class __call__ invokes constructor > instead > > ? 16343 1.1.2: problem with __slots__ and __init__ in > new-style classes > > ? 16347 1.1.2: Trivial: popen shouldn't open new window > > ? 16348 1.1.2: Removes the inexistent file did not throw > OSError in IP > > ? 16350 1.1.2: int() doesn't convert representable longs to int > > ? 16351 1.1.2: dict.update doesn't take keyword arguments - > differs from CPython > > ? 16353 1.1.2: Trivial: int('0x20', 16) fails to parse, long too > > ? 16355 1.1.2: unpacking single element tuples in > for-statement, listcomp and generator > > ? 16356 1.1.2: socket.getnameinfo(...) broken under Vista > > ? 16360 1.1.2: Class with slots and getattr not compatible > > ? 16363 1.1.2: Can't call method w/ nullable as 1st argument > w/ greater than 5 arguments > > ? 16364 1.1.2: Backport fix for compiled regular expressions > > ? 16365 1.1.2: Tuple hashing improvements > > ? 16366 1.1.2: PyCF_DONT_IMPLY_DEDENT support in compile > > ? 16749 1.1.2 (Trivial): Modifier of > PythonEngine.DefaultCompilerContext(..) > > We'd like to thank everyone in the community who contributed > to these bugs: Ronnie Maor, jackeyoo, sanxiyn, Michael Foord, > Kamil Dworakowski, lthompson, romank, Jeff Brown, rridge, > David Fraser, pobrien, ebaklund. > > You can download IronPython 1.1.2 RC1 at: > http://www.codeplex.com/IronPython/Release/ProjectReleases.aspx?ReleaseId=15198 > > > The IronPython Team > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From curt at hagenlocher.org Tue Jul 15 19:26:34 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Tue, 15 Jul 2008 10:26:34 -0700 Subject: [IronPython] Announcing IronPython 1.1.2 RC1 In-Reply-To: <487CCF26.4040306@voidspace.org.uk> References: <487CC489.4070901@voidspace.org.uk> <487CCF26.4040306@voidspace.org.uk> Message-ID: It ended up a bit more complicated; that patch leaks memory when a socket isn't closed manually. There's also an issue with how the close flag on _fileobject works -- rather than simply decrementing the refcount the way that socket.close does, it should close the socket regardless of the refcount. On Tue, Jul 15, 2008 at 9:24 AM, Michael Foord wrote: > Curt Hagenlocher wrote: > >> Those changes will be in 2.0b4. >> >> > Is this your patch from March, added to the following work item? > > http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=10825 > > Michael > >> Some of CPython's socket tests are problematic in the face of >> non-deterministic finalization. They assume, for instance, that a socket >> will implicitly be closed when the variable goes out of scope. Because of >> this, and because users haven't had a chance to bang on them yet, I wasn't >> confident enough in the changes I made to advocate porting them back to >> 1.1.2. .> >> >> On Tue, Jul 15, 2008 at 8:38 AM, Michael Foord > fuzzyman at voidspace.org.uk>> wrote: >> >> Hello guys, >> >> The only socket related issue I see in that list is: >> >> 16356 1.1.2: socket.getnameinfo(...) broken under Vista >> >> We were hoping that 1.1.2 would finally put to rest IronPython 1 >> issues with urllib / urllib2. Has that been done? >> >> All the best, >> >> Michael >> >> Srivatsn Narayanan wrote: >> >> >> Hello IronPython Community, >> >> I'm pleased to announce the release of IronPython 1.1.2 RC1. >> In this release twenty-one CodePlex work Items that were >> identified as high priority on the IronPython mailing list >> were fixed. It's worth noting that this included the >> implementation of the "_winreg" CPython module and a few >> performance improvements in targeted areas. Please also note >> that there are two potentially breaking changes in this release: >> >> ? nt.unlink will now throw an exception if the file doesn't >> exist, as it does in CPython. >> >> ? The signature of IronPython.Runtime.Operations.Ops.Id >> () has changed >> >> and it now returns an object instead of long. This maps to the >> id() function in python. Note that there is no change for >> python caused by this and only code which is directly calling >> Ops.Id from a statically typed language like C# or VB will be >> affected. >> >> Assuming no major issues are discovered in this build, we hope >> to rerelease it as our last planned IronPython 1.1 release, >> IronPython 1.1.2, in several weeks. Please let us know if you >> encounter any issues as soon as possible. >> >> The following CodePlex Work Items were closed: >> >> ? 16368 1.1.2: nt.access is missing >> >> ? 16402 1.1.2: implement _winreg module >> >> ? 15105 1.1.2: endpos is zero in IronPython 1.1.1 >> >> ? 16335 1.1.2: Event handlers can cause circular references >> and leak memory >> >> ? 16337 1.1.2: Trivial: Implement float.__lt__(float) >> >> ? 16338 1.1.2: Using lambda in class definition will add >> into the >> >> ? 16342 1.1.2: calling base class __call__ invokes constructor >> instead >> >> ? 16343 1.1.2: problem with __slots__ and __init__ in >> new-style classes >> >> ? 16347 1.1.2: Trivial: popen shouldn't open new window >> >> ? 16348 1.1.2: Removes the inexistent file did not throw >> OSError in IP >> >> ? 16350 1.1.2: int() doesn't convert representable longs to int >> >> ? 16351 1.1.2: dict.update doesn't take keyword arguments - >> differs from CPython >> >> ? 16353 1.1.2: Trivial: int('0x20', 16) fails to parse, long too >> >> ? 16355 1.1.2: unpacking single element tuples in >> for-statement, listcomp and generator >> >> ? 16356 1.1.2: socket.getnameinfo(...) broken under Vista >> >> ? 16360 1.1.2: Class with slots and getattr not compatible >> >> ? 16363 1.1.2: Can't call method w/ nullable as 1st argument >> w/ greater than 5 arguments >> >> ? 16364 1.1.2: Backport fix for compiled regular expressions >> >> ? 16365 1.1.2: Tuple hashing improvements >> >> ? 16366 1.1.2: PyCF_DONT_IMPLY_DEDENT support in compile >> >> ? 16749 1.1.2 (Trivial): Modifier of >> PythonEngine.DefaultCompilerContext(..) >> >> We'd like to thank everyone in the community who contributed >> to these bugs: Ronnie Maor, jackeyoo, sanxiyn, Michael Foord, >> Kamil Dworakowski, lthompson, romank, Jeff Brown, rridge, >> David Fraser, pobrien, ebaklund. >> >> You can download IronPython 1.1.2 RC1 at: >> >> http://www.codeplex.com/IronPython/Release/ProjectReleases.aspx?ReleaseId=15198 >> >> >> The IronPython Team >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> >> >> -- http://www.ironpythoninaction.com/ >> http://www.voidspace.org.uk/ >> http://www.trypython.org/ >> http://www.ironpython.info/ >> http://www.theotherdelia.co.uk/ >> http://www.resolverhacks.net/ >> >> _______________________________________________ >> 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 >> >> > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 fuzzyman at voidspace.org.uk Tue Jul 15 20:02:41 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 15 Jul 2008 19:02:41 +0100 Subject: [IronPython] Announcing IronPython 1.1.2 RC1 In-Reply-To: References: <487CC489.4070901@voidspace.org.uk> <487CCF26.4040306@voidspace.org.uk> Message-ID: <487CE641.3080101@voidspace.org.uk> Curt Hagenlocher wrote: > It ended up a bit more complicated; that patch leaks memory when a > socket isn't closed manually. There's also an issue with how the > close flag on _fileobject works -- rather than simply decrementing the > refcount the way that socket.close does, it should close the socket > regardless of the refcount. Sounds like fun! Michael > > On Tue, Jul 15, 2008 at 9:24 AM, Michael Foord > > wrote: > > Curt Hagenlocher wrote: > > Those changes will be in 2.0b4. > > > Is this your patch from March, added to the following work item? > > http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=10825 > > Michael > > Some of CPython's socket tests are problematic in the face of > non-deterministic finalization. They assume, for instance, > that a socket will implicitly be closed when the variable goes > out of scope. Because of this, and because users haven't had > a chance to bang on them yet, I wasn't confident enough in the > changes I made to advocate porting them back to 1.1.2. > .> > > > On Tue, Jul 15, 2008 at 8:38 AM, Michael Foord > > >> wrote: > > Hello guys, > > The only socket related issue I see in that list is: > > 16356 1.1.2: socket.getnameinfo(...) broken under Vista > > We were hoping that 1.1.2 would finally put to rest > IronPython 1 > issues with urllib / urllib2. Has that been done? > > All the best, > > Michael > > Srivatsn Narayanan wrote: > > > Hello IronPython Community, > > I'm pleased to announce the release of IronPython 1.1.2 > RC1. > In this release twenty-one CodePlex work Items that were > identified as high priority on the IronPython mailing list > were fixed. It's worth noting that this included the > implementation of the "_winreg" CPython module and a few > performance improvements in targeted areas. Please also > note > that there are two potentially breaking changes in this > release: > > ? nt.unlink will now throw an exception if the file doesn't > exist, as it does in CPython. > > ? The signature of IronPython.Runtime.Operations.Ops.Id > > () has > changed > > and it now returns an object instead of long. This maps > to the > id() function in python. Note that there is no change for > python caused by this and only code which is directly > calling > Ops.Id from a statically typed language like C# or VB > will be > affected. > > Assuming no major issues are discovered in this build, > we hope > to rerelease it as our last planned IronPython 1.1 release, > IronPython 1.1.2, in several weeks. Please let us know > if you > encounter any issues as soon as possible. > > The following CodePlex Work Items were closed: > > ? 16368 1.1.2: nt.access is missing > > ? 16402 1.1.2: implement _winreg module > > ? 15105 1.1.2: endpos is zero in IronPython 1.1.1 > > ? 16335 1.1.2: Event handlers can cause circular references > and leak memory > > ? 16337 1.1.2: Trivial: Implement float.__lt__(float) > > ? 16338 1.1.2: Using lambda in class definition will add > into the > > ? 16342 1.1.2: calling base class __call__ invokes > constructor > instead > > ? 16343 1.1.2: problem with __slots__ and __init__ in > new-style classes > > ? 16347 1.1.2: Trivial: popen shouldn't open new window > > ? 16348 1.1.2: Removes the inexistent file did not throw > OSError in IP > > ? 16350 1.1.2: int() doesn't convert representable > longs to int > > ? 16351 1.1.2: dict.update doesn't take keyword arguments - > differs from CPython > > ? 16353 1.1.2: Trivial: int('0x20', 16) fails to parse, > long too > > ? 16355 1.1.2: unpacking single element tuples in > for-statement, listcomp and generator > > ? 16356 1.1.2: socket.getnameinfo(...) broken under Vista > > ? 16360 1.1.2: Class with slots and getattr not compatible > > ? 16363 1.1.2: Can't call method w/ nullable as 1st > argument > w/ greater than 5 arguments > > ? 16364 1.1.2: Backport fix for compiled regular > expressions > > ? 16365 1.1.2: Tuple hashing improvements > > ? 16366 1.1.2: PyCF_DONT_IMPLY_DEDENT support in compile > > ? 16749 1.1.2 (Trivial): Modifier of > PythonEngine.DefaultCompilerContext(..) > > We'd like to thank everyone in the community who > contributed > to these bugs: Ronnie Maor, jackeyoo, sanxiyn, Michael > Foord, > Kamil Dworakowski, lthompson, romank, Jeff Brown, rridge, > David Fraser, pobrien, ebaklund. > > You can download IronPython 1.1.2 RC1 at: > > http://www.codeplex.com/IronPython/Release/ProjectReleases.aspx?ReleaseId=15198 > > > The IronPython Team > > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > > > > > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > -- http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 > > > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From Harry.Pierson at microsoft.com Tue Jul 15 20:57:26 2008 From: Harry.Pierson at microsoft.com (Harry Pierson) Date: Tue, 15 Jul 2008 11:57:26 -0700 Subject: [IronPython] Announcing IronPython 1.1.2 RC1 In-Reply-To: References: Message-ID: FYI, I've got more details on the two breaking changes on my blog. http://devhawk.net/2008/07/15/IronPython+112+RC.aspx. Please let us know if either of these changes affect you From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Srivatsn Narayanan Sent: Monday, July 14, 2008 9:51 PM To: Discussion of IronPython Subject: [IronPython] Announcing IronPython 1.1.2 RC1 Hello IronPython Community, I'm pleased to announce the release of IronPython 1.1.2 RC1. In this release twenty-one CodePlex work Items that were identified as high priority on the IronPython mailing list were fixed. It's worth noting that this included the implementation of the "_winreg" CPython module and a few performance improvements in targeted areas. Please also note that there are two potentially breaking changes in this release: * nt.unlink will now throw an exception if the file doesn't exist, as it does in CPython. * The signature of IronPython.Runtime.Operations.Ops.Id() has changed and it now returns an object instead of long. This maps to the id() function in python. Note that there is no change for python caused by this and only code which is directly calling Ops.Id from a statically typed language like C# or VB will be affected. Assuming no major issues are discovered in this build, we hope to rerelease it as our last planned IronPython 1.1 release, IronPython 1.1.2, in several weeks. Please let us know if you encounter any issues as soon as possible. The following CodePlex Work Items were closed: * 16368 1.1.2: nt.access is missing * 16402 1.1.2: implement _winreg module * 15105 1.1.2: endpos is zero in IronPython 1.1.1 * 16335 1.1.2: Event handlers can cause circular references and leak memory * 16337 1.1.2: Trivial: Implement float.__lt__(float) * 16338 1.1.2: Using lambda in class definition will add into the * 16342 1.1.2: calling base class __call__ invokes constructor instead * 16343 1.1.2: problem with __slots__ and __init__ in new-style classes * 16347 1.1.2: Trivial: popen shouldn't open new window * 16348 1.1.2: Removes the inexistent file did not throw OSError in IP * 16350 1.1.2: int() doesn't convert representable longs to int * 16351 1.1.2: dict.update doesn't take keyword arguments - differs from CPython * 16353 1.1.2: Trivial: int('0x20', 16) fails to parse, long too * 16355 1.1.2: unpacking single element tuples in for-statement, listcomp and generator * 16356 1.1.2: socket.getnameinfo(...) broken under Vista * 16360 1.1.2: Class with slots and getattr not compatible * 16363 1.1.2: Can't call method w/ nullable as 1st argument w/ greater than 5 arguments * 16364 1.1.2: Backport fix for compiled regular expressions * 16365 1.1.2: Tuple hashing improvements * 16366 1.1.2: PyCF_DONT_IMPLY_DEDENT support in compile * 16749 1.1.2 (Trivial): Modifier of PythonEngine.DefaultCompilerContext(..) We'd like to thank everyone in the community who contributed to these bugs: Ronnie Maor, jackeyoo, sanxiyn, Michael Foord, Kamil Dworakowski, lthompson, romank, Jeff Brown, rridge, David Fraser, pobrien, ebaklund. You can download IronPython 1.1.2 RC1 at: http://www.codeplex.com/IronPython/Release/ProjectReleases.aspx?ReleaseId=15198 The IronPython Team -------------- next part -------------- An HTML attachment was scrubbed... URL: From mbarnett at uniserve.com Wed Jul 16 22:39:46 2008 From: mbarnett at uniserve.com (Mitch Barnett) Date: Wed, 16 Jul 2008 13:39:46 -0700 Subject: [IronPython] Debugging Silverlight DLR app in VS 2008 Message-ID: <005401c8e784$160ded90$6500a8c0@valleyforge> My apology if this has been asked before. I have followed the instructions at: http://silverlight.net/quickstarts/ProgramDlr.aspx for debugging a Silverlight app using the DLR in Visual Studio and I cannot hit a breakpoint. I am using the DLRConsole from the SDK samples as the application. I can make changes to the app.py file and refresh the browser while running under Chiron.exe /b and see the changes appear in the browser. If I follow the instructions and open app.py in VS 2008, set a break point in app.py and then attach to the running instance in IE7 and then F5 to refresh the browser, I never hit any breakpoints. When hovering over the breakpoint in VS, it says that the breakpoint will currently not be hit. No symbols have been loaded for this document. Any ideas as to what I am doing wrong? Thanks, Mitch -------------- next part -------------- An HTML attachment was scrubbed... URL: From dan.eloff at gmail.com Wed Jul 16 23:00:28 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Wed, 16 Jul 2008 16:00:28 -0500 Subject: [IronPython] How to get a ScriptEngine from within a running IronPython script? Message-ID: <4817b6fc0807161400o2914617an138e050041db2c6@mail.gmail.com> Dino showed me Application.Current.Environment.GetEngine('py'), which has been my constant companion is Silverlight, but how can I get the (a?) ScriptEngine in a regular IronPython script? I suppose I could create one: from Microsoft.Scripting.Hosting import ScriptRuntime runtime = ScriptRuntime.Create() Engine = runtime.GetEngine("py") And I'm not sure I would ever notice the difference for what I use it for (what kind of general differences might there be?), but it'd be nice to know if you can get a reference to the existing ScriptEngine. I have no idea how many resources a ScriptEngine consumes, although I would guess it's trivial. Thanks, -Dan From Harry.Pierson at microsoft.com Thu Jul 17 02:12:07 2008 From: Harry.Pierson at microsoft.com (Harry Pierson) Date: Wed, 16 Jul 2008 17:12:07 -0700 Subject: [IronPython] IronPython Post 2.0 Roadmap In-Reply-To: <4875EF83.80805@voidspace.org.uk> References: <4875EF83.80805@voidspace.org.uk> Message-ID: Posted to my blog @ http://devhawk.net/2008/07/17/IronPython+Post+20+Roadmap.aspx but reproduced below for your convenience. IronPython Post 2.0 Roadmap Michael Foord (aka voidspace) twittered that "None of the IronPython team can get it together to blog regularly, except @jschementi of course." While I'm not sure Jimmy is all that prolific either, Michael's certainly right about me. I started this job at the beginning of April, and I've only blogged twenty one times in the three and a half months since. Worse, I've only blogged six times in the past month and a half - and half of those have been since Michael called out my lack o' posting. My wife has blogged like twenty five times in that same time period. I can only plead pressures of a new job plus a two week vacation. I have been twittering a lot. Michael was twittering in response to Todd Ogasawara's post wondering about our Python 3.0 plans. Since we haven't been particularly transparent (my fault) I thought I'd lay out our near and middle term plans. First off, we're on the verge of releasing 1.1.2 (the release candidate is available now), a service release in our 1.x branch which contains a bunch of bug fixes we've back ported from our 2.0 work. This is our last planned release in the 1.x branch. For those who don't know, our 1.x branch tracks CPython's 2.4 branch. Most of our team's focus has been on 2.0 which we're on track to shipping later this year. Our 2.0 corresponds to CPython's 2.5 branch. It's a major release for us because of the addition of the Dynamic Language Runtime. Currently, you can get 2.0 Beta 3, with Beta 4 scheduled for early August (we go about 6 weeks between beta releases). If you want even fresher code than our latest release, you can pull and build the source yourself. We went about two months without pushing source due to some broken scripts, but they're fixed now so we're going to try and push out code much more often than we have in the past. For the non-Python geeks in the audience, Python is undergoing a major change. Python 3.0 is going to break backwards compatibility with Python 2.x in number of ways. Breaking backwards compatibility always has to be handled carefully, so the Python community is investing quite a bit of effort to make the transition as smooth as possible.The Python Software Foundation is currently working on both 2.6 and 3.0 simultaneously. The idea is to have as much feature parity between the two releases (except for the stuff being removed from 3.0) and to provide an automatic tool to translating to the new version. Let me be very clear (since as Todd discovered, we haven't been to date) that once we get IronPython 2.0 out the door, we will start working towards IronPython 3.0, which will be our version of Python 3.0. We want to take the same stepping-stone approach that CPython is taking. So that means at a minimum we'll do an IPy 2.1 with CPython 2.6's new language and library features, (along with the usual bug fixing and other quality improvements we do every cycle) before then proceeding to work on IPy 3.0. Until we get IPy 2.0 out the door, I'm not willing to talk about specific timelines. We're an agile project and we're going to be feature and quality driven, full stop. There were about seven months between the release of IPy 1.0 and 1.1, however that didn't include much new Python feature work so it's not a good comparison IMO. My gut tells me the IPy 2.1 release will take longer than a typical minor release while the IPy 3.0 release won't take as long as a typical major release. Note, those are guesses, not commitments. Besides IPy 2.1 and 3.0, the other major thing we're working on is Visual Studio integration for IronPython. Yes, there is IronPythonStudio, but that's a VS SDK sample not a production-quality VS integration the IPy team maintains or supports. The IntelliSense implementation is pretty flaky, the compile-oriented project system feels pretty un-pythonic and of course we need to upgrade it to support IPy 2.0 and the DLR (it would be nice if IronRuby could leverage our efforts down the road). Like everything else we do in this group, we'll be publishing the VS Integration source code up on CodePlex as early and often as we can. So to recap our current thinking: * IPy 1.1.2 in RC now, shipping in several weeks assuming we don't find any major regressions * IPy 2.0 in beta now, shipping later this year * IPy 2.1 supporting new CPy 2.6 features at some point after IPy 2.1, probably longer than a typical minor release * First release of IPy integration with VS in the same timeframe as IPy 2.1 but with alpha drops as soon as we can * IPy 3.0 supporting new CPy 3.0 after IPy 2.1, probably shorter than a typical major release One last thing, as many of you know the IronRuby project supports community contributions to the standard libraries. I wanted the IPy community to know I'm 100% committed for establishing a similar arrangement for IronPython. I've got nothing to announce yet, but rest assured I've been spending a lot of time talking to lawyers. As always, if you've got opinions to share please feel free to leave me comments below, shoot me an email, or join the IPy mailing list. From empirebuilder at gmail.com Thu Jul 17 10:57:34 2008 From: empirebuilder at gmail.com (Dody Gunawinata) Date: Thu, 17 Jul 2008 11:57:34 +0300 Subject: [IronPython] Object Pooling of IronPython 2.0 engine Message-ID: <8cd017b80807170157h705a3f28l2b4389ad648b1472@mail.gmail.com> I have a scenario in which I need to execute multiple python scripts within a single HTTP request. Right now I create a new instance of the engine for every single HTTP request and use the engine to service those requests. This works fine except that the whole stack breaks down in moderate traffic and I start getting a bunch errors. Is there any facility within the hosting API to support object pooling or do I have to implement them myself? Is object pooling an appropriate solution for this type of scenario at all? Dody G. -- nomadlife.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben.aurel at gmail.com Thu Jul 17 16:37:44 2008 From: ben.aurel at gmail.com (Ben Aurel) Date: Thu, 17 Jul 2008 16:37:44 +0200 Subject: [IronPython] Differences IronPython/CPython Message-ID: <487F5938.7090605@gmail.com> hi there is a slightly outdated document comparing IP 1.0 and CP 2.4.3: http://www.codeplex.com/IronPython/Wiki/View.aspx?title=Differences&referringTitle=Home Could someone tell me about the difference of the latest IronPython 1.1.1 (and the upcoming 1.1.2) and the latest CPython 2.5.2 release? thanks a lot ben From dinov at exchange.microsoft.com Thu Jul 17 16:48:22 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Thu, 17 Jul 2008 07:48:22 -0700 Subject: [IronPython] Object Pooling of IronPython 2.0 engine In-Reply-To: <8cd017b80807170157h705a3f28l2b4389ad648b1472@mail.gmail.com> References: <8cd017b80807170157h705a3f28l2b4389ad648b1472@mail.gmail.com> Message-ID: <7AD436E4270DD54A94238001769C2227012C934315E5@DF-GRTDANE-MSG.exchange.corp.microsoft.com> We don't have any support for object pooling built-in. Have you considered having 1 ScriptRuntime/ScriptEngine for all requests? You could load & compile each piece of code once (so cache any ScriptSource's/CompiledCode objects), and then create a new ScriptScope for each execution to run the code against. That way you're not doing much work per-request but individual script's state is isolated in the ScriptScope. I believe this is what the dynamic language support for ASP.NET does in the ASP.NET Futures and we do have some stress tests making sure that works. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dody Gunawinata Sent: Thursday, July 17, 2008 1:58 AM To: Discussion of IronPython Subject: [IronPython] Object Pooling of IronPython 2.0 engine I have a scenario in which I need to execute multiple python scripts within a single HTTP request. Right now I create a new instance of the engine for every single HTTP request and use the engine to service those requests. This works fine except that the whole stack breaks down in moderate traffic and I start getting a bunch errors. Is there any facility within the hosting API to support object pooling or do I have to implement them myself? Is object pooling an appropriate solution for this type of scenario at all? Dody G. -- nomadlife.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From curt at hagenlocher.org Thu Jul 17 16:51:42 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Thu, 17 Jul 2008 07:51:42 -0700 Subject: [IronPython] Differences IronPython/CPython In-Reply-To: <487F5938.7090605@gmail.com> References: <487F5938.7090605@gmail.com> Message-ID: All of the releases in the 1.x series aim for CPython 2.4 compatibility, and the document is probably reasonably accurate for all ot them. The minor differences can be gleaned from the patch notes. On Thu, Jul 17, 2008 at 7:37 AM, Ben Aurel wrote: > hi > > there is a slightly outdated document comparing IP 1.0 and CP 2.4.3: > > http://www.codeplex.com/IronPython/Wiki/View.aspx?title=Differences&referringTitle=Home > > Could someone tell me about the difference of the latest IronPython 1.1.1 > (and the upcoming 1.1.2) and the latest CPython 2.5.2 release? > > thanks a lot > ben > _______________________________________________ > 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 dfugate at microsoft.com Thu Jul 17 18:21:13 2008 From: dfugate at microsoft.com (Dave Fugate) Date: Thu, 17 Jul 2008 09:21:13 -0700 Subject: [IronPython] Differences IronPython/CPython In-Reply-To: References: <487F5938.7090605@gmail.com> Message-ID: FYI I've just updated http://www.codeplex.com/IronPython/Wiki/View.aspx?title=Differences&referringTitle=Home to make this clearer and added an IronPython 2.0.x/CPython 2.5.2 differences wiki which we'll populate before releasing IP 2.0.0. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Curt Hagenlocher Sent: Thursday, July 17, 2008 7:52 AM To: Discussion of IronPython Subject: Re: [IronPython] Differences IronPython/CPython All of the releases in the 1.x series aim for CPython 2.4 compatibility, and the document is probably reasonably accurate for all ot them. The minor differences can be gleaned from the patch notes. On Thu, Jul 17, 2008 at 7:37 AM, Ben Aurel > wrote: hi there is a slightly outdated document comparing IP 1.0 and CP 2.4.3: http://www.codeplex.com/IronPython/Wiki/View.aspx?title=Differences&referringTitle=Home Could someone tell me about the difference of the latest IronPython 1.1.1 (and the upcoming 1.1.2) and the latest CPython 2.5.2 release? thanks a lot ben _______________________________________________ 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 fuzzyman at voidspace.org.uk Fri Jul 18 00:40:29 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 17 Jul 2008 23:40:29 +0100 Subject: [IronPython] IronPython Post 2.0 Roadmap In-Reply-To: References: <4875EF83.80805@voidspace.org.uk> Message-ID: <487FCA5D.5090909@voidspace.org.uk> Hi Harry - nice write-up, thanks! It's great to hear about the way you guys see IronPython developing in the future. My comment on Twitter wasn't really aimed at you - I was hoping to prod Dino, Martin or Sri into blogging more! One question. When IronPython 3 is started, targeting CPython 3.0, will you actively maintain IronPython 2 and IronPython 3 in parallel? This is what the Python developers will do for several years to come as it will be a long time before the majority of the community has switched over to Python 3. OF course because of the Unicode strings Python 3 is a better fit for IronPython, but for example the library support outside the standard library won't be there for quite a long time. Michael Harry Pierson wrote: > Posted to my blog @ http://devhawk.net/2008/07/17/IronPython+Post+20+Roadmap.aspx but reproduced below for your convenience. > > > > IronPython Post 2.0 Roadmap > > Michael Foord (aka voidspace) twittered that "None of the IronPython team can get it together to blog regularly, except @jschementi of course." While I'm not sure Jimmy is all that prolific either, Michael's certainly right about me. I started this job at the beginning of April, and I've only blogged twenty one times in the three and a half months since. Worse, I've only blogged six times in the past month and a half - and half of those have been since Michael called out my lack o' posting. My wife has blogged like twenty five times in that same time period. I can only plead pressures of a new job plus a two week vacation. I have been twittering a lot. > > Michael was twittering in response to Todd Ogasawara's post wondering about our Python 3.0 plans. Since we haven't been particularly transparent (my fault) I thought I'd lay out our near and middle term plans. > > First off, we're on the verge of releasing 1.1.2 (the release candidate is available now), a service release in our 1.x branch which contains a bunch of bug fixes we've back ported from our 2.0 work. This is our last planned release in the 1.x branch. For those who don't know, our 1.x branch tracks CPython's 2.4 branch. > > Most of our team's focus has been on 2.0 which we're on track to shipping later this year. Our 2.0 corresponds to CPython's 2.5 branch. It's a major release for us because of the addition of the Dynamic Language Runtime. Currently, you can get 2.0 Beta 3, with Beta 4 scheduled for early August (we go about 6 weeks between beta releases). If you want even fresher code than our latest release, you can pull and build the source yourself. We went about two months without pushing source due to some broken scripts, but they're fixed now so we're going to try and push out code much more often than we have in the past. > > For the non-Python geeks in the audience, Python is undergoing a major change. Python 3.0 is going to break backwards compatibility with Python 2.x in number of ways. Breaking backwards compatibility always has to be handled carefully, so the Python community is investing quite a bit of effort to make the transition as smooth as possible.The Python Software Foundation is currently working on both 2.6 and 3.0 simultaneously. The idea is to have as much feature parity between the two releases (except for the stuff being removed from 3.0) and to provide an automatic tool to translating to the new version. > > Let me be very clear (since as Todd discovered, we haven't been to date) that once we get IronPython 2.0 out the door, we will start working towards IronPython 3.0, which will be our version of Python 3.0. We want to take the same stepping-stone approach that CPython is taking. So that means at a minimum we'll do an IPy 2.1 with CPython 2.6's new language and library features, (along with the usual bug fixing and other quality improvements we do every cycle) before then proceeding to work on IPy 3.0. > > Until we get IPy 2.0 out the door, I'm not willing to talk about specific timelines. We're an agile project and we're going to be feature and quality driven, full stop. There were about seven months between the release of IPy 1.0 and 1.1, however that didn't include much new Python feature work so it's not a good comparison IMO. My gut tells me the IPy 2.1 release will take longer than a typical minor release while the IPy 3.0 release won't take as long as a typical major release. Note, those are guesses, not commitments. > > Besides IPy 2.1 and 3.0, the other major thing we're working on is Visual Studio integration for IronPython. Yes, there is IronPythonStudio, but that's a VS SDK sample not a production-quality VS integration the IPy team maintains or supports. The IntelliSense implementation is pretty flaky, the compile-oriented project system feels pretty un-pythonic and of course we need to upgrade it to support IPy 2.0 and the DLR (it would be nice if IronRuby could leverage our efforts down the road). Like everything else we do in this group, we'll be publishing the VS Integration source code up on CodePlex as early and often as we can. > > So to recap our current thinking: > > * IPy 1.1.2 in RC now, shipping in several weeks assuming we don't find any major regressions > * IPy 2.0 in beta now, shipping later this year > * IPy 2.1 supporting new CPy 2.6 features at some point after IPy 2.1, probably longer than a typical minor release > * First release of IPy integration with VS in the same timeframe as IPy 2.1 but with alpha drops as soon as we can > * IPy 3.0 supporting new CPy 3.0 after IPy 2.1, probably shorter than a typical major release > > One last thing, as many of you know the IronRuby project supports community contributions to the standard libraries. I wanted the IPy community to know I'm 100% committed for establishing a similar arrangement for IronPython. I've got nothing to announce yet, but rest assured I've been spending a lot of time talking to lawyers. > > As always, if you've got opinions to share please feel free to leave me comments below, shoot me an email, or join the IPy mailing list. > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From empirebuilder at gmail.com Fri Jul 18 10:05:15 2008 From: empirebuilder at gmail.com (Dody Gunawinata) Date: Fri, 18 Jul 2008 11:05:15 +0300 Subject: [IronPython] Object Pooling of IronPython 2.0 engine In-Reply-To: <7AD436E4270DD54A94238001769C2227012C934315E5@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <8cd017b80807170157h705a3f28l2b4389ad648b1472@mail.gmail.com> <7AD436E4270DD54A94238001769C2227012C934315E5@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <8cd017b80807180105h1337d653seb913bb44a1bd105@mail.gmail.com> I did all the ScriptSource/Compiled object caching but this singleton ScriptEngine approach. I'll try that. Thanks. Dody G. On Thu, Jul 17, 2008 at 5:48 PM, Dino Viehland wrote: > We don't have any support for object pooling built-in. > > > > Have you considered having 1 ScriptRuntime/ScriptEngine for all requests? > You could load & compile each piece of code once (so cache any > ScriptSource's/CompiledCode objects), and then create a new ScriptScope for > each execution to run the code against. That way you're not doing much work > per-request but individual script's state is isolated in the ScriptScope. I > believe this is what the dynamic language support for ASP.NET does in the > ASP.NET Futures and we do have some stress tests making sure that works. > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Dody Gunawinata > *Sent:* Thursday, July 17, 2008 1:58 AM > *To:* Discussion of IronPython > *Subject:* [IronPython] Object Pooling of IronPython 2.0 engine > > > > I have a scenario in which I need to execute multiple python scripts within > a single HTTP request. Right now I create a new instance of the engine for > every single HTTP request and use the engine to service those requests. > > This works fine except that the whole stack breaks down in moderate traffic > and I start getting a bunch errors. > > Is there any facility within the hosting API to support object pooling or > do I have to implement them myself? Is object pooling an appropriate > solution for this type of scenario at all? > > Dody G. > > -- > nomadlife.org > -- nomadlife.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From curt at hagenlocher.org Fri Jul 18 17:23:01 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Fri, 18 Jul 2008 08:23:01 -0700 Subject: [IronPython] IronPython Post 2.0 Roadmap In-Reply-To: <487FCA5D.5090909@voidspace.org.uk> References: <4875EF83.80805@voidspace.org.uk> <487FCA5D.5090909@voidspace.org.uk> Message-ID: On Thu, Jul 17, 2008 at 3:40 PM, Michael Foord wrote: > > One question. When IronPython 3 is started, targeting CPython 3.0, will you actively > maintain IronPython 2 and IronPython 3 in parallel? I think it's fair to say that this will be driven mostly by the needs of our community and of the larger Python community. By the time IronPython 3.0 ships, it's likely that CPython 3.0 will have been out for a year or even longer, and we'll have a much better idea of what the uptake is like in the community. -- Curt Hagenlocher curt at hagenlocher.org From fuzzyman at voidspace.org.uk Fri Jul 18 17:51:51 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Fri, 18 Jul 2008 16:51:51 +0100 Subject: [IronPython] IronPython Post 2.0 Roadmap In-Reply-To: References: <4875EF83.80805@voidspace.org.uk> <487FCA5D.5090909@voidspace.org.uk> Message-ID: <4880BC17.5020007@voidspace.org.uk> Curt Hagenlocher wrote: > On Thu, Jul 17, 2008 at 3:40 PM, Michael Foord > wrote: > >> One question. When IronPython 3 is started, targeting CPython 3.0, will you actively >> maintain IronPython 2 and IronPython 3 in parallel? >> > > I think it's fair to say that this will be driven mostly by the needs > of our community and of the larger Python community. By the time > IronPython 3.0 ships, it's likely that CPython 3.0 will have been out > for a year or even longer, and we'll have a much better idea of what > the uptake is like in the community. > Great - thanks. That sounds reasonable. :-) There is a fair possibility that the 'community' will prefer Python 2 for several years (3-4 guesstimate). Michael > -- > Curt Hagenlocher > curt at hagenlocher.org > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.resolverhacks.net/ http://www.theotherdelia.co.uk/ From dan.eloff at gmail.com Sat Jul 19 07:54:47 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Sat, 19 Jul 2008 00:54:47 -0500 Subject: [IronPython] IronPython Post 2.0 Roadmap In-Reply-To: <4880BC17.5020007@voidspace.org.uk> References: <4875EF83.80805@voidspace.org.uk> <487FCA5D.5090909@voidspace.org.uk> <4880BC17.5020007@voidspace.org.uk> Message-ID: <4817b6fc0807182254o7ea4dccu45d0294beaba1989@mail.gmail.com> > There is a fair possibility that the 'community' will prefer Python 2 for > several years (3-4 guesstimate). > > Michael > I would guess it will take less time for IronPython, because most of the libraries don't work in ipy anyway. There's fewer things to hold you back at the 2 level. If IronPython 3 were out right now, I'd use it. If CPython 3 were out right now, I wouldn't. -Dan From empirebuilder at gmail.com Sat Jul 19 09:56:02 2008 From: empirebuilder at gmail.com (Dody Gunawinata) Date: Sat, 19 Jul 2008 10:56:02 +0300 Subject: [IronPython] IronPython Post 2.0 Roadmap In-Reply-To: <4817b6fc0807182254o7ea4dccu45d0294beaba1989@mail.gmail.com> References: <4875EF83.80805@voidspace.org.uk> <487FCA5D.5090909@voidspace.org.uk> <4880BC17.5020007@voidspace.org.uk> <4817b6fc0807182254o7ea4dccu45d0294beaba1989@mail.gmail.com> Message-ID: <8cd017b80807190056s3c8a955cu15c436f51c8a31ea@mail.gmail.com> For me, the main strength of IronPython is its hosting API and the simplicity of the Python language. It's pretty amazing on what combination of C# and IronPython hosting API can do - we use it from running business rules table, sending python command in a game project and powering our CMS. In our next business project, we are planning to expose a bunch of IronPython scripts to the administrator role. Yeah, it's a poor man's DSL, but it's already there and you dont' have to spend time writing all the crufts required to write a DSL. So I'd much prefer a much stronger features in the hosting and ability to interact with the rest of the .Net framework than supporting a new version of the Python language. Dody G. On Sat, Jul 19, 2008 at 8:54 AM, Dan Eloff wrote: > > There is a fair possibility that the 'community' will prefer Python 2 for > > several years (3-4 guesstimate). > > > > Michael > > > > I would guess it will take less time for IronPython, because most of > the libraries don't work in ipy anyway. There's fewer things to hold > you back at the 2 level. If IronPython 3 were out right now, I'd use > it. If CPython 3 were out right now, I wouldn't. > > -Dan > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- nomadlife.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From Harry.Pierson at microsoft.com Sat Jul 19 18:34:51 2008 From: Harry.Pierson at microsoft.com (Harry Pierson) Date: Sat, 19 Jul 2008 09:34:51 -0700 Subject: [IronPython] IronPython Post 2.0 Roadmap In-Reply-To: <8cd017b80807190056s3c8a955cu15c436f51c8a31ea@mail.gmail.com> References: <4875EF83.80805@voidspace.org.uk> <487FCA5D.5090909@voidspace.org.uk> <4880BC17.5020007@voidspace.org.uk> <4817b6fc0807182254o7ea4dccu45d0294beaba1989@mail.gmail.com> <8cd017b80807190056s3c8a955cu15c436f51c8a31ea@mail.gmail.com> Message-ID: Hosting features are all done via the DLR, so that's a separate team. As for "ability to interact with the rest of the .Net framework", can you be more specific about what you're looking for in that space? What *isn't* IPy doing that you want it to? Harry Pierson Senior Program Mangager, IronPython Visual Studio Managed Languages email : harry.pierson at microsoft.com office : 425/705-6045 mobile : 425/761-0293 weblog : http://devhawk.net "Don't worry about people stealing your ideas. If your ideas are any good, you'll have to ram them down people's throats." - Howard Aiken From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dody Gunawinata Sent: Saturday, July 19, 2008 12:56 AM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap For me, the main strength of IronPython is its hosting API and the simplicity of the Python language. It's pretty amazing on what combination of C# and IronPython hosting API can do - we use it from running business rules table, sending python command in a game project and powering our CMS. In our next business project, we are planning to expose a bunch of IronPython scripts to the administrator role. Yeah, it's a poor man's DSL, but it's already there and you dont' have to spend time writing all the crufts required to write a DSL. So I'd much prefer a much stronger features in the hosting and ability to interact with the rest of the .Net framework than supporting a new version of the Python language. Dody G. On Sat, Jul 19, 2008 at 8:54 AM, Dan Eloff > wrote: > There is a fair possibility that the 'community' will prefer Python 2 for > several years (3-4 guesstimate). > > Michael > I would guess it will take less time for IronPython, because most of the libraries don't work in ipy anyway. There's fewer things to hold you back at the 2 level. If IronPython 3 were out right now, I'd use it. If CPython 3 were out right now, I wouldn't. -Dan _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- nomadlife.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From sanxiyn at gmail.com Sat Jul 19 19:35:52 2008 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Sun, 20 Jul 2008 02:35:52 +0900 Subject: [IronPython] IronPython Post 2.0 Roadmap In-Reply-To: References: <4875EF83.80805@voidspace.org.uk> <487FCA5D.5090909@voidspace.org.uk> <4880BC17.5020007@voidspace.org.uk> <4817b6fc0807182254o7ea4dccu45d0294beaba1989@mail.gmail.com> <8cd017b80807190056s3c8a955cu15c436f51c8a31ea@mail.gmail.com> Message-ID: <5b0248170807191035m332c07d9j1aff9ba94abf8310@mail.gmail.com> 2008/7/20 Harry Pierson : > Hosting features are all done via the DLR, so that's a separate team. As for > "ability to interact with the rest of the .Net framework", can you be more > specific about what you're looking for in that space? What *isn't* IPy doing > that you want it to? .NET attributes? -- Seo Sanghyeon From fuzzyman at voidspace.org.uk Sat Jul 19 19:37:33 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sat, 19 Jul 2008 18:37:33 +0100 Subject: [IronPython] IronPython Post 2.0 Roadmap In-Reply-To: <5b0248170807191035m332c07d9j1aff9ba94abf8310@mail.gmail.com> References: <4875EF83.80805@voidspace.org.uk> <487FCA5D.5090909@voidspace.org.uk> <4880BC17.5020007@voidspace.org.uk> <4817b6fc0807182254o7ea4dccu45d0294beaba1989@mail.gmail.com> <8cd017b80807190056s3c8a955cu15c436f51c8a31ea@mail.gmail.com> <5b0248170807191035m332c07d9j1aff9ba94abf8310@mail.gmail.com> Message-ID: <4882265D.10804@voidspace.org.uk> Sanghyeon Seo wrote: > 2008/7/20 Harry Pierson : > >> Hosting features are all done via the DLR, so that's a separate team. As for >> "ability to interact with the rest of the .Net framework", can you be more >> specific about what you're looking for in that space? What *isn't* IPy doing >> that you want it to? >> > > .NET attributes? > > +1 :-) Michael -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From kfarmer at thuban.org Sun Jul 20 05:12:34 2008 From: kfarmer at thuban.org (Keith J. Farmer) Date: Sat, 19 Jul 2008 20:12:34 -0700 Subject: [IronPython] IronPython Post 2.0 Roadmap In-Reply-To: <4882265D.10804@voidspace.org.uk> References: <4875EF83.80805@voidspace.org.uk> <487FCA5D.5090909@voidspace.org.uk> <4880BC17.5020007@voidspace.org.uk> <4817b6fc0807182254o7ea4dccu45d0294beaba1989@mail.gmail.com> <8cd017b80807190056s3c8a955cu15c436f51c8a31ea@mail.gmail.com> <5b0248170807191035m332c07d9j1aff9ba94abf8310@mail.gmail.com> <4882265D.10804@voidspace.org.uk> Message-ID: votes++ -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Saturday, July 19, 2008 10:38 AM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap Sanghyeon Seo wrote: > 2008/7/20 Harry Pierson : > >> Hosting features are all done via the DLR, so that's a separate team. As for >> "ability to interact with the rest of the .Net framework", can you be more >> specific about what you're looking for in that space? What *isn't* IPy doing >> that you want it to? >> > > .NET attributes? > > +1 :-) Michael -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From kfarmer at thuban.org Sun Jul 20 05:52:05 2008 From: kfarmer at thuban.org (Keith J. Farmer) Date: Sat, 19 Jul 2008 20:52:05 -0700 Subject: [IronPython] IronPython Post 2.0 Roadmap In-Reply-To: References: <4875EF83.80805@voidspace.org.uk> <487FCA5D.5090909@voidspace.org.uk> <4880BC17.5020007@voidspace.org.uk> <4817b6fc0807182254o7ea4dccu45d0294beaba1989@mail.gmail.com> <8cd017b80807190056s3c8a955cu15c436f51c8a31ea@mail.gmail.com> <5b0248170807191035m332c07d9j1aff9ba94abf8310@mail.gmail.com><4882265D.10804@voidspace.org.uk> Message-ID: ...and C#3-style extension method syntax. Though that's arguably a DLR-level issue. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Keith J. Farmer Sent: Saturday, July 19, 2008 8:13 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap votes++ -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Saturday, July 19, 2008 10:38 AM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap Sanghyeon Seo wrote: > 2008/7/20 Harry Pierson : > >> Hosting features are all done via the DLR, so that's a separate team. As for >> "ability to interact with the rest of the .Net framework", can you be more >> specific about what you're looking for in that space? What *isn't* IPy doing >> that you want it to? >> > > .NET attributes? > > +1 :-) Michael -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ _______________________________________________ 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 rednaxela0607 at hotmail.com Sun Jul 20 09:24:14 2008 From: rednaxela0607 at hotmail.com (FX Meta) Date: Sun, 20 Jul 2008 15:24:14 +0800 Subject: [IronPython] Missing File in IronPython Change Set 34376? Message-ID: Hi all, Not sure if this is the right place to ask, but there seems to be something wrong with the latest source code change set on CodePlex. A file called ScriptCodeParseResult.cs is missing in Microsoft.Scripting.Core. I see that there was a file called SourceCodeProperties.cs. Is this file refactored into ScriptCodeParseResult.cs, but missed the check-in?Greetings,- RednaxelaFX _________________________________________________________________ Connect to the next generation of MSN Messenger? http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source=wlmailtagline -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Sun Jul 20 13:53:10 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sun, 20 Jul 2008 12:53:10 +0100 Subject: [IronPython] Python in the Browser updates In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A32845D45E2CC9@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <4856F194.7040004@voidspace.org.uk> <485831ED.2050304@voidspace.org.uk> <5283CA0A4168DF4FBBD71AE9ECA5A32845CC6216BA@NA-EXMSG-C116.redmond.corp.microsoft.com> <4858DCF3.1000302@voidspace.org.uk> <5283CA0A4168DF4FBBD71AE9ECA5A32845D45E2CC9@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <48832726.3040704@voidspace.org.uk> Jimmy Schementi wrote: > Michael Foord wrote: > >> Jimmy Schementi wrote: >> >>> Michael, question for you: >>> >>> >>> >>>> On every keypress Javascript calls into IronPython (via the C#!). >>>> >>>> >>> How come you used C# to handle the onkeypress event? This should do >>> >> it in Python: >> >>> >> Did you look at the code to see why? I'd be really interested to know >> if >> I can do what I'm doing from Python inside Silverlight, but I doubt it. >> There's not much code in total, so it should be easy to follow. >> > > Yep, I looked at it, and I'm pretty sure you can do everything from python. All the native Javascript functions are callable from python, or any .NET language, especially with HtmlPage.window.eval(), so there shouldn't be any limitation. > > >> I actually handle the onkeypress event from Javascript (onkeypress.js). >> This calls into 'getSelection' (cursor_pos.js) to work out the current >> selection in the textarea. Naturally this is easy to do in Firefox / >> Safari and scarily awful in IE. :-) >> > > Attaching the event is simple: > > from System.Windows.Browser.HtmlPage import Document > from System.Windows.Input import KeyEventHandler > > Document.myTextAreaID.AttachEvent("onkeypress", KeyEventHander(onKeyPress)) > > def onKeyPress(sender, eventArgs): > # Do something with eventArgs.CharacterCode > pass > > For converting the javascript to python, there are some special javascript variables that are in different places, like "window" is HtmlPage.Window, etc. > > I've used the event attaching stuff before, but some of the Javascript is quite fiddly so I wasn't sure there was much benefit in moving it into Python. My next version will probably be based on the Javascript UI of Try Ruby by Why the Luck Stiff (he has given me permission to use his JS): http://tryruby.hobix.com/ Michael >> Having worked these out (and shortcut a few specific scenarios - like >> ctrl-A, ctrl-Z and ctrl-C), the Javascript then calls into IronPython >> with the selection start, selection end, and the character that was >> pressed. I use C# to expose a scriptable type that Javascript can call. >> > > If you hooked all the events with Python, you wouldn't need to call back into it from Javascript. This is why I prefer doing everything with Python, so I avoid having a C# shim. > > >> I use attaching events from Python to provide the sample code. There >> are >> three links above the console and Python handles the 'onclick' event to >> swap the examples around. >> > > Basically, if there is something pretty basic you can't do in Python that you can do from browser Javascript, it's a bug! =) > > >> Michael Foord >> >> >>> >>>
>>> >>> from System import EventHandler >>> from System.Windows.Browser import Htmlpage, HtmlEventArgs >>> >>> document = System.Windows.Browser.HtmlPage.Document >>> def onkeypress(s, e): >>> document.result.innerHTML += "KeyPress
" >>> document.code.AttachEvent("onkeypress", >>> >> EventHandler[HtmlEventArgs](onkeypress)) >> >>> Anyway, just wondering if anything was blocking you from hooking HTML >>> >> events with Python. >> >>> ~js >>> >>> >>> >>>> -----Original Message----- >>>> From: users-bounces at lists.ironpython.com [mailto:users- >>>> bounces at lists.ironpython.com] On Behalf Of Michael Foord >>>> Sent: Tuesday, June 17, 2008 2:52 PM >>>> To: Discussion of IronPython >>>> Subject: Re: [IronPython] Python in the Browser updates >>>> >>>> Hello all, >>>> >>>> Sorry for the noise - but tomorrow I hope to package this for a >>>> >> release >> >>>> and if any of you get the chance to give me any feedback before >>>> >> then. >> >>>> http://www.voidspace.org.uk/ironpython/silverlight- >>>> >> console/console.html >> >>>> I think I have fixed all the basic usability issues (it is no longer >>>> possible to screw up the console so that it refuses further input >>>> >> for >> >>>> example). To *really* fix input I ought to move execution into its >>>> >> own >> >>>> thread so that we can interrupt infinite loops [1] - but that is a >>>> bigger change so I am resisting it for the moment. >>>> >>>> The big change is that I have added some simple code snippets - as >>>> >> an >> >>>> example of how it could be used in tutorials or for teaching Python. >>>> >>>> It is also easy to customize - the source code (200 lines of Python, >>>> >> 70 >> >>>> lines of Javascript, 25 lines of C#) shows how to prepopulate the >>>> execution context and show the first few lines of code in the >>>> interpreter. >>>> >>>> You can get the sourcecode from the repository of course: >>>> >>>> http://code.google.com/p/pythoninthebrowser/ >>>> >>>> All the best, >>>> >>>> Michael Foord >>>> >>>> [1] and then decide whether on windows a ctrl-c should send a >>>> >> keyboard >> >>>> interrupt or copy to the clipboard... >>>> >>>> Michael Foord wrote: >>>> >>>> >>>>> For those who are interested, I've updated "Python in the Browser". >>>>> >>>>> Both the repository: >>>>> >>>>> http://code.google.com/p/pythoninthebrowser/ >>>>> >>>>> And the online demo: >>>>> >>>>> http://www.voidspace.org.uk/ironpython/silverlight- >>>>> >>>>> >>>> console/console.html >>>> >>>> >>>>> There are a few minor but nice improvements: >>>>> >>>>> * The Javascript now works with IE 7! >>>>> * The textarea scrolls as input is printed >>>>> * The context window is disabled to prevent you pasting over the >>>>> >>>>> >>>> input >>>> >>>> >>>>> area - not sure if this is really an improvement though... >>>>> * The input area is cleared on load - to stop browsers like Firefox >>>>> and Safari repopulating the textarea for us on browser refresh >>>>> * Recursion limit is set >>>>> >>>>> I think it is basically in a useful state now... I might push out a >>>>> '0.1' release from the current SVN head. >>>>> >>>>> All the best, >>>>> >>>>> Michael Foord >>>>> >>>>> >>>>> >>>> -- >>>> http://www.ironpythoninaction.com/ >>>> http://www.theotherdelia.co.uk/ >>>> http://www.voidspace.org.uk/ >>>> http://www.ironpython.info/ >>>> http://www.resolverhacks.net/ >>>> >>>> _______________________________________________ >>>> 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From empirebuilder at gmail.com Sun Jul 20 15:26:26 2008 From: empirebuilder at gmail.com (Dody Gunawinata) Date: Sun, 20 Jul 2008 16:26:26 +0300 Subject: [IronPython] IronPython Post 2.0 Roadmap In-Reply-To: References: <4875EF83.80805@voidspace.org.uk> <4880BC17.5020007@voidspace.org.uk> <4817b6fc0807182254o7ea4dccu45d0294beaba1989@mail.gmail.com> <8cd017b80807190056s3c8a955cu15c436f51c8a31ea@mail.gmail.com> <5b0248170807191035m332c07d9j1aff9ba94abf8310@mail.gmail.com> <4882265D.10804@voidspace.org.uk> Message-ID: <8cd017b80807200626x39333942x2c43f44520b6011a@mail.gmail.com> I was thinking more in the line of being able to use Python classes directly from C#. But again, this has nothing to do with the Python language in the first place. On Sun, Jul 20, 2008 at 6:52 AM, Keith J. Farmer wrote: > ...and C#3-style extension method syntax. Though that's arguably a > DLR-level issue. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] On Behalf Of Keith J. Farmer > Sent: Saturday, July 19, 2008 8:13 PM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython Post 2.0 Roadmap > > votes++ > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Saturday, July 19, 2008 10:38 AM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython Post 2.0 Roadmap > > Sanghyeon Seo wrote: > > 2008/7/20 Harry Pierson : > > > >> Hosting features are all done via the DLR, so that's a separate team. As > for > >> "ability to interact with the rest of the .Net framework", can you be > more > >> specific about what you're looking for in that space? What *isn't* IPy > doing > >> that you want it to? > >> > > > > .NET attributes? > > > > > +1 :-) > > Michael > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 > -- nomadlife.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From sanxiyn at gmail.com Sun Jul 20 16:20:47 2008 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Sun, 20 Jul 2008 23:20:47 +0900 Subject: [IronPython] IronPython Post 2.0 Roadmap In-Reply-To: <8cd017b80807200626x39333942x2c43f44520b6011a@mail.gmail.com> References: <4875EF83.80805@voidspace.org.uk> <4880BC17.5020007@voidspace.org.uk> <4817b6fc0807182254o7ea4dccu45d0294beaba1989@mail.gmail.com> <8cd017b80807190056s3c8a955cu15c436f51c8a31ea@mail.gmail.com> <5b0248170807191035m332c07d9j1aff9ba94abf8310@mail.gmail.com> <4882265D.10804@voidspace.org.uk> <8cd017b80807200626x39333942x2c43f44520b6011a@mail.gmail.com> Message-ID: <5b0248170807200720j7311aa55sbf3e47ef1f0d5dc2@mail.gmail.com> 2008/7/20 Dody Gunawinata : > I was thinking more in the line of being able to use Python classes directly > from C#. But again, this has nothing to do with the Python language in the > first place. I think that would be the feature of C#. -- Seo Sanghyeon From seshapv at microsoft.com Sun Jul 20 19:20:19 2008 From: seshapv at microsoft.com (Seshadri Pillailokam Vijayaraghavan) Date: Sun, 20 Jul 2008 10:20:19 -0700 Subject: [IronPython] Missing File in IronPython Change Set 34376? In-Reply-To: References: Message-ID: <4F06AAB8EC03C349A5D6D0A797C4881C40B5A06C23@NA-EXMSG-C112.redmond.corp.microsoft.com> ScriptCodeParseResult is the renamed version of ScriptCodeProperties. This was done along with a couple of minor bug fixes last week. Thanks for brining this to our attention. I will take a look and let you know what the issue is. Thanks Sesh From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of FX Meta Sent: Sunday, July 20, 2008 12:24 AM To: users at lists.ironpython.com Subject: [IronPython] Missing File in IronPython Change Set 34376? Hi all, Not sure if this is the right place to ask, but there seems to be something wrong with the latest source code change set on CodePlex. A file called ScriptCodeParseResult.cs is missing in Microsoft.Scripting.Core. I see that there was a file called SourceCodeProperties.cs. Is this file refactored into ScriptCodeParseResult.cs, but missed the check-in? Greetings, - RednaxelaFX ________________________________ Connect to the next generation of MSN Messenger Get it now! -------------- next part -------------- An HTML attachment was scrubbed... URL: From dfugate at microsoft.com Sun Jul 20 22:22:53 2008 From: dfugate at microsoft.com (Dave Fugate) Date: Sun, 20 Jul 2008 13:22:53 -0700 Subject: [IronPython] Missing File in IronPython Change Set 34376? In-Reply-To: References: Message-ID: Thanks for spotting this! It looks like there was a bug with the script we use to port changes over from our internal TFS repository to CodePlex's TFS repository. It should be fixed now. Dave From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of FX Meta Sent: Sunday, July 20, 2008 12:24 AM To: users at lists.ironpython.com Subject: [IronPython] Missing File in IronPython Change Set 34376? Hi all, Not sure if this is the right place to ask, but there seems to be something wrong with the latest source code change set on CodePlex. A file called ScriptCodeParseResult.cs is missing in Microsoft.Scripting.Core. I see that there was a file called SourceCodeProperties.cs. Is this file refactored into ScriptCodeParseResult.cs, but missed the check-in? Greetings, - RednaxelaFX ________________________________ Connect to the next generation of MSN Messenger Get it now! -------------- next part -------------- An HTML attachment was scrubbed... URL: From rednaxela0607 at hotmail.com Mon Jul 21 00:20:14 2008 From: rednaxela0607 at hotmail.com (FX Meta) Date: Mon, 21 Jul 2008 06:20:14 +0800 Subject: [IronPython] Missing File in IronPython Change Set 34376? Message-ID: Thank you for fixing it :-)This time it builds alright. I understand IronPython and DLR will continue to be developed with .NET Framework 2.0 as target. I'd like to ask, though, now that the DLR expression tree has moved into System.Linq.Expressions namespace, what would be the preferred solution to resolving conflict between references to System.Core.dll and Microsoft.Scripting.Core.dll? Apparently these two do conflict now, don't they? The other day I was implementing a toy language on the DLR for fun, but the fact that I can't use LINQ queries from within my language impl is...well, not too fun. Greetings,- RednaxelaFX -----Original Message-----> From: Dave Fugate > Subject: Re: [IronPython] Missing File in IronPython Change Set 34376?> To: Discussion of IronPython > > Thanks for spotting this!> It looks like there was a bug with the script we use to port changes over from our internal TFS repository to CodePlex's TFS repository.> It should be fixed now.> > Dave -----Original Message-----> From: Seshadri Pillailokam Vijayaraghavan > Subject: Re: [IronPython] Missing File in IronPython Change Set 34376?> To: Discussion of IronPython > > ScriptCodeParseResult is the renamed version of ScriptCodeProperties.> This was done along with a couple of minor bug fixes last week.> Thanks for brining this to our attention. I will take a look and let you know what the issue is. > > Thanks> Sesh _________________________________________________________________ Discover the new Windows Vista http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE -------------- next part -------------- An HTML attachment was scrubbed... URL: From curt at hagenlocher.org Mon Jul 21 01:00:48 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Sun, 20 Jul 2008 16:00:48 -0700 Subject: [IronPython] Missing File in IronPython Change Set 34376? In-Reply-To: References: Message-ID: On Sun, Jul 20, 2008 at 3:20 PM, FX Meta wrote: > > I understand IronPython and DLR will continue to be developed with .NET > Framework 2.0 as target. I'd like to ask, though, now that the DLR > expression tree has moved into System.Linq.Expressions namespace, what would > be the preferred solution to resolving conflict between references to > System.Core.dll and Microsoft.Scripting.Core.dll? Apparently these two do > conflict now, don't they? Yes. You can probably use the "extern alias" functionality of C# to get around this. You can find an example at http://blogs.msdn.com/abhinaba/archive/2005/11/30/498278.aspx -- Curt Hagenlocher curt at hagenlocher.org From textdirected at gmail.com Mon Jul 21 03:18:10 2008 From: textdirected at gmail.com (HEMMI, Shigeru) Date: Mon, 21 Jul 2008 10:18:10 +0900 Subject: [IronPython] 1.1.2 RC1, some small probolems Message-ID: Hello IronPython team, Regarding 1.1.2 RC1, I noticed some small problems. 1. If I choose Windows Powershell prompt on starup, optional argument causes File not Found error. For example, please try ipy.exe -X:TabCompletion 2. os.walk(==nt.walk) seems missing, is it intentional? 3. If I build the sources with mono, some warings generated. One of them is IronPython/Modules/datetime.cs(770,17): warning CS1717: Assignment made to same variable; did you mean to assign something else? and the corresponding line is dt = dt = dt.ToUniversalTime(); Is this a valid coding? Regards, From kfarmer at thuban.org Mon Jul 21 04:23:43 2008 From: kfarmer at thuban.org (Keith J. Farmer) Date: Sun, 20 Jul 2008 19:23:43 -0700 Subject: [IronPython] IronPython Post 2.0 Roadmap In-Reply-To: <8cd017b80807200626x39333942x2c43f44520b6011a@mail.gmail.com> References: <4875EF83.80805@voidspace.org.uk><4880BC17.5020007@voidspace.org.uk><4817b6fc0807182254o7ea4dccu45d0294beaba1989@mail.gmail.com><8cd017b80807190056s3c8a955cu15c436f51c8a31ea@mail.gmail.com><5b0248170807191035m332c07d9j1aff9ba94abf8310@mail.gmail.com><4882265D.10804@voidspace.org.uk> <8cd017b80807200626x39333942x2c43f44520b6011a@mail.gmail.com> Message-ID: The extensions problem is a matter of tweaking method resolution rules. So, while there could be some impact on IP itself (some way to indicate the set of extensions to use) I think most of the work would best be done in the DLR (take that information and use it to perform the binding). I half-heartedly tried to hack this in some time ago, but ran across what appeared to be a DLR bug. Showed it to someone on the team but I don't know where it went afterward. Incidentally, there is a difference (from what I've seen) to what a DLR "extension" is compared to a .NET 3.5 "extension". From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dody Gunawinata Sent: Sunday, July 20, 2008 6:26 AM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap I was thinking more in the line of being able to use Python classes directly from C#. But again, this has nothing to do with the Python language in the first place. On Sun, Jul 20, 2008 at 6:52 AM, Keith J. Farmer wrote: ...and C#3-style extension method syntax. Though that's arguably a DLR-level issue. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Keith J. Farmer Sent: Saturday, July 19, 2008 8:13 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap votes++ -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Saturday, July 19, 2008 10:38 AM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap Sanghyeon Seo wrote: > 2008/7/20 Harry Pierson : > >> Hosting features are all done via the DLR, so that's a separate team. As for >> "ability to interact with the rest of the .Net framework", can you be more >> specific about what you're looking for in that space? What *isn't* IPy doing >> that you want it to? >> > > .NET attributes? > > +1 :-) Michael -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ _______________________________________________ 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 -- nomadlife.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From curt at hagenlocher.org Mon Jul 21 08:06:54 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Sun, 20 Jul 2008 23:06:54 -0700 Subject: [IronPython] 1.1.2 RC1, some small probolems In-Reply-To: References: Message-ID: On Sun, Jul 20, 2008 at 6:18 PM, HEMMI, Shigeru wrote: > Hello IronPython team, > > Regarding 1.1.2 RC1, I noticed some small problems. > > 1. If I choose Windows Powershell prompt on starup, optional argument > causes File not Found error. For example, please try > ipy.exe -X:TabCompletion Using Powershell, you have to quote arguments containing a colon. Instead, try ipy.exe "-X:TabCompletion" > 2. os.walk(==nt.walk) seems missing, is it intentional? This was not defined in 1.1.1 either. In fact, it's defined for CPython as pure Python in the file os.py. We're not yet distributing the .py files from the standard Python library with IronPython, but if you use os.py from the 2.4.4 distribution, os.walk will probably work correctly under IronPython. > 3. If I build the sources with mono, some warings generated. One of them is > IronPython/Modules/datetime.cs(770,17): warning CS1717: Assignment > made to same variable; did you mean to assign something else? > and the corresponding line is > dt = dt = dt.ToUniversalTime(); It certainly looks wrong and I'll take a look at it in the morning. -- Curt Hagenlocher curt at hagenlocher.org From Harry.Pierson at microsoft.com Mon Jul 21 08:14:29 2008 From: Harry.Pierson at microsoft.com (Harry Pierson) Date: Sun, 20 Jul 2008 23:14:29 -0700 Subject: [IronPython] IronPython Post 2.0 Roadmap In-Reply-To: References: <4875EF83.80805@voidspace.org.uk> <487FCA5D.5090909@voidspace.org.uk> <4880BC17.5020007@voidspace.org.uk> <4817b6fc0807182254o7ea4dccu45d0294beaba1989@mail.gmail.com> <8cd017b80807190056s3c8a955cu15c436f51c8a31ea@mail.gmail.com> <5b0248170807191035m332c07d9j1aff9ba94abf8310@mail.gmail.com> <4882265D.10804@voidspace.org.uk> Message-ID: Can you give me some examples where you would use these? The problem I see is that many scenarios (WCF contracts, XML serialization just to name two) where people want to use a custom attribute depends on the availability of a static type. Harry -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Keith J. Farmer Sent: Saturday, July 19, 2008 8:13 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap votes++ -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Saturday, July 19, 2008 10:38 AM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap Sanghyeon Seo wrote: > 2008/7/20 Harry Pierson : > >> Hosting features are all done via the DLR, so that's a separate team. As for >> "ability to interact with the rest of the .Net framework", can you be more >> specific about what you're looking for in that space? What *isn't* IPy doing >> that you want it to? >> > > .NET attributes? > > +1 :-) Michael -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ _______________________________________________ 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 petersonjm1 at gmail.com Mon Jul 21 15:58:08 2008 From: petersonjm1 at gmail.com (Joshua Peterson) Date: Mon, 21 Jul 2008 09:58:08 -0400 Subject: [IronPython] IronPython.Hosting.EngineOptions.ClrDebuggingEnabled in IronPython 2.0 Beta 3 Message-ID: <2a03b9790807210658w10e3b6b5r439c13a00f210c49@mail.gmail.com> I'm working with a C# application that hosts IronPython 2.0 Beta 3. I would like to be able to use the IronPython integration sample that ships with the Visual Studio 2005 SDK to debug the python code running in my C# application. If I host IronPython 1.1 in a C# application, I can set the IronPython.Hosting.EngineOptions.ClrDebuggingEnabled flag to true as in the example below. This allows me to step through the python code in test.py in Visual Studio. Is there something similar to the ClrDebuggingEnabled in IronPython 2.0? Thanks. Josh Program.cs: using System; using System.Collections.Generic; using System.Text; using IronPython; using IronPython.Hosting; namespace TestDebugEmbeddedIronPyton { class Program { static void Main(string[] args) { EngineOptions eo = new EngineOptions(); eo.ClrDebuggingEnabled = true; PythonEngine pe = new PythonEngine(eo); pe.ExecuteFile(@"C:\test.py"); } } } test.py: import System import System.Diagnostics print "Test 1" System.Diagnostics.Debugger.Break() print "Test 2" -- Rejoice always. Pray without ceasing. In all circumstances give thanks, for this is the will of God for you in Christ Jesus. -- 1 Thes. 5:16-18 NAB -- I am the living bread that came down from heaven; whoever eats this bread will live forever; and the bread that I will give is my flesh for the life of the world. -- John 6:51 NAB -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jimmy.Schementi at microsoft.com Mon Jul 21 16:45:16 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Mon, 21 Jul 2008 07:45:16 -0700 Subject: [IronPython] Python in the Browser updates In-Reply-To: <48832726.3040704@voidspace.org.uk> References: <4856F194.7040004@voidspace.org.uk> <485831ED.2050304@voidspace.org.uk> <5283CA0A4168DF4FBBD71AE9ECA5A32845CC6216BA@NA-EXMSG-C116.redmond.corp.microsoft.com> <4858DCF3.1000302@voidspace.org.uk> <5283CA0A4168DF4FBBD71AE9ECA5A32845D45E2CC9@NA-EXMSG-C116.redmond.corp.microsoft.com> <48832726.3040704@voidspace.org.uk> Message-ID: On Jul 20, 2008, at 7:53 AM, "Michael Foord" wrote: > Jimmy Schementi wrote: >> Michael Foord wrote: >> >>> Jimmy Schementi wrote: >>> >>>> Michael, question for you: >>>> >>>> >>>> >>>>> On every keypress Javascript calls into IronPython (via the C#!). >>>>> >>>>> >>>> How come you used C# to handle the onkeypress event? This should do >>>> >>> it in Python: >>> >>>> >>> Did you look at the code to see why? I'd be really interested to >>> know >>> if >>> I can do what I'm doing from Python inside Silverlight, but I >>> doubt it. >>> There's not much code in total, so it should be easy to follow. >>> >> >> Yep, I looked at it, and I'm pretty sure you can do everything from >> python. All the native Javascript functions are callable from >> python, or any .NET language, especially with >> HtmlPage.window.eval(), so there shouldn't be any limitation. >> >> >>> I actually handle the onkeypress event from Javascript >>> (onkeypress.js). >>> This calls into 'getSelection' (cursor_pos.js) to work out the >>> current >>> selection in the textarea. Naturally this is easy to do in Firefox / >>> Safari and scarily awful in IE. :-) >>> >> >> Attaching the event is simple: >> >> from System.Windows.Browser.HtmlPage import Document >> from System.Windows.Input import KeyEventHandler >> >> Document.myTextAreaID.AttachEvent("onkeypress", >> KeyEventHander(onKeyPress)) >> >> def onKeyPress(sender, eventArgs): >> # Do something with eventArgs.CharacterCode >> pass >> >> For converting the javascript to python, there are some special >> javascript variables that are in different places, like "window" is >> HtmlPage.Window, etc. >> >> > > I've used the event attaching stuff before, but some of the Javascript > is quite fiddly so I wasn't sure there was much benefit in moving it > into Python. > > My next version will probably be based on the Javascript UI of Try > Ruby > by Why the Luck Stiff (he has given me permission to use his JS): > > http://tryruby.hobix.com/ > > Michael Well, I have a console ui in ruby at silverline.schementi.com/tryruby, so if you change your mind feel free to use that. It's not perfect yet, but I'm working on it. >>> Having worked these out (and shortcut a few specific scenarios - >>> like >>> ctrl-A, ctrl-Z and ctrl-C), the Javascript then calls into >>> IronPython >>> with the selection start, selection end, and the character that was >>> pressed. I use C# to expose a scriptable type that Javascript can >>> call. >>> >> >> If you hooked all the events with Python, you wouldn't need to call >> back into it from Javascript. This is why I prefer doing everything >> with Python, so I avoid having a C# shim. >> >> >>> I use attaching events from Python to provide the sample code. There >>> are >>> three links above the console and Python handles the 'onclick' >>> event to >>> swap the examples around. >>> >> >> Basically, if there is something pretty basic you can't do in >> Python that you can do from browser Javascript, it's a bug! =) >> >> >>> Michael Foord >>> >>> >>>> >>>>
>>>> >>>> from System import EventHandler >>>> from System.Windows.Browser import Htmlpage, HtmlEventArgs >>>> >>>> document = System.Windows.Browser.HtmlPage.Document >>>> def onkeypress(s, e): >>>> document.result.innerHTML += "KeyPress
" >>>> document.code.AttachEvent("onkeypress", >>>> >>> EventHandler[HtmlEventArgs](onkeypress)) >>> >>>> Anyway, just wondering if anything was blocking you from hooking >>>> HTML >>>> >>> events with Python. >>> >>>> ~js >>>> >>>> >>>> >>>>> -----Original Message----- >>>>> From: users-bounces at lists.ironpython.com [mailto:users- >>>>> bounces at lists.ironpython.com] On Behalf Of Michael Foord >>>>> Sent: Tuesday, June 17, 2008 2:52 PM >>>>> To: Discussion of IronPython >>>>> Subject: Re: [IronPython] Python in the Browser updates >>>>> >>>>> Hello all, >>>>> >>>>> Sorry for the noise - but tomorrow I hope to package this for a >>>>> >>> release >>> >>>>> and if any of you get the chance to give me any feedback before >>>>> >>> then. >>> >>>>> http://www.voidspace.org.uk/ironpython/silverlight- >>>>> >>> console/console.html >>> >>>>> I think I have fixed all the basic usability issues (it is no >>>>> longer >>>>> possible to screw up the console so that it refuses further input >>>>> >>> for >>> >>>>> example). To *really* fix input I ought to move execution into its >>>>> >>> own >>> >>>>> thread so that we can interrupt infinite loops [1] - but that is a >>>>> bigger change so I am resisting it for the moment. >>>>> >>>>> The big change is that I have added some simple code snippets - as >>>>> >>> an >>> >>>>> example of how it could be used in tutorials or for teaching >>>>> Python. >>>>> >>>>> It is also easy to customize - the source code (200 lines of >>>>> Python, >>>>> >>> 70 >>> >>>>> lines of Javascript, 25 lines of C#) shows how to prepopulate the >>>>> execution context and show the first few lines of code in the >>>>> interpreter. >>>>> >>>>> You can get the sourcecode from the repository of course: >>>>> >>>>> http://code.google.com/p/pythoninthebrowser/ >>>>> >>>>> All the best, >>>>> >>>>> Michael Foord >>>>> >>>>> [1] and then decide whether on windows a ctrl-c should send a >>>>> >>> keyboard >>> >>>>> interrupt or copy to the clipboard... >>>>> >>>>> Michael Foord wrote: >>>>> >>>>> >>>>>> For those who are interested, I've updated "Python in the >>>>>> Browser". >>>>>> >>>>>> Both the repository: >>>>>> >>>>>> http://code.google.com/p/pythoninthebrowser/ >>>>>> >>>>>> And the online demo: >>>>>> >>>>>> http://www.voidspace.org.uk/ironpython/silverlight- >>>>>> >>>>>> >>>>> console/console.html >>>>> >>>>> >>>>>> There are a few minor but nice improvements: >>>>>> >>>>>> * The Javascript now works with IE 7! >>>>>> * The textarea scrolls as input is printed >>>>>> * The context window is disabled to prevent you pasting over the >>>>>> >>>>>> >>>>> input >>>>> >>>>> >>>>>> area - not sure if this is really an improvement though... >>>>>> * The input area is cleared on load - to stop browsers like >>>>>> Firefox >>>>>> and Safari repopulating the textarea for us on browser refresh >>>>>> * Recursion limit is set >>>>>> >>>>>> I think it is basically in a useful state now... I might push >>>>>> out a >>>>>> '0.1' release from the current SVN head. >>>>>> >>>>>> All the best, >>>>>> >>>>>> Michael Foord >>>>>> >>>>>> >>>>>> >>>>> -- >>>>> http://www.ironpythoninaction.com/ >>>>> http://www.theotherdelia.co.uk/ >>>>> http://www.voidspace.org.uk/ >>>>> http://www.ironpython.info/ >>>>> http://www.resolverhacks.net/ >>>>> >>>>> _______________________________________________ >>>>> 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 >> > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From dinov at exchange.microsoft.com Mon Jul 21 18:12:18 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 21 Jul 2008 09:12:18 -0700 Subject: [IronPython] IronPython.Hosting.EngineOptions.ClrDebuggingEnabled in IronPython 2.0 Beta 3 In-Reply-To: <2a03b9790807210658w10e3b6b5r439c13a00f210c49@mail.gmail.com> References: <2a03b9790807210658w10e3b6b5r439c13a00f210c49@mail.gmail.com> Message-ID: <7AD436E4270DD54A94238001769C2227012C935BFDC1@DF-GRTDANE-MSG.exchange.corp.microsoft.com> The ScriptRuntimeSetup class has a DebugMode flag that can be set. When you do ScriptRuntime.Create you can pass it the ScriptRuntimeSetup object that you created. FYI configuration is going through some reviews and changes so this will soon be slightly different but you'll do the same basic stuff - create some setup object and then pass it off to the ScriptRuntime. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Joshua Peterson Sent: Monday, July 21, 2008 6:58 AM To: users at lists.ironpython.com Subject: [IronPython] IronPython.Hosting.EngineOptions.ClrDebuggingEnabled in IronPython 2.0 Beta 3 I'm working with a C# application that hosts IronPython 2.0 Beta 3. I would like to be able to use the IronPython integration sample that ships with the Visual Studio 2005 SDK to debug the python code running in my C# application. If I host IronPython 1.1 in a C# application, I can set the IronPython.Hosting.EngineOptions.ClrDebuggingEnabled flag to true as in the example below. This allows me to step through the python code in test.py in Visual Studio. Is there something similar to the ClrDebuggingEnabled in IronPython 2.0? Thanks. Josh Program.cs: using System; using System.Collections.Generic; using System.Text; using IronPython; using IronPython.Hosting; namespace TestDebugEmbeddedIronPyton { class Program { static void Main(string[] args) { EngineOptions eo = new EngineOptions(); eo.ClrDebuggingEnabled = true; PythonEngine pe = new PythonEngine(eo); pe.ExecuteFile(@"C:\test.py"); } } } test.py: import System import System.Diagnostics print "Test 1" System.Diagnostics.Debugger.Break() print "Test 2" -- Rejoice always. Pray without ceasing. In all circumstances give thanks, for this is the will of God for you in Christ Jesus. -- 1 Thes. 5:16-18 NAB -- I am the living bread that came down from heaven; whoever eats this bread will live forever; and the bread that I will give is my flesh for the life of the world. -- John 6:51 NAB -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben2004uk at googlemail.com Sun Jul 20 12:06:29 2008 From: ben2004uk at googlemail.com (Ben Hall) Date: Sun, 20 Jul 2008 11:06:29 +0100 Subject: [IronPython] Announcing IronEditor - An Editor for IronRuby, IronPython and other DLR languages Message-ID: Hi everyone, Last night I uploaded an initial release of an application I've been working on - IronEditor. This is a simple application designed to make it easier to start coding against the DLR based languages, out of the box it supports IronPython and IronRuby. The reason why I decided to build this is because Visual Studio Integration for the languages is a long way off and playing around creating code to for the languages is painful via the provided console applications. As such, the aim of the application is to provide a very lightweight way to edit and execute code, great while learning the languages and giving demos. Blog Post: http://blog.benhall.me.uk/2008/07/announcing-ironeditor-editor-for.html Download: http://www.codeplex.com/IronEditor Build: 1.0.0.46 This is a release early with not too many advanced features but it can execute code! :) Over the next few weeks and months, I will be adding more features and implementing additional parts of the Hosting API. I will also try to blog about the actual implementation of IronEditor. Any feedback or feature suggestions you have on the application would be great! Thanks Ben Blog.BenHall.me.uk Microsoft MVP (C#) From kfarmer at thuban.org Mon Jul 21 18:44:11 2008 From: kfarmer at thuban.org (Keith J. Farmer) Date: Mon, 21 Jul 2008 09:44:11 -0700 Subject: [IronPython] IronPython Post 2.0 Roadmap In-Reply-To: References: <4875EF83.80805@voidspace.org.uk><487FCA5D.5090909@voidspace.org.uk><4880BC17.5020007@voidspace.org.uk><4817b6fc0807182254o7ea4dccu45d0294beaba1989@mail.gmail.com><8cd017b80807190056s3c8a955cu15c436f51c8a31ea@mail.gmail.com><5b0248170807191035m332c07d9j1aff9ba94abf8310@mail.gmail.com><4882265D.10804@voidspace.org.uk> Message-ID: You can create your own attribute classes, for whatever markup. Particularly since LINQ-to-*, where they often are used to annotate data classes with strings, etc (not references to types). In any event, why does "availability of a static type" enter into this? IP can access static types just as well as any other .NET language (System.Math comes to mind). The motivation in general is to make IP a better producer for CLR types, rather than just a consumer, and attributes are an increasingly important thing to support. As for expression trees and extension methods, those are to make IP a better consumer of a very important API (LINQ and the IQueryable stack from .NET 3.5). To be honest, once those 3 features are available in IP, I think it would be on par with the mainstream languages in being very usable in an exclusive sense. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Harry Pierson Sent: Sunday, July 20, 2008 11:14 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap Can you give me some examples where you would use these? The problem I see is that many scenarios (WCF contracts, XML serialization just to name two) where people want to use a custom attribute depends on the availability of a static type. Harry -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Keith J. Farmer Sent: Saturday, July 19, 2008 8:13 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap votes++ -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Saturday, July 19, 2008 10:38 AM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap Sanghyeon Seo wrote: > 2008/7/20 Harry Pierson : > >> Hosting features are all done via the DLR, so that's a separate team. As for >> "ability to interact with the rest of the .Net framework", can you be more >> specific about what you're looking for in that space? What *isn't* IPy doing >> that you want it to? >> > > .NET attributes? > > +1 :-) Michael -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ _______________________________________________ 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 Mon Jul 21 18:49:46 2008 From: kfarmer at thuban.org (Keith J. Farmer) Date: Mon, 21 Jul 2008 09:49:46 -0700 Subject: [IronPython] Announcing IronEditor - An Editor for IronRuby, IronPython and other DLR languages In-Reply-To: References: Message-ID: Neat! Someone should see about making a VSX adaptation layer for MonoDevelop, so WoW Studio, etc can be installed (or a layer for VSX, so you can plug in MonoDevelop addons). -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Ben Hall Sent: Sunday, July 20, 2008 3:06 AM To: Discussion of IronPython Subject: [IronPython] Announcing IronEditor - An Editor for IronRuby,IronPython and other DLR languages Hi everyone, Last night I uploaded an initial release of an application I've been working on - IronEditor. This is a simple application designed to make it easier to start coding against the DLR based languages, out of the box it supports IronPython and IronRuby. The reason why I decided to build this is because Visual Studio Integration for the languages is a long way off and playing around creating code to for the languages is painful via the provided console applications. As such, the aim of the application is to provide a very lightweight way to edit and execute code, great while learning the languages and giving demos. Blog Post: http://blog.benhall.me.uk/2008/07/announcing-ironeditor-editor-for.html Download: http://www.codeplex.com/IronEditor Build: 1.0.0.46 This is a release early with not too many advanced features but it can execute code! :) Over the next few weeks and months, I will be adding more features and implementing additional parts of the Hosting API. I will also try to blog about the actual implementation of IronEditor. Any feedback or feature suggestions you have on the application would be great! Thanks Ben Blog.BenHall.me.uk Microsoft MVP (C#) _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From 89iroc at gmail.com Mon Jul 21 19:10:11 2008 From: 89iroc at gmail.com (Michael Stephens) Date: Mon, 21 Jul 2008 11:10:11 -0600 Subject: [IronPython] VS Shell Addin for IronPython Studio Message-ID: I'm not sure if this is the right place to ask but I thought I would pose it here and if need be it can be redirected. I am trying to build an Addin for IronPython Studio. No matter what I try Iron Python Studio wont see my addin (despite them being turned on). I have setup a VM where I installed PythonStudio in standalone mode. I have constructed a folder in C:\Documents and Settings\michael\My Documents\IronPython Studio\Addins for my addins. I know the xml is being parsed in this directory because if I build invalid xml IronPython Studio throws an error. I have tried every combination of xml versions that I can think of. If anyone has any ideas I would love to hear them! I have attached the files below. Michael Stephens Electrical Engineering Graduate Student University of Wyoming falcon at uwyo.edu or 89iroc at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Addins.zip Type: application/zip Size: 13629 bytes Desc: not available URL: From petersonjm1 at gmail.com Mon Jul 21 19:21:10 2008 From: petersonjm1 at gmail.com (Joshua Peterson) Date: Mon, 21 Jul 2008 13:21:10 -0400 Subject: [IronPython] IronPython.Hosting.EngineOptions.ClrDebuggingEnabled in IronPython 2.0 Beta 3 In-Reply-To: <7AD436E4270DD54A94238001769C2227012C935BFDC1@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <2a03b9790807210658w10e3b6b5r439c13a00f210c49@mail.gmail.com> <7AD436E4270DD54A94238001769C2227012C935BFDC1@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <2a03b9790807211021m33a7eeb1l1a61671b275a7bd3@mail.gmail.com> Thanks for the information. It seems that the version of Microsoft.Scripting.ScriptRuntimeSetup which I am using does not have a DebugMode flag. The Microsoft.Scripting.dll assembly that I am referencing has a run time version of v2.0.50727. Is it possible that I need a newer version of the Microsoft.Scripting.dll assembly. Josh On Mon, Jul 21, 2008 at 12:12 PM, Dino Viehland < dinov at exchange.microsoft.com> wrote: > The ScriptRuntimeSetup class has a DebugMode flag that can be set. When > you do ScriptRuntime.Create you can pass it the ScriptRuntimeSetup object > that you created. > > > > FYI configuration is going through some reviews and changes so this will > soon be slightly different but you'll do the same basic stuff ? create some > setup object and then pass it off to the ScriptRuntime. > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Joshua Peterson > *Sent:* Monday, July 21, 2008 6:58 AM > *To:* users at lists.ironpython.com > *Subject:* [IronPython] > IronPython.Hosting.EngineOptions.ClrDebuggingEnabled in IronPython 2.0 Beta > 3 > > > > I'm working with a C# application that hosts IronPython 2.0 Beta 3. I > would like to be able to use the IronPython integration sample that ships > with the Visual Studio 2005 SDK to debug the python code running in my C# > application. > > If I host IronPython 1.1 in a C# application, I can set the > IronPython.Hosting.EngineOptions.ClrDebuggingEnabled flag to true as in the > example below. This allows me to step through the python code in test.py in > Visual Studio. Is there something similar to the ClrDebuggingEnabled in > IronPython 2.0? Thanks. > > Josh > > Program.cs: > > using System; > using System.Collections.Generic; > using System.Text; > using IronPython; > using IronPython.Hosting; > > namespace TestDebugEmbeddedIronPyton > { > class Program > { > static void Main(string[] args) > { > EngineOptions eo = new EngineOptions(); > eo.ClrDebuggingEnabled = true; > PythonEngine pe = new PythonEngine(eo); > pe.ExecuteFile(@"C:\test.py"); > } > } > } > > test.py: > > import System > import System.Diagnostics > print "Test 1" > System.Diagnostics.Debugger.Break() > print "Test 2" > > -- > Rejoice always. Pray without ceasing. In all circumstances give thanks, for > this is the will of God for you in Christ Jesus. -- 1 Thes. 5:16-18 NAB > -- > I am the living bread that came down from heaven; whoever eats this bread > will live forever; and the bread that I will give is my flesh for the life > of the world. -- John 6:51 NAB > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -- Rejoice always. Pray without ceasing. In all circumstances give thanks, for this is the will of God for you in Christ Jesus. -- 1 Thes. 5:16-18 NAB -- I am the living bread that came down from heaven; whoever eats this bread will live forever; and the bread that I will give is my flesh for the life of the world. -- John 6:51 NAB -------------- next part -------------- An HTML attachment was scrubbed... URL: From olegtk at microsoft.com Mon Jul 21 19:38:11 2008 From: olegtk at microsoft.com (Oleg Tkachenko) Date: Mon, 21 Jul 2008 10:38:11 -0700 Subject: [IronPython] VS Shell Addin for IronPython Studio In-Reply-To: References: Message-ID: By "standalone mode" do you mean IronPython Studio Isolated version? Basically I believe it should work. Visual Studio Shell in Isolated mode supports addins and packages just like Visual Studio itself. I'll take a look at it. -- Oleg From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Stephens Sent: Monday, July 21, 2008 10:10 AM To: Discussion of IronPython Subject: [IronPython] VS Shell Addin for IronPython Studio I'm not sure if this is the right place to ask but I thought I would pose it here and if need be it can be redirected. I am trying to build an Addin for IronPython Studio. No matter what I try Iron Python Studio wont see my addin (despite them being turned on). I have setup a VM where I installed PythonStudio in standalone mode. I have constructed a folder in C:\Documents and Settings\michael\My Documents\IronPython Studio\Addins for my addins. I know the xml is being parsed in this directory because if I build invalid xml IronPython Studio throws an error. I have tried every combination of xml versions that I can think of. If anyone has any ideas I would love to hear them! I have attached the files below. Michael Stephens Electrical Engineering Graduate Student University of Wyoming falcon at uwyo.edu or 89iroc at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From curt at hagenlocher.org Mon Jul 21 19:37:27 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Mon, 21 Jul 2008 10:37:27 -0700 Subject: [IronPython] IronPython.Hosting.EngineOptions.ClrDebuggingEnabled in IronPython 2.0 Beta 3 In-Reply-To: <2a03b9790807211021m33a7eeb1l1a61671b275a7bd3@mail.gmail.com> References: <2a03b9790807210658w10e3b6b5r439c13a00f210c49@mail.gmail.com> <7AD436E4270DD54A94238001769C2227012C935BFDC1@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <2a03b9790807211021m33a7eeb1l1a61671b275a7bd3@mail.gmail.com> Message-ID: This change was made after the release of Beta 3. You can download a more recent version of the source from http://www.codeplex.com/IronPython/SourceControl/ListDownloadableCommits.aspx I think in Beta 3 you could access the debug flag through ScriptRuntime.GlobalOptions.DebugMode, but this has already been removed in the latest sources. On Mon, Jul 21, 2008 at 10:21 AM, Joshua Peterson wrote: > Thanks for the information. It seems that the version of > Microsoft.Scripting.ScriptRuntimeSetup which I am using does not have a > DebugMode flag. The Microsoft.Scripting.dll assembly that I am referencing > has a run time version of v2.0.50727. Is it possible that I need a newer > version of the Microsoft.Scripting.dll assembly. > > Josh > > On Mon, Jul 21, 2008 at 12:12 PM, Dino Viehland < > dinov at exchange.microsoft.com> wrote: > >> The ScriptRuntimeSetup class has a DebugMode flag that can be set. When >> you do ScriptRuntime.Create you can pass it the ScriptRuntimeSetup object >> that you created. >> >> >> >> FYI configuration is going through some reviews and changes so this will >> soon be slightly different but you'll do the same basic stuff ? create some >> setup object and then pass it off to the ScriptRuntime. >> >> >> >> *From:* users-bounces at lists.ironpython.com [mailto: >> users-bounces at lists.ironpython.com] *On Behalf Of *Joshua Peterson >> *Sent:* Monday, July 21, 2008 6:58 AM >> *To:* users at lists.ironpython.com >> *Subject:* [IronPython] >> IronPython.Hosting.EngineOptions.ClrDebuggingEnabled in IronPython 2.0 Beta >> 3 >> >> >> >> I'm working with a C# application that hosts IronPython 2.0 Beta 3. I >> would like to be able to use the IronPython integration sample that ships >> with the Visual Studio 2005 SDK to debug the python code running in my C# >> application. >> >> If I host IronPython 1.1 in a C# application, I can set the >> IronPython.Hosting.EngineOptions.ClrDebuggingEnabled flag to true as in the >> example below. This allows me to step through the python code in test.py in >> Visual Studio. Is there something similar to the ClrDebuggingEnabled in >> IronPython 2.0? Thanks. >> >> Josh >> >> Program.cs: >> >> using System; >> using System.Collections.Generic; >> using System.Text; >> using IronPython; >> using IronPython.Hosting; >> >> namespace TestDebugEmbeddedIronPyton >> { >> class Program >> { >> static void Main(string[] args) >> { >> EngineOptions eo = new EngineOptions(); >> eo.ClrDebuggingEnabled = true; >> PythonEngine pe = new PythonEngine(eo); >> pe.ExecuteFile(@"C:\test.py"); >> } >> } >> } >> >> test.py: >> >> import System >> import System.Diagnostics >> print "Test 1" >> System.Diagnostics.Debugger.Break() >> print "Test 2" >> >> -- >> Rejoice always. Pray without ceasing. In all circumstances give thanks, >> for this is the will of God for you in Christ Jesus. -- 1 Thes. 5:16-18 NAB >> -- >> I am the living bread that came down from heaven; whoever eats this bread >> will live forever; and the bread that I will give is my flesh for the life >> of the world. -- John 6:51 NAB >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> > > > -- > Rejoice always. Pray without ceasing. In all circumstances give thanks, for > this is the will of God for you in Christ Jesus. -- 1 Thes. 5:16-18 NAB > -- > I am the living bread that came down from heaven; whoever eats this bread > will live forever; and the bread that I will give is my flesh for the life > of the world. -- John 6:51 NAB > > _______________________________________________ > 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 curt at hagenlocher.org Mon Jul 21 18:51:17 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Mon, 21 Jul 2008 09:51:17 -0700 Subject: [IronPython] IronPython Post 2.0 Roadmap In-Reply-To: References: <4875EF83.80805@voidspace.org.uk> <4880BC17.5020007@voidspace.org.uk> <4817b6fc0807182254o7ea4dccu45d0294beaba1989@mail.gmail.com> <8cd017b80807190056s3c8a955cu15c436f51c8a31ea@mail.gmail.com> <5b0248170807191035m332c07d9j1aff9ba94abf8310@mail.gmail.com> <4882265D.10804@voidspace.org.uk> Message-ID: "Availability of a static type" not because IronPython would need to access one but because it would need to expose one. On Mon, Jul 21, 2008 at 9:44 AM, Keith J. Farmer wrote: > You can create your own attribute classes, for whatever markup. > Particularly since LINQ-to-*, where they often are used to annotate data > classes with strings, etc (not references to types). > > In any event, why does "availability of a static type" enter into this? IP > can access static types just as well as any other .NET language (System.Math > comes to mind). The motivation in general is to make IP a better producer > for CLR types, rather than just a consumer, and attributes are an > increasingly important thing to support. > > As for expression trees and extension methods, those are to make IP a > better consumer of a very important API (LINQ and the IQueryable stack from > .NET 3.5). > > To be honest, once those 3 features are available in IP, I think it would > be on par with the mainstream languages in being very usable in an exclusive > sense. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] On Behalf Of Harry Pierson > Sent: Sunday, July 20, 2008 11:14 PM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython Post 2.0 Roadmap > > Can you give me some examples where you would use these? The problem I see > is that many scenarios (WCF contracts, XML serialization just to name two) > where people want to use a custom attribute depends on the availability of a > static type. > > Harry > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] On Behalf Of Keith J. Farmer > Sent: Saturday, July 19, 2008 8:13 PM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython Post 2.0 Roadmap > > votes++ > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Saturday, July 19, 2008 10:38 AM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython Post 2.0 Roadmap > > Sanghyeon Seo wrote: > > 2008/7/20 Harry Pierson : > > > >> Hosting features are all done via the DLR, so that's a separate team. As > for > >> "ability to interact with the rest of the .Net framework", can you be > more > >> specific about what you're looking for in that space? What *isn't* IPy > doing > >> that you want it to? > >> > > > > .NET attributes? > > > > > +1 :-) > > Michael > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 stefan.dobrev at gmail.com Mon Jul 21 20:09:58 2008 From: stefan.dobrev at gmail.com (Stefan Dobrev) Date: Mon, 21 Jul 2008 21:09:58 +0300 Subject: [IronPython] Announcing IronEditor - An Editor for IronRuby, IronPython and other DLR languages In-Reply-To: References: Message-ID: <928de89c0807211109o20db5955l7db817d47eb3848e@mail.gmail.com> I have looked at the code. Some neat stuff. However my idea is that we can leverage as much as we can from the DLR platform itself. For example we can create our own editor and use the code sense and token infrastructure for intellisense and syntax highlighting. I have a working version of that implemented in WPF using its RichTextBox. Unfortunately the RichTextBox DOM (FlowDocument) is too heavy for code editor and runs poorly. We need a lightweight version of RichTextBox for code editor - our custom control. It should also run on Silverlight as well. Expression Blend and PowerShell v2 have implemented similar controls in WPF for their code editing (Blend - XAML; PowerShell - cmdlet/script editing). So it can be done. Then we can build a lightweight IDE (like TextMate) for both Silverlight and WPF with a transperant project model that works both on web and locally. All this seems to be a perfect project for showcasing DLR API - architecture and services as well as Silverlight / WPF. Comments? Regards, Stefan 2008/7/20 Ben Hall : > Hi everyone, > > Last night I uploaded an initial release of an application I've been > working on - IronEditor. This is a simple application designed to make > it easier to start coding against the DLR based languages, out of the > box it supports IronPython and IronRuby. > > The reason why I decided to build this is because Visual Studio > Integration for the languages is a long way off and playing around > creating code to for the languages is painful via the provided console > applications. As such, the aim of the application is to provide a very > lightweight way to edit and execute code, great while learning the > languages and giving demos. > > Blog Post: > http://blog.benhall.me.uk/2008/07/announcing-ironeditor-editor-for.html > > Download: http://www.codeplex.com/IronEditor > Build: 1.0.0.46 > > This is a release early with not too many advanced features but it can > execute code! :) Over the next few weeks and months, I will be adding > more features and implementing additional parts of the Hosting API. I > will also try to blog about the actual implementation of IronEditor. > > Any feedback or feature suggestions you have on the application would be > great! > > Thanks > > Ben > Blog.BenHall.me.uk > Microsoft MVP (C#) > _______________________________________________ > 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 curt at hagenlocher.org Mon Jul 21 18:38:36 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Mon, 21 Jul 2008 09:38:36 -0700 Subject: [IronPython] 1.1.2 RC1, some small probolems In-Reply-To: References: Message-ID: On Sun, Jul 20, 2008 at 6:18 PM, HEMMI, Shigeru wrote: > > 3. If I build the sources with mono, some warings generated. One of them is > IronPython/Modules/datetime.cs(770,17): warning CS1717: Assignment > made to same variable; did you mean to assign something else? > and the corresponding line is > dt = dt = dt.ToUniversalTime(); > Is this a valid coding? There's an extra "dt =" here; it should read just "dt = dt.ToUniversalTime()". Thanks for bringing this to our attention. It doesn't change the correct functioning of the code, but it should definitely be cleaned up. I'll take care of it for the next beta of 2.0, but don't see any reason that it needs to be changed for 1.1.2 given that the same line exists in 1.1.1. -- Curt Hagenlocher curt at hagenlocher.org From olegtk at microsoft.com Mon Jul 21 20:19:32 2008 From: olegtk at microsoft.com (Oleg Tkachenko) Date: Mon, 21 Jul 2008 11:19:32 -0700 Subject: [IronPython] VS Shell Addin for IronPython Studio In-Reply-To: References: Message-ID: Can you explain what your addin does? I'm also interested in more use cases for extending IronPython Studio. -- Oleg From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Stephens Sent: Monday, July 21, 2008 10:10 AM To: Discussion of IronPython Subject: [IronPython] VS Shell Addin for IronPython Studio I'm not sure if this is the right place to ask but I thought I would pose it here and if need be it can be redirected. I am trying to build an Addin for IronPython Studio. No matter what I try Iron Python Studio wont see my addin (despite them being turned on). I have setup a VM where I installed PythonStudio in standalone mode. I have constructed a folder in C:\Documents and Settings\michael\My Documents\IronPython Studio\Addins for my addins. I know the xml is being parsed in this directory because if I build invalid xml IronPython Studio throws an error. I have tried every combination of xml versions that I can think of. If anyone has any ideas I would love to hear them! I have attached the files below. Michael Stephens Electrical Engineering Graduate Student University of Wyoming falcon at uwyo.edu or 89iroc at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From petersonjm1 at gmail.com Mon Jul 21 20:29:36 2008 From: petersonjm1 at gmail.com (Joshua Peterson) Date: Mon, 21 Jul 2008 14:29:36 -0400 Subject: [IronPython] IronPython.Hosting.EngineOptions.ClrDebuggingEnabled in IronPython 2.0 Beta 3 In-Reply-To: References: <2a03b9790807210658w10e3b6b5r439c13a00f210c49@mail.gmail.com> <7AD436E4270DD54A94238001769C2227012C935BFDC1@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <2a03b9790807211021m33a7eeb1l1a61671b275a7bd3@mail.gmail.com> Message-ID: <2a03b9790807211129v34a1c02fm4dfadab256e1d0a@mail.gmail.com> Thanks. The ScriptRuntime.GlobalOptions.DebugMode flag works for the Beta 3 version. I'll look for the other method in the most recent version. I appreciate the help! Josh On Mon, Jul 21, 2008 at 1:37 PM, Curt Hagenlocher wrote: > This change was made after the release of Beta 3. You can download a more > recent version of the source from > > http://www.codeplex.com/IronPython/SourceControl/ListDownloadableCommits.aspx > > I think in Beta 3 you could access the debug flag through > ScriptRuntime.GlobalOptions.DebugMode, but this has already been removed in > the latest sources. > On Mon, Jul 21, 2008 at 10:21 AM, Joshua Peterson > wrote: > >> Thanks for the information. It seems that the version of >> Microsoft.Scripting.ScriptRuntimeSetup which I am using does not have a >> DebugMode flag. The Microsoft.Scripting.dll assembly that I am referencing >> has a run time version of v2.0.50727. Is it possible that I need a newer >> version of the Microsoft.Scripting.dll assembly. >> >> Josh >> >> On Mon, Jul 21, 2008 at 12:12 PM, Dino Viehland < >> dinov at exchange.microsoft.com> wrote: >> >>> The ScriptRuntimeSetup class has a DebugMode flag that can be set. >>> When you do ScriptRuntime.Create you can pass it the ScriptRuntimeSetup >>> object that you created. >>> >>> >>> >>> FYI configuration is going through some reviews and changes so this will >>> soon be slightly different but you'll do the same basic stuff ? create some >>> setup object and then pass it off to the ScriptRuntime. >>> >>> >>> >>> *From:* users-bounces at lists.ironpython.com [mailto: >>> users-bounces at lists.ironpython.com] *On Behalf Of *Joshua Peterson >>> *Sent:* Monday, July 21, 2008 6:58 AM >>> *To:* users at lists.ironpython.com >>> *Subject:* [IronPython] >>> IronPython.Hosting.EngineOptions.ClrDebuggingEnabled in IronPython 2.0 Beta >>> 3 >>> >>> >>> >>> I'm working with a C# application that hosts IronPython 2.0 Beta 3. I >>> would like to be able to use the IronPython integration sample that ships >>> with the Visual Studio 2005 SDK to debug the python code running in my C# >>> application. >>> >>> If I host IronPython 1.1 in a C# application, I can set the >>> IronPython.Hosting.EngineOptions.ClrDebuggingEnabled flag to true as in the >>> example below. This allows me to step through the python code in test.py in >>> Visual Studio. Is there something similar to the ClrDebuggingEnabled in >>> IronPython 2.0? Thanks. >>> >>> Josh >>> >>> Program.cs: >>> >>> using System; >>> using System.Collections.Generic; >>> using System.Text; >>> using IronPython; >>> using IronPython.Hosting; >>> >>> namespace TestDebugEmbeddedIronPyton >>> { >>> class Program >>> { >>> static void Main(string[] args) >>> { >>> EngineOptions eo = new EngineOptions(); >>> eo.ClrDebuggingEnabled = true; >>> PythonEngine pe = new PythonEngine(eo); >>> pe.ExecuteFile(@"C:\test.py"); >>> } >>> } >>> } >>> >>> test.py: >>> >>> import System >>> import System.Diagnostics >>> print "Test 1" >>> System.Diagnostics.Debugger.Break() >>> print "Test 2" >>> >>> -- >>> Rejoice always. Pray without ceasing. In all circumstances give thanks, >>> for this is the will of God for you in Christ Jesus. -- 1 Thes. 5:16-18 NAB >>> -- >>> I am the living bread that came down from heaven; whoever eats this bread >>> will live forever; and the bread that I will give is my flesh for the life >>> of the world. -- John 6:51 NAB >>> >>> _______________________________________________ >>> Users mailing list >>> Users at lists.ironpython.com >>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>> >>> >> >> >> -- >> Rejoice always. Pray without ceasing. In all circumstances give thanks, >> for this is the will of God for you in Christ Jesus. -- 1 Thes. 5:16-18 NAB >> -- >> I am the living bread that came down from heaven; whoever eats this bread >> will live forever; and the bread that I will give is my flesh for the life >> of the world. -- John 6:51 NAB >> >> _______________________________________________ >> 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 > > -- Rejoice always. Pray without ceasing. In all circumstances give thanks, for this is the will of God for you in Christ Jesus. -- 1 Thes. 5:16-18 NAB -- I am the living bread that came down from heaven; whoever eats this bread will live forever; and the bread that I will give is my flesh for the life of the world. -- John 6:51 NAB -------------- next part -------------- An HTML attachment was scrubbed... URL: From miarme at microsoft.com Mon Jul 21 21:28:03 2008 From: miarme at microsoft.com (Michael Armes) Date: Mon, 21 Jul 2008 12:28:03 -0700 Subject: [IronPython] Calling a Win32 API function in IronPython Message-ID: <070B17B168154D46B9743BDA2B5BEEDF0FAF07993C@NA-EXMSG-C123.redmond.corp.microsoft.com> How does one go about invoking a function in the Win32 API in Iron Python? Is there any P/Invoke functionality? FWIW, I want to get to GenerateConsoleCtrlEvent in kernel32.dll. The thread at http://lists.ironpython.com/pipermail/users-ironpython.com/2006-April/002211.html indicated that there was a WorkItem to add this functionality in 2006. Thanks, Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: From kfarmer at thuban.org Mon Jul 21 21:40:51 2008 From: kfarmer at thuban.org (Keith J. Farmer) Date: Mon, 21 Jul 2008 12:40:51 -0700 Subject: [IronPython] IronPython Post 2.0 Roadmap References: <4875EF83.80805@voidspace.org.uk><4880BC17.5020007@voidspace.org.uk><4817b6fc0807182254o7ea4dccu45d0294beaba1989@mail.gmail.com><8cd017b80807190056s3c8a955cu15c436f51c8a31ea@mail.gmail.com><5b0248170807191035m332c07d9j1aff9ba94abf8310@mail.gmail.com><4882265D.10804@voidspace.org.uk> Message-ID: Attributes can be applied to more than just types -- members, parameters, return values (as I recall), etc. ________________________________ From: users-bounces at lists.ironpython.com on behalf of Curt Hagenlocher Sent: Mon 7/21/2008 9:51 AM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap "Availability of a static type" not because IronPython would need to access one but because it would need to expose one. On Mon, Jul 21, 2008 at 9:44 AM, Keith J. Farmer wrote: You can create your own attribute classes, for whatever markup. Particularly since LINQ-to-*, where they often are used to annotate data classes with strings, etc (not references to types). In any event, why does "availability of a static type" enter into this? IP can access static types just as well as any other .NET language (System.Math comes to mind). The motivation in general is to make IP a better producer for CLR types, rather than just a consumer, and attributes are an increasingly important thing to support. As for expression trees and extension methods, those are to make IP a better consumer of a very important API (LINQ and the IQueryable stack from .NET 3.5). To be honest, once those 3 features are available in IP, I think it would be on par with the mainstream languages in being very usable in an exclusive sense. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Harry Pierson Sent: Sunday, July 20, 2008 11:14 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap Can you give me some examples where you would use these? The problem I see is that many scenarios (WCF contracts, XML serialization just to name two) where people want to use a custom attribute depends on the availability of a static type. Harry -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Keith J. Farmer Sent: Saturday, July 19, 2008 8:13 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap votes++ -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Saturday, July 19, 2008 10:38 AM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap Sanghyeon Seo wrote: > 2008/7/20 Harry Pierson : > >> Hosting features are all done via the DLR, so that's a separate team. As for >> "ability to interact with the rest of the .Net framework", can you be more >> specific about what you're looking for in that space? What *isn't* IPy doing >> that you want it to? >> > > .NET attributes? > > +1 :-) Michael -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ _______________________________________________ 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 fuzzyman at voidspace.org.uk Mon Jul 21 21:47:44 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 21 Jul 2008 20:47:44 +0100 Subject: [IronPython] IronPython Post 2.0 Roadmap In-Reply-To: References: <4875EF83.80805@voidspace.org.uk><4880BC17.5020007@voidspace.org.uk><4817b6fc0807182254o7ea4dccu45d0294beaba1989@mail.gmail.com><8cd017b80807190056s3c8a955cu15c436f51c8a31ea@mail.gmail.com><5b0248170807191035m332c07d9j1aff9ba94abf8310@mail.gmail.com><4882265D.10804@voidspace.org.uk> Message-ID: <4884E7E0.80200@voidspace.org.uk> Keith J. Farmer wrote: > Attributes can be applied to more than just types -- members, > parameters, return values (as I recall), etc. But those all presuppose a static type - right? IronPython could generate a static class in the compile phase where .NET attributes are used. Python decorator syntax could be used - class decorators are now part of Python 2.6 and no-one would object to you sneaking them into Python 2.5... Parameter and return type attributes could still use a method decorator to apply them. Michael > > ------------------------------------------------------------------------ > *From:* users-bounces at lists.ironpython.com on behalf of Curt Hagenlocher > *Sent:* Mon 7/21/2008 9:51 AM > *To:* Discussion of IronPython > *Subject:* Re: [IronPython] IronPython Post 2.0 Roadmap > > "Availability of a static type" not because IronPython would need to > access one but because it would need to expose one. > > > On Mon, Jul 21, 2008 at 9:44 AM, Keith J. Farmer > wrote: > > You can create your own attribute classes, for whatever markup. > Particularly since LINQ-to-*, where they often are used to > annotate data classes with strings, etc (not references to types). > > In any event, why does "availability of a static type" enter into > this? IP can access static types just as well as any other .NET > language (System.Math comes to mind). The motivation in general > is to make IP a better producer for CLR types, rather than just a > consumer, and attributes are an increasingly important thing to > support. > > As for expression trees and extension methods, those are to make > IP a better consumer of a very important API (LINQ and the > IQueryable stack from .NET 3.5). > > To be honest, once those 3 features are available in IP, I think > it would be on par with the mainstream languages in being very > usable in an exclusive sense. > > -----Original Message----- > From: users-bounces at lists.ironpython.com > > [mailto:users-bounces at lists.ironpython.com > ] On Behalf Of Harry > Pierson > Sent: Sunday, July 20, 2008 11:14 PM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython Post 2.0 Roadmap > > Can you give me some examples where you would use these? The > problem I see is that many scenarios (WCF contracts, XML > serialization just to name two) where people want to use a custom > attribute depends on the availability of a static type. > > Harry > > -----Original Message----- > From: users-bounces at lists.ironpython.com > > [mailto:users-bounces at lists.ironpython.com > ] On Behalf Of Keith J. > Farmer > Sent: Saturday, July 19, 2008 8:13 PM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython Post 2.0 Roadmap > > votes++ > > -----Original Message----- > From: users-bounces at lists.ironpython.com > > [mailto:users-bounces at lists.ironpython.com > ] On Behalf Of Michael > Foord > Sent: Saturday, July 19, 2008 10:38 AM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython Post 2.0 Roadmap > > Sanghyeon Seo wrote: > > 2008/7/20 Harry Pierson >: > > > >> Hosting features are all done via the DLR, so that's a separate > team. As for > >> "ability to interact with the rest of the .Net framework", can > you be more > >> specific about what you're looking for in that space? What > *isn't* IPy doing > >> that you want it to? > >> > > > > .NET attributes? > > > > > +1 :-) > > Michael > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From David.Lawler at franke.com Mon Jul 21 21:51:55 2008 From: David.Lawler at franke.com (David.Lawler at franke.com) Date: Mon, 21 Jul 2008 15:51:55 -0400 Subject: [IronPython] Announcing IronEditor - An Editor for IronRuby, IronPython and other DLR languages In-Reply-To: Message-ID: This looks interesting. However I blew up the program the moment I tried it. I think the problem is that you use a relative path to open your syntax files but when you go to File Open the source file, the current directory gets changed to where ever, and then the program blows up at line 24 or 25 in CodeEditorIDETextBox.cs because it can no longer find the syntax files directory. BTW you can compile the project fine with the C# Express IDE and also with Sharpdevelop 3. Good luck with this! David -------------- next part -------------- An HTML attachment was scrubbed... URL: From Harry.Pierson at microsoft.com Mon Jul 21 21:59:47 2008 From: Harry.Pierson at microsoft.com (Harry Pierson) Date: Mon, 21 Jul 2008 12:59:47 -0700 Subject: [IronPython] IronPython Post 2.0 Roadmap In-Reply-To: <4884E7E0.80200@voidspace.org.uk> References: <4875EF83.80805@voidspace.org.uk><4880BC17.5020007@voidspace.org.uk><4817b6fc0807182254o7ea4dccu45d0294beaba1989@mail.gmail.com><8cd017b80807190056s3c8a955cu15c436f51c8a31ea@mail.gmail.com><5b0248170807191035m332c07d9j1aff9ba94abf8310@mail.gmail.com><4882265D.10804@voidspace.org.uk> <4884E7E0.80200@voidspace.org.uk> Message-ID: All of the many overloads of GetCustomAttributes (http://msdn.microsoft.com/en-us/library/system.attribute.getcustomattributes(VS.85).aspx) need some type of static type info (Type, MemberInfo, ParameterInfo). So supporting custom attributes would require some type of static class as Michael mentions below. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Monday, July 21, 2008 12:48 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap Keith J. Farmer wrote: > Attributes can be applied to more than just types -- members, > parameters, return values (as I recall), etc. But those all presuppose a static type - right? IronPython could generate a static class in the compile phase where .NET attributes are used. Python decorator syntax could be used - class decorators are now part of Python 2.6 and no-one would object to you sneaking them into Python 2.5... Parameter and return type attributes could still use a method decorator to apply them. Michael > > ------------------------------------------------------------------------ > *From:* users-bounces at lists.ironpython.com on behalf of Curt Hagenlocher > *Sent:* Mon 7/21/2008 9:51 AM > *To:* Discussion of IronPython > *Subject:* Re: [IronPython] IronPython Post 2.0 Roadmap > > "Availability of a static type" not because IronPython would need to > access one but because it would need to expose one. > > > On Mon, Jul 21, 2008 at 9:44 AM, Keith J. Farmer > wrote: > > You can create your own attribute classes, for whatever markup. > Particularly since LINQ-to-*, where they often are used to > annotate data classes with strings, etc (not references to types). > > In any event, why does "availability of a static type" enter into > this? IP can access static types just as well as any other .NET > language (System.Math comes to mind). The motivation in general > is to make IP a better producer for CLR types, rather than just a > consumer, and attributes are an increasingly important thing to > support. > > As for expression trees and extension methods, those are to make > IP a better consumer of a very important API (LINQ and the > IQueryable stack from .NET 3.5). > > To be honest, once those 3 features are available in IP, I think > it would be on par with the mainstream languages in being very > usable in an exclusive sense. > > -----Original Message----- > From: users-bounces at lists.ironpython.com > > [mailto:users-bounces at lists.ironpython.com > ] On Behalf Of Harry > Pierson > Sent: Sunday, July 20, 2008 11:14 PM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython Post 2.0 Roadmap > > Can you give me some examples where you would use these? The > problem I see is that many scenarios (WCF contracts, XML > serialization just to name two) where people want to use a custom > attribute depends on the availability of a static type. > > Harry > > -----Original Message----- > From: users-bounces at lists.ironpython.com > > [mailto:users-bounces at lists.ironpython.com > ] On Behalf Of Keith J. > Farmer > Sent: Saturday, July 19, 2008 8:13 PM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython Post 2.0 Roadmap > > votes++ > > -----Original Message----- > From: users-bounces at lists.ironpython.com > > [mailto:users-bounces at lists.ironpython.com > ] On Behalf Of Michael > Foord > Sent: Saturday, July 19, 2008 10:38 AM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython Post 2.0 Roadmap > > Sanghyeon Seo wrote: > > 2008/7/20 Harry Pierson >: > > > >> Hosting features are all done via the DLR, so that's a separate > team. As for > >> "ability to interact with the rest of the .Net framework", can > you be more > >> specific about what you're looking for in that space? What > *isn't* IPy doing > >> that you want it to? > >> > > > > .NET attributes? > > > > > +1 :-) > > Michael > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From fuzzyman at voidspace.org.uk Mon Jul 21 23:00:35 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 21 Jul 2008 22:00:35 +0100 Subject: [IronPython] Python in the Browser updates In-Reply-To: References: <4856F194.7040004@voidspace.org.uk> <485831ED.2050304@voidspace.org.uk> <5283CA0A4168DF4FBBD71AE9ECA5A32845CC6216BA@NA-EXMSG-C116.redmond.corp.microsoft.com> <4858DCF3.1000302@voidspace.org.uk> <5283CA0A4168DF4FBBD71AE9ECA5A32845D45E2CC9@NA-EXMSG-C116.redmond.corp.microsoft.com> <48832726.3040704@voidspace.org.uk> Message-ID: <4884F8F3.6070000@voidspace.org.uk> Another alternative is for me to work with Dan Eloff, the author of this project which is pure Python and *very* slick... http://code.google.com/p/silvershell/ Michael Jimmy Schementi wrote: > On Jul 20, 2008, at 7:53 AM, "Michael Foord" > wrote: > > >> Jimmy Schementi wrote: >> >>> Michael Foord wrote: >>> >>> >>>> Jimmy Schementi wrote: >>>> >>>> >>>>> Michael, question for you: >>>>> >>>>> >>>>> >>>>> >>>>>> On every keypress Javascript calls into IronPython (via the C#!). >>>>>> >>>>>> >>>>>> >>>>> How come you used C# to handle the onkeypress event? This should do >>>>> >>>>> >>>> it in Python: >>>> >>>> >>>> Did you look at the code to see why? I'd be really interested to >>>> know >>>> if >>>> I can do what I'm doing from Python inside Silverlight, but I >>>> doubt it. >>>> There's not much code in total, so it should be easy to follow. >>>> >>>> >>> Yep, I looked at it, and I'm pretty sure you can do everything from >>> python. All the native Javascript functions are callable from >>> python, or any .NET language, especially with >>> HtmlPage.window.eval(), so there shouldn't be any limitation. >>> >>> >>> >>>> I actually handle the onkeypress event from Javascript >>>> (onkeypress.js). >>>> This calls into 'getSelection' (cursor_pos.js) to work out the >>>> current >>>> selection in the textarea. Naturally this is easy to do in Firefox / >>>> Safari and scarily awful in IE. :-) >>>> >>>> >>> Attaching the event is simple: >>> >>> from System.Windows.Browser.HtmlPage import Document >>> from System.Windows.Input import KeyEventHandler >>> >>> Document.myTextAreaID.AttachEvent("onkeypress", >>> KeyEventHander(onKeyPress)) >>> >>> def onKeyPress(sender, eventArgs): >>> # Do something with eventArgs.CharacterCode >>> pass >>> >>> For converting the javascript to python, there are some special >>> javascript variables that are in different places, like "window" is >>> HtmlPage.Window, etc. >>> >>> >>> >> I've used the event attaching stuff before, but some of the Javascript >> is quite fiddly so I wasn't sure there was much benefit in moving it >> into Python. >> >> My next version will probably be based on the Javascript UI of Try >> Ruby >> by Why the Luck Stiff (he has given me permission to use his JS): >> >> http://tryruby.hobix.com/ >> >> Michael >> > > Well, I have a console ui in ruby at silverline.schementi.com/tryruby, > so if you change your mind feel free to use that. It's not perfect > yet, but I'm working on it. > > >>>> Having worked these out (and shortcut a few specific scenarios - >>>> like >>>> ctrl-A, ctrl-Z and ctrl-C), the Javascript then calls into >>>> IronPython >>>> with the selection start, selection end, and the character that was >>>> pressed. I use C# to expose a scriptable type that Javascript can >>>> call. >>>> >>>> >>> If you hooked all the events with Python, you wouldn't need to call >>> back into it from Javascript. This is why I prefer doing everything >>> with Python, so I avoid having a C# shim. >>> >>> >>> >>>> I use attaching events from Python to provide the sample code. There >>>> are >>>> three links above the console and Python handles the 'onclick' >>>> event to >>>> swap the examples around. >>>> >>>> >>> Basically, if there is something pretty basic you can't do in >>> Python that you can do from browser Javascript, it's a bug! =) >>> >>> >>> >>>> Michael Foord >>>> >>>> >>>> >>>>> >>>>>
>>>>> >>>>> from System import EventHandler >>>>> from System.Windows.Browser import Htmlpage, HtmlEventArgs >>>>> >>>>> document = System.Windows.Browser.HtmlPage.Document >>>>> def onkeypress(s, e): >>>>> document.result.innerHTML += "KeyPress
" >>>>> document.code.AttachEvent("onkeypress", >>>>> >>>>> >>>> EventHandler[HtmlEventArgs](onkeypress)) >>>> >>>> >>>>> Anyway, just wondering if anything was blocking you from hooking >>>>> HTML >>>>> >>>>> >>>> events with Python. >>>> >>>> >>>>> ~js >>>>> >>>>> >>>>> >>>>> >>>>>> -----Original Message----- >>>>>> From: users-bounces at lists.ironpython.com [mailto:users- >>>>>> bounces at lists.ironpython.com] On Behalf Of Michael Foord >>>>>> Sent: Tuesday, June 17, 2008 2:52 PM >>>>>> To: Discussion of IronPython >>>>>> Subject: Re: [IronPython] Python in the Browser updates >>>>>> >>>>>> Hello all, >>>>>> >>>>>> Sorry for the noise - but tomorrow I hope to package this for a >>>>>> >>>>>> >>>> release >>>> >>>> >>>>>> and if any of you get the chance to give me any feedback before >>>>>> >>>>>> >>>> then. >>>> >>>> >>>>>> http://www.voidspace.org.uk/ironpython/silverlight- >>>>>> >>>>>> >>>> console/console.html >>>> >>>> >>>>>> I think I have fixed all the basic usability issues (it is no >>>>>> longer >>>>>> possible to screw up the console so that it refuses further input >>>>>> >>>>>> >>>> for >>>> >>>> >>>>>> example). To *really* fix input I ought to move execution into its >>>>>> >>>>>> >>>> own >>>> >>>> >>>>>> thread so that we can interrupt infinite loops [1] - but that is a >>>>>> bigger change so I am resisting it for the moment. >>>>>> >>>>>> The big change is that I have added some simple code snippets - as >>>>>> >>>>>> >>>> an >>>> >>>> >>>>>> example of how it could be used in tutorials or for teaching >>>>>> Python. >>>>>> >>>>>> It is also easy to customize - the source code (200 lines of >>>>>> Python, >>>>>> >>>>>> >>>> 70 >>>> >>>> >>>>>> lines of Javascript, 25 lines of C#) shows how to prepopulate the >>>>>> execution context and show the first few lines of code in the >>>>>> interpreter. >>>>>> >>>>>> You can get the sourcecode from the repository of course: >>>>>> >>>>>> http://code.google.com/p/pythoninthebrowser/ >>>>>> >>>>>> All the best, >>>>>> >>>>>> Michael Foord >>>>>> >>>>>> [1] and then decide whether on windows a ctrl-c should send a >>>>>> >>>>>> >>>> keyboard >>>> >>>> >>>>>> interrupt or copy to the clipboard... >>>>>> >>>>>> Michael Foord wrote: >>>>>> >>>>>> >>>>>> >>>>>>> For those who are interested, I've updated "Python in the >>>>>>> Browser". >>>>>>> >>>>>>> Both the repository: >>>>>>> >>>>>>> http://code.google.com/p/pythoninthebrowser/ >>>>>>> >>>>>>> And the online demo: >>>>>>> >>>>>>> http://www.voidspace.org.uk/ironpython/silverlight- >>>>>>> >>>>>>> >>>>>>> >>>>>> console/console.html >>>>>> >>>>>> >>>>>> >>>>>>> There are a few minor but nice improvements: >>>>>>> >>>>>>> * The Javascript now works with IE 7! >>>>>>> * The textarea scrolls as input is printed >>>>>>> * The context window is disabled to prevent you pasting over the >>>>>>> >>>>>>> >>>>>>> >>>>>> input >>>>>> >>>>>> >>>>>> >>>>>>> area - not sure if this is really an improvement though... >>>>>>> * The input area is cleared on load - to stop browsers like >>>>>>> Firefox >>>>>>> and Safari repopulating the textarea for us on browser refresh >>>>>>> * Recursion limit is set >>>>>>> >>>>>>> I think it is basically in a useful state now... I might push >>>>>>> out a >>>>>>> '0.1' release from the current SVN head. >>>>>>> >>>>>>> All the best, >>>>>>> >>>>>>> Michael Foord >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>> -- >>>>>> http://www.ironpythoninaction.com/ >>>>>> http://www.theotherdelia.co.uk/ >>>>>> http://www.voidspace.org.uk/ >>>>>> http://www.ironpython.info/ >>>>>> http://www.resolverhacks.net/ >>>>>> >>>>>> _______________________________________________ >>>>>> 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 >>> >>> >> -- >> http://www.ironpythoninaction.com/ >> http://www.voidspace.org.uk/ >> http://www.trypython.org/ >> http://www.ironpython.info/ >> http://www.theotherdelia.co.uk/ >> http://www.resolverhacks.net/ >> >> _______________________________________________ >> 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From ben2004uk at googlemail.com Tue Jul 22 01:09:15 2008 From: ben2004uk at googlemail.com (Ben Hall) Date: Tue, 22 Jul 2008 00:09:15 +0100 Subject: [IronPython] Announcing IronEditor - An Editor for IronRuby, IronPython and other DLR languages In-Reply-To: References: Message-ID: Hi David, I saw that crash once while I was developing the app, I'll have another investigate and see if I can be a bit more careful about the location of the syntax files (I think I will use an embedded version of the current Ruby syntax if it fails). Was you using the binaries available to download or from your own build? Thanks for letting me know it builds, actually reminds me I need to setup a local TeamCity project for the CodePlex repository. Ben On Mon, Jul 21, 2008 at 8:51 PM, wrote: > > This looks interesting. However I blew up the program the moment I tried > it. I think the problem is that you use a relative path to open your syntax > files but when you go to File Open the source file, the current directory > gets changed to where ever, and then the program blows up at line 24 or 25 > in CodeEditorIDETextBox.cs because it can no longer find the syntax files > directory. BTW you can compile the project fine with the C# Express IDE and > also with Sharpdevelop 3. > > Good luck with this! > > David > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > From kfarmer at thuban.org Tue Jul 22 01:16:43 2008 From: kfarmer at thuban.org (Keith J. Farmer) Date: Mon, 21 Jul 2008 16:16:43 -0700 Subject: [IronPython] IronPython Post 2.0 Roadmap References: <4875EF83.80805@voidspace.org.uk><4880BC17.5020007@voidspace.org.uk><4817b6fc0807182254o7ea4dccu45d0294beaba1989@mail.gmail.com><8cd017b80807190056s3c8a955cu15c436f51c8a31ea@mail.gmail.com><5b0248170807191035m332c07d9j1aff9ba94abf8310@mail.gmail.com><4882265D.10804@voidspace.org.uk><4884E7E0.80200@voidspace.org.uk> Message-ID: We are talking about *new* features, but you're limiting yourself to existing APIs? If, for the sake of working nicely with the DLR, the existing reflection API needs to be modified to deal with a more dynamic world, that's not outside the realm of possibility in my books. After all, there has always been talk of IP being able to expose static types for consumption outside of IP. I don't see that this is any less possible now than it was at the start. Incidentally, Type is an abstract class. Also, ParameterInfo isn't sealed, and implements ICustomerAttributeProvider, which is a public interface: public interface ICustomAttributeProvider { // Methods object [] GetCustomAttributes (bool inherit); object [] GetCustomAttributes (Type attributeType, bool inherit); bool IsDefined (Type attributeType, bool inherit); } So I think, actually, that this could be done without changing much if any external API. They'd probably need to change some of the internals to return dynamic variants of the info types, but I think that's doable. ________________________________ From: users-bounces at lists.ironpython.com on behalf of Harry Pierson Sent: Mon 7/21/2008 12:59 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap All of the many overloads of GetCustomAttributes (http://msdn.microsoft.com/en-us/library/system.attribute.getcustomattributes(VS.85).aspx) need some type of static type info (Type, MemberInfo, ParameterInfo). So supporting custom attributes would require some type of static class as Michael mentions below. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Monday, July 21, 2008 12:48 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap Keith J. Farmer wrote: > Attributes can be applied to more than just types -- members, > parameters, return values (as I recall), etc. But those all presuppose a static type - right? IronPython could generate a static class in the compile phase where .NET attributes are used. Python decorator syntax could be used - class decorators are now part of Python 2.6 and no-one would object to you sneaking them into Python 2.5... Parameter and return type attributes could still use a method decorator to apply them. Michael > > ------------------------------------------------------------------------ > *From:* users-bounces at lists.ironpython.com on behalf of Curt Hagenlocher > *Sent:* Mon 7/21/2008 9:51 AM > *To:* Discussion of IronPython > *Subject:* Re: [IronPython] IronPython Post 2.0 Roadmap > > "Availability of a static type" not because IronPython would need to > access one but because it would need to expose one. > > > On Mon, Jul 21, 2008 at 9:44 AM, Keith J. Farmer > wrote: > > You can create your own attribute classes, for whatever markup. > Particularly since LINQ-to-*, where they often are used to > annotate data classes with strings, etc (not references to types). > > In any event, why does "availability of a static type" enter into > this? IP can access static types just as well as any other .NET > language (System.Math comes to mind). The motivation in general > is to make IP a better producer for CLR types, rather than just a > consumer, and attributes are an increasingly important thing to > support. > > As for expression trees and extension methods, those are to make > IP a better consumer of a very important API (LINQ and the > IQueryable stack from .NET 3.5). > > To be honest, once those 3 features are available in IP, I think > it would be on par with the mainstream languages in being very > usable in an exclusive sense. > > -----Original Message----- > From: users-bounces at lists.ironpython.com > > [mailto:users-bounces at lists.ironpython.com > ] On Behalf Of Harry > Pierson > Sent: Sunday, July 20, 2008 11:14 PM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython Post 2.0 Roadmap > > Can you give me some examples where you would use these? The > problem I see is that many scenarios (WCF contracts, XML > serialization just to name two) where people want to use a custom > attribute depends on the availability of a static type. > > Harry > > -----Original Message----- > From: users-bounces at lists.ironpython.com > > [mailto:users-bounces at lists.ironpython.com > ] On Behalf Of Keith J. > Farmer > Sent: Saturday, July 19, 2008 8:13 PM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython Post 2.0 Roadmap > > votes++ > > -----Original Message----- > From: users-bounces at lists.ironpython.com > > [mailto:users-bounces at lists.ironpython.com > ] On Behalf Of Michael > Foord > Sent: Saturday, July 19, 2008 10:38 AM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython Post 2.0 Roadmap > > Sanghyeon Seo wrote: > > 2008/7/20 Harry Pierson >: > > > >> Hosting features are all done via the DLR, so that's a separate > team. As for > >> "ability to interact with the rest of the .Net framework", can > you be more > >> specific about what you're looking for in that space? What > *isn't* IPy doing > >> that you want it to? > >> > > > > .NET attributes? > > > > > +1 :-) > > Michael > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ _______________________________________________ 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: 15093 bytes Desc: not available URL: From mail.matt.mcdonald at gmail.com Tue Jul 22 02:58:15 2008 From: mail.matt.mcdonald at gmail.com (Matthew McDonald) Date: Mon, 21 Jul 2008 18:58:15 -0600 Subject: [IronPython] Announcing IronEditor - An Editor for IronRuby, IronPython and other DLR languages In-Reply-To: References: Message-ID: Very nice program. There are a few things lacking (auto indentation being the biggest one), but I overall very much like the look and feel of this app. It probably just became my editor of choice for IronPython work. Could you please change the behavior of the tab key in the text editor to add a new tab rather than rotate through the tab order on the controls. Also, you may be happy to know that it seems to work well under mono. Thanks a lot for making this, -Matt On Mon, Jul 21, 2008 at 5:09 PM, Ben Hall wrote: > Hi David, > > I saw that crash once while I was developing the app, I'll have > another investigate and see if I can be a bit more careful about the > location of the syntax files (I think I will use an embedded version > of the current Ruby syntax if it fails). Was you using the binaries > available to download or from your own build? > > Thanks for letting me know it builds, actually reminds me I need to > setup a local TeamCity project for the CodePlex repository. > > Ben > > > On Mon, Jul 21, 2008 at 8:51 PM, wrote: > > > > This looks interesting. However I blew up the program the moment I tried > > it. I think the problem is that you use a relative path to open your > syntax > > files but when you go to File Open the source file, the current directory > > gets changed to where ever, and then the program blows up at line 24 or > 25 > > in CodeEditorIDETextBox.cs because it can no longer find the syntax files > > directory. BTW you can compile the project fine with the C# Express IDE > and > > also with Sharpdevelop 3. > > > > Good luck with this! > > > > David > > > > _______________________________________________ > > 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 > -- Matt McDonald Mail.Matt.McDonald at Gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From dblank at brynmawr.edu Tue Jul 22 03:39:25 2008 From: dblank at brynmawr.edu (Douglas Blank) Date: Mon, 21 Jul 2008 21:39:25 -0400 (EDT) Subject: [IronPython] Announcing IronEditor - An Editor for IronRuby, IronPython and other DLR languages In-Reply-To: Message-ID: <1458786927.2304621216690765442.JavaMail.root@ganesh.brynmawr.edu> Matt, Did you build it under Mono, or under Windows, and then run under Mono? If you built it using gmcs, could you post the makefile? Thanks, -Doug ----- Original Message ----- From: "Matthew McDonald" To: "Discussion of IronPython" Sent: Monday, July 21, 2008 8:58:15 PM GMT -05:00 US/Canada Eastern Subject: Re: [IronPython] Announcing IronEditor - An Editor for IronRuby, IronPython and other DLR languages Very nice program. There are a few things lacking (auto indentation being the biggest one), but I overall very much like the look and feel of this app. It probably just became my editor of choice for IronPython work. Could you please change the behavior of the tab key in the text editor to add a new tab rather than rotate through the tab order on the controls. Also, you may be happy to know that it seems to work well under mono. Thanks a lot for making this, -Matt On Mon, Jul 21, 2008 at 5:09 PM, Ben Hall < ben2004uk at googlemail.com > wrote: Hi David, I saw that crash once while I was developing the app, I'll have another investigate and see if I can be a bit more careful about the location of the syntax files (I think I will use an embedded version of the current Ruby syntax if it fails). Was you using the binaries available to download or from your own build? Thanks for letting me know it builds, actually reminds me I need to setup a local TeamCity project for the CodePlex repository. Ben On Mon, Jul 21, 2008 at 8:51 PM, < David.Lawler at franke.com > wrote: > > This looks interesting. However I blew up the program the moment I tried > it. I think the problem is that you use a relative path to open your syntax > files but when you go to File Open the source file, the current directory > gets changed to where ever, and then the program blows up at line 24 or 25 > in CodeEditorIDETextBox.cs because it can no longer find the syntax files > directory. BTW you can compile the project fine with the C# Express IDE and > also with Sharpdevelop 3. > > Good luck with this! > > David > > _______________________________________________ > 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 -- Matt McDonald Mail.Matt.McDonald at Gmail.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From ben2004uk at googlemail.com Tue Jul 22 10:02:37 2008 From: ben2004uk at googlemail.com (Ben Hall) Date: Tue, 22 Jul 2008 09:02:37 +0100 Subject: [IronPython] Announcing IronEditor - An Editor for IronRuby, IronPython and other DLR languages In-Reply-To: References: Message-ID: Hi Matthew, Thanks for the kind comments. My task for the next release is to improve the editor control, what is there at the moment works but to a point and could work much nicer. If you have any other comments or feature requests, please let me know. Thanks Ben On Tue, Jul 22, 2008 at 1:58 AM, Matthew McDonald wrote: > Very nice program. There are a few things lacking (auto indentation being > the biggest one), but I overall very much like the look and feel of this > app. It probably just became my editor of choice for IronPython work. > > Could you please change the behavior of the tab key in the text editor to > add a new tab rather than rotate through the tab order on the controls. > > Also, you may be happy to know that it seems to work well under mono. > > Thanks a lot for making this, > -Matt > > On Mon, Jul 21, 2008 at 5:09 PM, Ben Hall wrote: >> >> Hi David, >> >> I saw that crash once while I was developing the app, I'll have >> another investigate and see if I can be a bit more careful about the >> location of the syntax files (I think I will use an embedded version >> of the current Ruby syntax if it fails). Was you using the binaries >> available to download or from your own build? >> >> Thanks for letting me know it builds, actually reminds me I need to >> setup a local TeamCity project for the CodePlex repository. >> >> Ben >> >> >> On Mon, Jul 21, 2008 at 8:51 PM, wrote: >> > >> > This looks interesting. However I blew up the program the moment I >> > tried >> > it. I think the problem is that you use a relative path to open your >> > syntax >> > files but when you go to File Open the source file, the current >> > directory >> > gets changed to where ever, and then the program blows up at line 24 or >> > 25 >> > in CodeEditorIDETextBox.cs because it can no longer find the syntax >> > files >> > directory. BTW you can compile the project fine with the C# Express IDE >> > and >> > also with Sharpdevelop 3. >> > >> > Good luck with this! >> > >> > David >> > >> > _______________________________________________ >> > 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 > > > > -- > Matt McDonald > Mail.Matt.McDonald at Gmail.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > From ben2004uk at googlemail.com Tue Jul 22 10:05:52 2008 From: ben2004uk at googlemail.com (Ben Hall) Date: Tue, 22 Jul 2008 09:05:52 +0100 Subject: [IronPython] Announcing IronEditor - An Editor for IronRuby, IronPython and other DLR languages In-Reply-To: <1458786927.2304621216690765442.JavaMail.root@ganesh.brynmawr.edu> References: <1458786927.2304621216690765442.JavaMail.root@ganesh.brynmawr.edu> Message-ID: Hi Douglas, I didn't include a makefile - is that required for building under Mono? If you download the prebuilt assemblies from CodePlex (compiled under Windows), they will run under the Mono environment. If you have any other questions, please let me know. Thanks Ben On Tue, Jul 22, 2008 at 2:39 AM, Douglas Blank wrote: > Matt, > > Did you build it under Mono, or under Windows, and then run under Mono? > > If you built it using gmcs, could you post the makefile? > > Thanks, > > -Doug > > ----- Original Message ----- > From: "Matthew McDonald" > To: "Discussion of IronPython" > Sent: Monday, July 21, 2008 8:58:15 PM GMT -05:00 US/Canada Eastern > Subject: Re: [IronPython] Announcing IronEditor - An Editor for IronRuby, IronPython and other DLR languages > > > > Very nice program. There are a few things lacking (auto indentation being the biggest one), but I overall very much like the look and feel of this app. It probably just became my editor of choice for IronPython work. > > Could you please change the behavior of the tab key in the text editor to add a new tab rather than rotate through the tab order on the controls. > > Also, you may be happy to know that it seems to work well under mono. > > Thanks a lot for making this, > -Matt > > > On Mon, Jul 21, 2008 at 5:09 PM, Ben Hall < ben2004uk at googlemail.com > wrote: > > > Hi David, > > I saw that crash once while I was developing the app, I'll have > another investigate and see if I can be a bit more careful about the > location of the syntax files (I think I will use an embedded version > of the current Ruby syntax if it fails). Was you using the binaries > available to download or from your own build? > > Thanks for letting me know it builds, actually reminds me I need to > setup a local TeamCity project for the CodePlex repository. > > Ben > > > > > > On Mon, Jul 21, 2008 at 8:51 PM, < David.Lawler at franke.com > wrote: >> >> This looks interesting. However I blew up the program the moment I tried >> it. I think the problem is that you use a relative path to open your syntax >> files but when you go to File Open the source file, the current directory >> gets changed to where ever, and then the program blows up at line 24 or 25 >> in CodeEditorIDETextBox.cs because it can no longer find the syntax files >> directory. BTW you can compile the project fine with the C# Express IDE and >> also with Sharpdevelop 3. >> >> Good luck with this! >> >> David >> > > > >> _______________________________________________ >> 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 > > > > -- > Matt McDonald > Mail.Matt.McDonald at Gmail.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 dan.eloff at gmail.com Tue Jul 22 19:37:41 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Tue, 22 Jul 2008 12:37:41 -0500 Subject: [IronPython] Calling a Win32 API function in IronPython In-Reply-To: <070B17B168154D46B9743BDA2B5BEEDF0FAF07993C@NA-EXMSG-C123.redmond.corp.microsoft.com> References: <070B17B168154D46B9743BDA2B5BEEDF0FAF07993C@NA-EXMSG-C123.redmond.corp.microsoft.com> Message-ID: <4817b6fc0807221037o47c6d68brb9ad22a46c33f3df@mail.gmail.com> Hi Michael, I am unaware of any such functionality. IronPython doesn't support attributes because it cannot yet expose static types to the CLR. For both of those reasons, you cannot use P/Invoke in IronPython. Fepy has a ctypes module, but last I checked it is broken in a few important ways, including that it doesn't support windows dlls or 64bit systems. However, It may still contain the answer to your question, if you look through the code. The easiest is going to be to make a C# dll that uses P/Invoke to wrap the required functionality from the Win32 API. -Dan On Mon, Jul 21, 2008 at 2:28 PM, Michael Armes wrote: > How does one go about invoking a function in the Win32 API in Iron Python? > Is there any P/Invoke functionality? > > > > FWIW, I want to get to GenerateConsoleCtrlEvent in kernel32.dll. > > > > The thread at > http://lists.ironpython.com/pipermail/users-ironpython.com/2006-April/002211.html > indicated that there was a WorkItem to add this functionality in 2006. > > > > Thanks, > > Michael > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > From olegtk at microsoft.com Wed Jul 23 19:12:50 2008 From: olegtk at microsoft.com (Oleg Tkachenko) Date: Wed, 23 Jul 2008 10:12:50 -0700 Subject: [IronPython] VS Shell Addin for IronPython Studio In-Reply-To: References: Message-ID: So after discussing this with VSX team I can say that basically this scenario (extending VS Shell isolated application with Addins) should work, but most likely IronPython Studio needs to be a bit tweaked to enable that. Minor changes - like stub application must have version resource and pkgdef file should also define long application name. Once I have a working sample I'll let you know. Another question is why are you interested in IronPython Studio Isolated mode in the first place? In Integrated mode (when IronPython Studio isn't standalone installation, but part of Visual Studio) extending scenario just works. -- Oleg From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Stephens Sent: Monday, July 21, 2008 10:10 AM To: Discussion of IronPython Subject: [IronPython] VS Shell Addin for IronPython Studio I'm not sure if this is the right place to ask but I thought I would pose it here and if need be it can be redirected. I am trying to build an Addin for IronPython Studio. No matter what I try Iron Python Studio wont see my addin (despite them being turned on). I have setup a VM where I installed PythonStudio in standalone mode. I have constructed a folder in C:\Documents and Settings\michael\My Documents\IronPython Studio\Addins for my addins. I know the xml is being parsed in this directory because if I build invalid xml IronPython Studio throws an error. I have tried every combination of xml versions that I can think of. If anyone has any ideas I would love to hear them! I have attached the files below. Michael Stephens Electrical Engineering Graduate Student University of Wyoming falcon at uwyo.edu or 89iroc at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From carl.cerecke at telogis.com Wed Jul 23 23:56:41 2008 From: carl.cerecke at telogis.com (Carl Cerecke) Date: Thu, 24 Jul 2008 09:56:41 +1200 Subject: [IronPython] Inserting TABs (was Re: VS Shell Addin for IronPython Studio) Message-ID: <92fc6620807231456w389178b4xcff517bba55ce851@mail.gmail.com> Since the topic of IronPython Studio has come up... On Thu, Jul 24, 2008 at 5:12 AM, Oleg Tkachenko wrote: > In Integrated mode (when IronPython Studio isn't > standalone installation, but part of Visual Studio) extending scenario just > works. It doesn't quite 'just work' for me. Some things are great, but others are frustrating: 1. The text editor will insert TABs from time to time in the first column. (even though prefs have 'Insert tabs as spaces' set). 2. Stepping through in the debugger, the 'show next' statement is sometimes incorrect 3. The watch window and immediate window are mostly useless while execution is paused. I can't see the value of most python vars. 4. F11 won't step into called functions (well, it does, but it goes through half a dozen assembly instructions first) 5. The auto-complete is both too eager (e.g. for statements), and not intelligent enough (this is a hard problem, though) 6. The interactive IronPython Console can be useful, but it would be great if it could somehow attach to the interpreter of a paused app so I could inspect variables and execute statements. Any ideas how to fix any these problems, please let me know. Cheers, Carl. -- Carl Cerecke, PhD Senior Software Engineer Telogis, Intelligent Location Technology Level 2, Building 2 1 Show Place Addington CHRISTCHURCH New Zealand Phone: +64 03 339 2825 ext 208 Fax: +64 03 339 4537 Email: carl.cerecke at telogis.com This message (including any attachments) contains confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, you should delete this message and are hereby notified that any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited. From olegtk at microsoft.com Thu Jul 24 00:05:12 2008 From: olegtk at microsoft.com (Oleg Tkachenko) Date: Wed, 23 Jul 2008 15:05:12 -0700 Subject: [IronPython] Inserting TABs (was Re: VS Shell Addin for IronPython Studio) In-Reply-To: <92fc6620807231456w389178b4xcff517bba55ce851@mail.gmail.com> References: <92fc6620807231456w389178b4xcff517bba55ce851@mail.gmail.com> Message-ID: Sure, IronPython Studio currently is a sample quality code, but we are working on making it a real product. Thanks for reporting bugs. What I meant saying "just works" is extending it with addins in integrated mode. -- Oleg -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Carl Cerecke Sent: Wednesday, July 23, 2008 2:57 PM To: Discussion of IronPython Subject: [IronPython] Inserting TABs (was Re: VS Shell Addin for IronPython Studio) Since the topic of IronPython Studio has come up... On Thu, Jul 24, 2008 at 5:12 AM, Oleg Tkachenko wrote: > In Integrated mode (when IronPython Studio isn't > standalone installation, but part of Visual Studio) extending scenario just > works. It doesn't quite 'just work' for me. Some things are great, but others are frustrating: 1. The text editor will insert TABs from time to time in the first column. (even though prefs have 'Insert tabs as spaces' set). 2. Stepping through in the debugger, the 'show next' statement is sometimes incorrect 3. The watch window and immediate window are mostly useless while execution is paused. I can't see the value of most python vars. 4. F11 won't step into called functions (well, it does, but it goes through half a dozen assembly instructions first) 5. The auto-complete is both too eager (e.g. for statements), and not intelligent enough (this is a hard problem, though) 6. The interactive IronPython Console can be useful, but it would be great if it could somehow attach to the interpreter of a paused app so I could inspect variables and execute statements. Any ideas how to fix any these problems, please let me know. Cheers, Carl. -- Carl Cerecke, PhD Senior Software Engineer Telogis, Intelligent Location Technology Level 2, Building 2 1 Show Place Addington CHRISTCHURCH New Zealand Phone: +64 03 339 2825 ext 208 Fax: +64 03 339 4537 Email: carl.cerecke at telogis.com This message (including any attachments) contains confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, you should delete this message and are hereby notified that any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited. _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From carl.cerecke at telogis.com Thu Jul 24 00:46:05 2008 From: carl.cerecke at telogis.com (Carl Cerecke) Date: Thu, 24 Jul 2008 10:46:05 +1200 Subject: [IronPython] Inserting TABs (was Re: VS Shell Addin for IronPython Studio) In-Reply-To: References: <92fc6620807231456w389178b4xcff517bba55ce851@mail.gmail.com> Message-ID: <92fc6620807231546x4de38985r4a86945480d4f953@mail.gmail.com> OK. I find it really useful to be able to step from python into C# code and back (lest you think I only complain :) With the 6 issues I mentioned fixed it will be a really outstanding product. Cheers, Carl. On Thu, Jul 24, 2008 at 10:05 AM, Oleg Tkachenko wrote: > Sure, IronPython Studio currently is a sample quality code, but we are working on making it a real product. Thanks for reporting bugs. > What I meant saying "just works" is extending it with addins in integrated mode. > > -- > Oleg > > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Carl Cerecke > Sent: Wednesday, July 23, 2008 2:57 PM > To: Discussion of IronPython > Subject: [IronPython] Inserting TABs (was Re: VS Shell Addin for IronPython Studio) > > Since the topic of IronPython Studio has come up... > > On Thu, Jul 24, 2008 at 5:12 AM, Oleg Tkachenko wrote: >> In Integrated mode (when IronPython Studio isn't >> standalone installation, but part of Visual Studio) extending scenario just >> works. > > It doesn't quite 'just work' for me. Some things are great, but others > are frustrating: > 1. The text editor will insert TABs from time to time in the first > column. (even though prefs have 'Insert tabs as spaces' set). > 2. Stepping through in the debugger, the 'show next' statement is > sometimes incorrect > 3. The watch window and immediate window are mostly useless while > execution is paused. I can't see the value of most python vars. > 4. F11 won't step into called functions (well, it does, but it goes > through half a dozen assembly instructions first) > 5. The auto-complete is both too eager (e.g. for statements), and not > intelligent enough (this is a hard problem, though) > 6. The interactive IronPython Console can be useful, but it would be > great if it could somehow attach to the interpreter of a paused app so > I could inspect variables and execute statements. > > Any ideas how to fix any these problems, please let me know. > > Cheers, > Carl. > -- > Carl Cerecke, PhD > Senior Software Engineer > > Telogis, Intelligent Location Technology > Level 2, Building 2 > 1 Show Place > Addington > CHRISTCHURCH > New Zealand > > Phone: +64 03 339 2825 ext 208 > Fax: +64 03 339 4537 > Email: carl.cerecke at telogis.com > > This message (including any attachments) contains confidential > information intended for a specific individual and purpose, and is > protected by law. If you are not the intended recipient, you should > delete this message and are hereby notified that any disclosure, > copying, or distribution of this message, or the taking of any action > based on it, is strictly prohibited. > _______________________________________________ > 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 > -- Carl Cerecke, PhD Senior Software Engineer Telogis, Intelligent Location Technology Level 2, Building 2 1 Show Place Addington CHRISTCHURCH New Zealand Phone: +64 03 339 2825 ext 208 Fax: +64 03 339 4537 Email: carl.cerecke at telogis.com This message (including any attachments) contains confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, you should delete this message and are hereby notified that any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited. From v-johcas at microsoft.com Thu Jul 24 01:11:54 2008 From: v-johcas at microsoft.com (John Case (Excell Data Corporation)) Date: Wed, 23 Jul 2008 16:11:54 -0700 Subject: [IronPython] os.system Message-ID: <358E5F25E7526644AA6B3324DEB18BDA27C9E95E45@NA-EXMSG-C124.redmond.corp.microsoft.com> Hello: With IronPython, what do I use instead of os.system('dir'), or os.popen('dir') to achieve the same result? Thank you very much! John Case -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Thu Jul 24 01:18:30 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 23 Jul 2008 16:18:30 -0700 Subject: [IronPython] os.system In-Reply-To: <358E5F25E7526644AA6B3324DEB18BDA27C9E95E45@NA-EXMSG-C124.redmond.corp.microsoft.com> References: <358E5F25E7526644AA6B3324DEB18BDA27C9E95E45@NA-EXMSG-C124.redmond.corp.microsoft.com> Message-ID: <7AD436E4270DD54A94238001769C2227012C935C03CE@DF-GRTDANE-MSG.exchange.corp.microsoft.com> They're in the nt module - usually w/ CPython the os module, which is written in Python, loads the appropriate module (nt/unix/etc...) and delegates to that. In IronPython 2.0 nt now implements both popen* and system. In 1.x we only support popen* and not system. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of John Case (Excell Data Corporation) Sent: Wednesday, July 23, 2008 4:12 PM To: Users at lists.ironpython.com Subject: [IronPython] os.system Hello: With IronPython, what do I use instead of os.system('dir'), or os.popen('dir') to achieve the same result? Thank you very much! John Case -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Thu Jul 24 01:23:02 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 24 Jul 2008 00:23:02 +0100 Subject: [IronPython] os.system In-Reply-To: <7AD436E4270DD54A94238001769C2227012C935C03CE@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <358E5F25E7526644AA6B3324DEB18BDA27C9E95E45@NA-EXMSG-C124.redmond.corp.microsoft.com> <7AD436E4270DD54A94238001769C2227012C935C03CE@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <4887BD56.70503@voidspace.org.uk> Dino Viehland wrote: > > They?re in the nt module ? usually w/ CPython the os module, which is > written in Python, loads the appropriate module (nt/unix/etc?) and > delegates to that. In IronPython 2.0 nt now implements both popen* and > system. In 1.x we only support popen* and not system. > To clarify Dino's response slightly - if you make sure that the Python standard library is on your path then yhou can 'import os' in Python. Michael > *From:* users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] *On Behalf Of *John Case > (Excell Data Corporation) > *Sent:* Wednesday, July 23, 2008 4:12 PM > *To:* Users at lists.ironpython.com > *Subject:* [IronPython] os.system > > Hello: > > With IronPython, what do I use instead of os.system(?dir?), or > os.popen(?dir?) to achieve the same result? > > Thank you very much! > > John Case > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From curt at hagenlocher.org Thu Jul 24 01:28:36 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Wed, 23 Jul 2008 16:28:36 -0700 Subject: [IronPython] os.system In-Reply-To: <7AD436E4270DD54A94238001769C2227012C935C03CE@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <358E5F25E7526644AA6B3324DEB18BDA27C9E95E45@NA-EXMSG-C124.redmond.corp.microsoft.com> <7AD436E4270DD54A94238001769C2227012C935C03CE@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: I'm not sure you can do either of these in beta 3, actually, but the work is done and in the latest Codeplex drops. It will be in beta 4, which is planned for early in August. On Wed, Jul 23, 2008 at 4:18 PM, Dino Viehland wrote: > They're in the nt module ? usually w/ CPython the os module, which is > written in Python, loads the appropriate module (nt/unix/etc?) and delegates > to that. In IronPython 2.0 nt now implements both popen* and system. In > 1.x we only support popen* and not system. > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *John Case (Excell Data > Corporation) > *Sent:* Wednesday, July 23, 2008 4:12 PM > *To:* Users at lists.ironpython.com > *Subject:* [IronPython] os.system > > > > Hello: > > > > With IronPython, what do I use instead of os.system('dir'), or > os.popen('dir') to achieve the same result? > > > > Thank you very much! > > > > > > John Case > > _______________________________________________ > 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 curt at hagenlocher.org Thu Jul 24 01:39:00 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Wed, 23 Jul 2008 16:39:00 -0700 Subject: [IronPython] IronPython Post 2.0 Roadmap In-Reply-To: References: <4875EF83.80805@voidspace.org.uk> <4882265D.10804@voidspace.org.uk> <4884E7E0.80200@voidspace.org.uk> Message-ID: So, we had a brief hallway discussion today about this topic, and the upshot is that I'm interested in hearing your "real world" use cases for a) attributes, and b) static type generation in general By "use case", I mean a scenario that's specifically relevant to you today. By "relevant", I mean that it would be *nice* to be able to write a PowerShell extension in Python, but if you didn't end up writing the extension in another language, then it doesn't really count for what I'm looking for. :) On Mon, Jul 21, 2008 at 4:16 PM, Keith J. Farmer wrote: > We are talking about *new* features, but you're limiting yourself to > existing APIs? > > If, for the sake of working nicely with the DLR, the existing reflection > API needs to be modified to deal with a more dynamic world, that's not > outside the realm of possibility in my books. After all, there has always > been talk of IP being able to expose static types for consumption outside of > IP. I don't see that this is any less possible now than it was at the > start. > > Incidentally, Type is an abstract class. Also, ParameterInfo isn't sealed, > and implements ICustomerAttributeProvider, which is a public interface: > > public interface ICustomAttributeProvider < > http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Reflection.ICustomAttributeProvider > > > { > // Methods > object < > http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Object> > [] GetCustomAttributes < > http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Reflection.ICustomAttributeProvider/GetCustomAttributes(Boolean):Object%5b%5d> > (bool < > http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Boolean> > inherit); > object < > http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Object> > [] GetCustomAttributes < > http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Reflection.ICustomAttributeProvider/GetCustomAttributes(System.Type,Boolean):Object%5b%5d> > (Type < > http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Type> > attributeType, bool < > http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Boolean> > inherit); > bool < > http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Boolean> > IsDefined < > http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Reflection.ICustomAttributeProvider/IsDefined(System.Type,Boolean):Boolean> > (Type < > http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Type> > attributeType, bool < > http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Boolean> > inherit); > } > > > So I think, actually, that this could be done without changing much if any > external API. They'd probably need to change some of the internals to > return dynamic variants of the info types, but I think that's doable. > > ________________________________ > > From: users-bounces at lists.ironpython.com on behalf of Harry Pierson > Sent: Mon 7/21/2008 12:59 PM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython Post 2.0 Roadmap > > > > All of the many overloads of GetCustomAttributes ( > http://msdn.microsoft.com/en-us/library/system.attribute.getcustomattributes(VS.85).aspx) > need some type of static type info (Type, MemberInfo, ParameterInfo). So > supporting custom attributes would require some type of static class as > Michael mentions below. > > > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Monday, July 21, 2008 12:48 PM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython Post 2.0 Roadmap > > Keith J. Farmer wrote: > > Attributes can be applied to more than just types -- members, > > parameters, return values (as I recall), etc. > > But those all presuppose a static type - right? > > IronPython could generate a static class in the compile phase where .NET > attributes are used. Python decorator syntax could be used - class > decorators are now part of Python 2.6 and no-one would object to you > sneaking them into Python 2.5... > > Parameter and return type attributes could still use a method decorator > to apply them. > > Michael > > > > > ------------------------------------------------------------------------ > > *From:* users-bounces at lists.ironpython.com on behalf of Curt Hagenlocher > > *Sent:* Mon 7/21/2008 9:51 AM > > *To:* Discussion of IronPython > > *Subject:* Re: [IronPython] IronPython Post 2.0 Roadmap > > > > "Availability of a static type" not because IronPython would need to > > access one but because it would need to expose one. > > > > > > On Mon, Jul 21, 2008 at 9:44 AM, Keith J. Farmer > > wrote: > > > > You can create your own attribute classes, for whatever markup. > > Particularly since LINQ-to-*, where they often are used to > > annotate data classes with strings, etc (not references to types). > > > > In any event, why does "availability of a static type" enter into > > this? IP can access static types just as well as any other .NET > > language (System.Math comes to mind). The motivation in general > > is to make IP a better producer for CLR types, rather than just a > > consumer, and attributes are an increasingly important thing to > > support. > > > > As for expression trees and extension methods, those are to make > > IP a better consumer of a very important API (LINQ and the > > IQueryable stack from .NET 3.5). > > > > To be honest, once those 3 features are available in IP, I think > > it would be on par with the mainstream languages in being very > > usable in an exclusive sense. > > > > -----Original Message----- > > From: users-bounces at lists.ironpython.com > > > > [mailto:users-bounces at lists.ironpython.com > > ] On Behalf Of Harry > > Pierson > > Sent: Sunday, July 20, 2008 11:14 PM > > To: Discussion of IronPython > > Subject: Re: [IronPython] IronPython Post 2.0 Roadmap > > > > Can you give me some examples where you would use these? The > > problem I see is that many scenarios (WCF contracts, XML > > serialization just to name two) where people want to use a custom > > attribute depends on the availability of a static type. > > > > Harry > > > > -----Original Message----- > > From: users-bounces at lists.ironpython.com > > > > [mailto:users-bounces at lists.ironpython.com > > ] On Behalf Of Keith J. > > Farmer > > Sent: Saturday, July 19, 2008 8:13 PM > > To: Discussion of IronPython > > Subject: Re: [IronPython] IronPython Post 2.0 Roadmap > > > > votes++ > > > > -----Original Message----- > > From: users-bounces at lists.ironpython.com > > > > [mailto:users-bounces at lists.ironpython.com > > ] On Behalf Of Michael > > Foord > > Sent: Saturday, July 19, 2008 10:38 AM > > To: Discussion of IronPython > > Subject: Re: [IronPython] IronPython Post 2.0 Roadmap > > > > Sanghyeon Seo wrote: > > > 2008/7/20 Harry Pierson > >: > > > > > >> Hosting features are all done via the DLR, so that's a separate > > team. As for > > >> "ability to interact with the rest of the .Net framework", can > > you be more > > >> specific about what you're looking for in that space? What > > *isn't* IPy doing > > >> that you want it to? > > >> > > > > > > .NET attributes? > > > > > > > > +1 :-) > > > > Michael > > > > -- > > http://www.ironpythoninaction.com/ > > http://www.voidspace.org.uk/ > > http://www.trypython.org/ > > http://www.ironpython.info/ > > http://www.theotherdelia.co.uk/ > > http://www.resolverhacks.net/ > > > > _______________________________________________ > > 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 > > > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 kfarmer at thuban.org Thu Jul 24 04:30:15 2008 From: kfarmer at thuban.org (Keith J. Farmer) Date: Wed, 23 Jul 2008 19:30:15 -0700 Subject: [IronPython] IronPython Post 2.0 Roadmap References: <4875EF83.80805@voidspace.org.uk> <4882265D.10804@voidspace.org.uk><4884E7E0.80200@voidspace.org.uk> Message-ID: I can answer both in one: To be able to use IronPython to create data classes, marked up with attributes, to be consumed by APIs probably written in something other than IronPython. That's it.. quite simple. Example of such an API: LINQ to SQL. Or LINQ to whatever, since outside of of Objects and XML, things pretty much end up with mapping metadata and attributes are one of the first places to look for that. And so, in light of the DLR effort, and the general push to make the static languages be able to work well with the dynamics, I think it's only right that the DLR languages be able to expose their dynamic types in such as way as to be transparent to the static languages. That's why I pointed out that Type is an abstract class and the MemberInfo subclasses themselves appear to be subclassable. It really appears that the API is there, waiting to be implemented. Otherwise, really, the dynamic languages are completely unusable for certain APIs -- they just don't interact with the reflection API in such a way that libraries can consume in a reasonable, language-neutral manner. ________________________________ From: users-bounces at lists.ironpython.com on behalf of Curt Hagenlocher Sent: Wed 7/23/2008 4:39 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap So, we had a brief hallway discussion today about this topic, and the upshot is that I'm interested in hearing your "real world" use cases for a) attributes, and b) static type generation in general By "use case", I mean a scenario that's specifically relevant to you today. By "relevant", I mean that it would be *nice* to be able to write a PowerShell extension in Python, but if you didn't end up writing the extension in another language, then it doesn't really count for what I'm looking for. :) On Mon, Jul 21, 2008 at 4:16 PM, Keith J. Farmer wrote: We are talking about *new* features, but you're limiting yourself to existing APIs? If, for the sake of working nicely with the DLR, the existing reflection API needs to be modified to deal with a more dynamic world, that's not outside the realm of possibility in my books. After all, there has always been talk of IP being able to expose static types for consumption outside of IP. I don't see that this is any less possible now than it was at the start. Incidentally, Type is an abstract class. Also, ParameterInfo isn't sealed, and implements ICustomerAttributeProvider, which is a public interface: public interface ICustomAttributeProvider { // Methods object [] GetCustomAttributes (bool inherit); object [] GetCustomAttributes (Type attributeType, bool inherit); bool IsDefined (Type attributeType, bool inherit); } So I think, actually, that this could be done without changing much if any external API. They'd probably need to change some of the internals to return dynamic variants of the info types, but I think that's doable. ________________________________ From: users-bounces at lists.ironpython.com on behalf of Harry Pierson Sent: Mon 7/21/2008 12:59 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap All of the many overloads of GetCustomAttributes (http://msdn.microsoft.com/en-us/library/system.attribute.getcustomattributes(VS.85).aspx) need some type of static type info (Type, MemberInfo, ParameterInfo). So supporting custom attributes would require some type of static class as Michael mentions below. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Monday, July 21, 2008 12:48 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap Keith J. Farmer wrote: > Attributes can be applied to more than just types -- members, > parameters, return values (as I recall), etc. But those all presuppose a static type - right? IronPython could generate a static class in the compile phase where .NET attributes are used. Python decorator syntax could be used - class decorators are now part of Python 2.6 and no-one would object to you sneaking them into Python 2.5... Parameter and return type attributes could still use a method decorator to apply them. Michael > > ------------------------------------------------------------------------ > *From:* users-bounces at lists.ironpython.com on behalf of Curt Hagenlocher > *Sent:* Mon 7/21/2008 9:51 AM > *To:* Discussion of IronPython > *Subject:* Re: [IronPython] IronPython Post 2.0 Roadmap > > "Availability of a static type" not because IronPython would need to > access one but because it would need to expose one. > > > On Mon, Jul 21, 2008 at 9:44 AM, Keith J. Farmer > wrote: > > You can create your own attribute classes, for whatever markup. > Particularly since LINQ-to-*, where they often are used to > annotate data classes with strings, etc (not references to types). > > In any event, why does "availability of a static type" enter into > this? IP can access static types just as well as any other .NET > language (System.Math comes to mind). The motivation in general > is to make IP a better producer for CLR types, rather than just a > consumer, and attributes are an increasingly important thing to > support. > > As for expression trees and extension methods, those are to make > IP a better consumer of a very important API (LINQ and the > IQueryable stack from .NET 3.5). > > To be honest, once those 3 features are available in IP, I think > it would be on par with the mainstream languages in being very > usable in an exclusive sense. > > -----Original Message----- > From: users-bounces at lists.ironpython.com > > [mailto:users-bounces at lists.ironpython.com > ] On Behalf Of Harry > Pierson > Sent: Sunday, July 20, 2008 11:14 PM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython Post 2.0 Roadmap > > Can you give me some examples where you would use these? The > problem I see is that many scenarios (WCF contracts, XML > serialization just to name two) where people want to use a custom > attribute depends on the availability of a static type. > > Harry > > -----Original Message----- > From: users-bounces at lists.ironpython.com > > [mailto:users-bounces at lists.ironpython.com > ] On Behalf Of Keith J. > Farmer > Sent: Saturday, July 19, 2008 8:13 PM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython Post 2.0 Roadmap > > votes++ > > -----Original Message----- > From: users-bounces at lists.ironpython.com > > [mailto:users-bounces at lists.ironpython.com > ] On Behalf Of Michael > Foord > Sent: Saturday, July 19, 2008 10:38 AM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython Post 2.0 Roadmap > > Sanghyeon Seo wrote: > > 2008/7/20 Harry Pierson >: > > > >> Hosting features are all done via the DLR, so that's a separate > team. As for > >> "ability to interact with the rest of the .Net framework", can > you be more > >> specific about what you're looking for in that space? What > *isn't* IPy doing > >> that you want it to? > >> > > > > .NET attributes? > > > > > +1 :-) > > Michael > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ _______________________________________________ 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 kfarmer at thuban.org Thu Jul 24 04:39:26 2008 From: kfarmer at thuban.org (Keith J. Farmer) Date: Wed, 23 Jul 2008 19:39:26 -0700 Subject: [IronPython] IronPython Post 2.0 Roadmap References: <4875EF83.80805@voidspace.org.uk> <4882265D.10804@voidspace.org.uk><4884E7E0.80200@voidspace.org.uk> Message-ID: As for relevency, it's a lack of these features that keep me from actually having a great use for what (was) my favorite language until C# came along. :) It turns out that much/all of the code I write today (LINQ providers, controls, etc) relies on attributes and reflection. Unless IP/DLR starts publishing this, what I write actually can't be used in a single-dynamic-langauge environment. And yet, particularly with LINQ providers, dynamic languages would be a *great* environment from which to use them. (I'll consider Expression<> and Func<> as seperate issues from this.) So, in the end, it's not really static type generation as much as it is support for the standard reflection API as well as attributes. ________________________________ From: users-bounces at lists.ironpython.com on behalf of Curt Hagenlocher Sent: Wed 7/23/2008 4:39 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap So, we had a brief hallway discussion today about this topic, and the upshot is that I'm interested in hearing your "real world" use cases for a) attributes, and b) static type generation in general By "use case", I mean a scenario that's specifically relevant to you today. By "relevant", I mean that it would be *nice* to be able to write a PowerShell extension in Python, but if you didn't end up writing the extension in another language, then it doesn't really count for what I'm looking for. :) On Mon, Jul 21, 2008 at 4:16 PM, Keith J. Farmer wrote: We are talking about *new* features, but you're limiting yourself to existing APIs? If, for the sake of working nicely with the DLR, the existing reflection API needs to be modified to deal with a more dynamic world, that's not outside the realm of possibility in my books. After all, there has always been talk of IP being able to expose static types for consumption outside of IP. I don't see that this is any less possible now than it was at the start. Incidentally, Type is an abstract class. Also, ParameterInfo isn't sealed, and implements ICustomerAttributeProvider, which is a public interface: public interface ICustomAttributeProvider { // Methods object [] GetCustomAttributes (bool inherit); object [] GetCustomAttributes (Type attributeType, bool inherit); bool IsDefined (Type attributeType, bool inherit); } So I think, actually, that this could be done without changing much if any external API. They'd probably need to change some of the internals to return dynamic variants of the info types, but I think that's doable. ________________________________ From: users-bounces at lists.ironpython.com on behalf of Harry Pierson Sent: Mon 7/21/2008 12:59 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap All of the many overloads of GetCustomAttributes (http://msdn.microsoft.com/en-us/library/system.attribute.getcustomattributes(VS.85).aspx) need some type of static type info (Type, MemberInfo, ParameterInfo). So supporting custom attributes would require some type of static class as Michael mentions below. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Monday, July 21, 2008 12:48 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap Keith J. Farmer wrote: > Attributes can be applied to more than just types -- members, > parameters, return values (as I recall), etc. But those all presuppose a static type - right? IronPython could generate a static class in the compile phase where .NET attributes are used. Python decorator syntax could be used - class decorators are now part of Python 2.6 and no-one would object to you sneaking them into Python 2.5... Parameter and return type attributes could still use a method decorator to apply them. Michael > > ------------------------------------------------------------------------ > *From:* users-bounces at lists.ironpython.com on behalf of Curt Hagenlocher > *Sent:* Mon 7/21/2008 9:51 AM > *To:* Discussion of IronPython > *Subject:* Re: [IronPython] IronPython Post 2.0 Roadmap > > "Availability of a static type" not because IronPython would need to > access one but because it would need to expose one. > > > On Mon, Jul 21, 2008 at 9:44 AM, Keith J. Farmer > wrote: > > You can create your own attribute classes, for whatever markup. > Particularly since LINQ-to-*, where they often are used to > annotate data classes with strings, etc (not references to types). > > In any event, why does "availability of a static type" enter into > this? IP can access static types just as well as any other .NET > language (System.Math comes to mind). The motivation in general > is to make IP a better producer for CLR types, rather than just a > consumer, and attributes are an increasingly important thing to > support. > > As for expression trees and extension methods, those are to make > IP a better consumer of a very important API (LINQ and the > IQueryable stack from .NET 3.5). > > To be honest, once those 3 features are available in IP, I think > it would be on par with the mainstream languages in being very > usable in an exclusive sense. > > -----Original Message----- > From: users-bounces at lists.ironpython.com > > [mailto:users-bounces at lists.ironpython.com > ] On Behalf Of Harry > Pierson > Sent: Sunday, July 20, 2008 11:14 PM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython Post 2.0 Roadmap > > Can you give me some examples where you would use these? The > problem I see is that many scenarios (WCF contracts, XML > serialization just to name two) where people want to use a custom > attribute depends on the availability of a static type. > > Harry > > -----Original Message----- > From: users-bounces at lists.ironpython.com > > [mailto:users-bounces at lists.ironpython.com > ] On Behalf Of Keith J. > Farmer > Sent: Saturday, July 19, 2008 8:13 PM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython Post 2.0 Roadmap > > votes++ > > -----Original Message----- > From: users-bounces at lists.ironpython.com > > [mailto:users-bounces at lists.ironpython.com > ] On Behalf Of Michael > Foord > Sent: Saturday, July 19, 2008 10:38 AM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython Post 2.0 Roadmap > > Sanghyeon Seo wrote: > > 2008/7/20 Harry Pierson >: > > > >> Hosting features are all done via the DLR, so that's a separate > team. As for > >> "ability to interact with the rest of the .Net framework", can > you be more > >> specific about what you're looking for in that space? What > *isn't* IPy doing > >> that you want it to? > >> > > > > .NET attributes? > > > > > +1 :-) > > Michael > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ _______________________________________________ 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 dinov at exchange.microsoft.com Thu Jul 24 04:40:30 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 23 Jul 2008 19:40:30 -0700 Subject: [IronPython] IronPython Post 2.0 Roadmap In-Reply-To: References: <4875EF83.80805@voidspace.org.uk> <4882265D.10804@voidspace.org.uk><4884E7E0.80200@voidspace.org.uk> Message-ID: <7AD436E4270DD54A94238001769C2227012C935C0443@DF-GRTDANE-MSG.exchange.corp.microsoft.com> The only problem w/ the existing Type and MemberInfo classes is that they all require inheritance demands to inherit from them. That prevents us from subclassing them in anything core because it won't work in Silverlight or other partial trust scenarios. But it is something we've been working w/ the CLR team on getting fixed so we'll be able to take that approach in the future - there's other areas where it'd be useful as well. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Keith J. Farmer Sent: Wednesday, July 23, 2008 7:30 PM To: Discussion of IronPython; Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap I can answer both in one: To be able to use IronPython to create data classes, marked up with attributes, to be consumed by APIs probably written in something other than IronPython. That's it.. quite simple. Example of such an API: LINQ to SQL. Or LINQ to whatever, since outside of of Objects and XML, things pretty much end up with mapping metadata and attributes are one of the first places to look for that. And so, in light of the DLR effort, and the general push to make the static languages be able to work well with the dynamics, I think it's only right that the DLR languages be able to expose their dynamic types in such as way as to be transparent to the static languages. That's why I pointed out that Type is an abstract class and the MemberInfo subclasses themselves appear to be subclassable. It really appears that the API is there, waiting to be implemented. Otherwise, really, the dynamic languages are completely unusable for certain APIs -- they just don't interact with the reflection API in such a way that libraries can consume in a reasonable, language-neutral manner. ________________________________ From: users-bounces at lists.ironpython.com on behalf of Curt Hagenlocher Sent: Wed 7/23/2008 4:39 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap So, we had a brief hallway discussion today about this topic, and the upshot is that I'm interested in hearing your "real world" use cases for a) attributes, and b) static type generation in general By "use case", I mean a scenario that's specifically relevant to you today. By "relevant", I mean that it would be *nice* to be able to write a PowerShell extension in Python, but if you didn't end up writing the extension in another language, then it doesn't really count for what I'm looking for. :) On Mon, Jul 21, 2008 at 4:16 PM, Keith J. Farmer > wrote: We are talking about *new* features, but you're limiting yourself to existing APIs? If, for the sake of working nicely with the DLR, the existing reflection API needs to be modified to deal with a more dynamic world, that's not outside the realm of possibility in my books. After all, there has always been talk of IP being able to expose static types for consumption outside of IP. I don't see that this is any less possible now than it was at the start. Incidentally, Type is an abstract class. Also, ParameterInfo isn't sealed, and implements ICustomerAttributeProvider, which is a public interface: public interface ICustomAttributeProvider { // Methods object [] GetCustomAttributes (bool inherit); object [] GetCustomAttributes (Type attributeType, bool inherit); bool IsDefined (Type attributeType, bool inherit); } So I think, actually, that this could be done without changing much if any external API. They'd probably need to change some of the internals to return dynamic variants of the info types, but I think that's doable. ________________________________ From: users-bounces at lists.ironpython.com on behalf of Harry Pierson Sent: Mon 7/21/2008 12:59 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap All of the many overloads of GetCustomAttributes (http://msdn.microsoft.com/en-us/library/system.attribute.getcustomattributes(VS.85).aspx) need some type of static type info (Type, MemberInfo, ParameterInfo). So supporting custom attributes would require some type of static class as Michael mentions below. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Monday, July 21, 2008 12:48 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap Keith J. Farmer wrote: > Attributes can be applied to more than just types -- members, > parameters, return values (as I recall), etc. But those all presuppose a static type - right? IronPython could generate a static class in the compile phase where .NET attributes are used. Python decorator syntax could be used - class decorators are now part of Python 2.6 and no-one would object to you sneaking them into Python 2.5... Parameter and return type attributes could still use a method decorator to apply them. Michael > > ------------------------------------------------------------------------ > *From:* users-bounces at lists.ironpython.com on behalf of Curt Hagenlocher > *Sent:* Mon 7/21/2008 9:51 AM > *To:* Discussion of IronPython > *Subject:* Re: [IronPython] IronPython Post 2.0 Roadmap > > "Availability of a static type" not because IronPython would need to > access one but because it would need to expose one. > > > On Mon, Jul 21, 2008 at 9:44 AM, Keith J. Farmer > >> wrote: > > You can create your own attribute classes, for whatever markup. > Particularly since LINQ-to-*, where they often are used to > annotate data classes with strings, etc (not references to types). > > In any event, why does "availability of a static type" enter into > this? IP can access static types just as well as any other .NET > language (System.Math comes to mind). The motivation in general > is to make IP a better producer for CLR types, rather than just a > consumer, and attributes are an increasingly important thing to > support. > > As for expression trees and extension methods, those are to make > IP a better consumer of a very important API (LINQ and the > IQueryable stack from .NET 3.5). > > To be honest, once those 3 features are available in IP, I think > it would be on par with the mainstream languages in being very > usable in an exclusive sense. > > -----Original Message----- > From: users-bounces at lists.ironpython.com > > > [mailto:users-bounces at lists.ironpython.com > >] On Behalf Of Harry > Pierson > Sent: Sunday, July 20, 2008 11:14 PM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython Post 2.0 Roadmap > > Can you give me some examples where you would use these? The > problem I see is that many scenarios (WCF contracts, XML > serialization just to name two) where people want to use a custom > attribute depends on the availability of a static type. > > Harry > > -----Original Message----- > From: users-bounces at lists.ironpython.com > > > [mailto:users-bounces at lists.ironpython.com > >] On Behalf Of Keith J. > Farmer > Sent: Saturday, July 19, 2008 8:13 PM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython Post 2.0 Roadmap > > votes++ > > -----Original Message----- > From: users-bounces at lists.ironpython.com > > > [mailto:users-bounces at lists.ironpython.com > >] On Behalf Of Michael > Foord > Sent: Saturday, July 19, 2008 10:38 AM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython Post 2.0 Roadmap > > Sanghyeon Seo wrote: > > 2008/7/20 Harry Pierson > >>: > > > >> Hosting features are all done via the DLR, so that's a separate > team. As for > >> "ability to interact with the rest of the .Net framework", can > you be more > >> specific about what you're looking for in that space? What > *isn't* IPy doing > >> that you want it to? > >> > > > > .NET attributes? > > > > > +1 :-) > > Michael > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ _______________________________________________ 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 falcon at uwyo.edu Thu Jul 24 06:20:04 2008 From: falcon at uwyo.edu (Michael Stephens) Date: Wed, 23 Jul 2008 22:20:04 -0600 Subject: [IronPython] Inserting TABs (was Re: VS Shell Addin for IronPython Studio) In-Reply-To: <92fc6620807231546x4de38985r4a86945480d4f953@mail.gmail.com> References: <92fc6620807231456w389178b4xcff517bba55ce851@mail.gmail.com> <92fc6620807231546x4de38985r4a86945480d4f953@mail.gmail.com> Message-ID: We can step between languages. You just need to have the files in your solution. Michael Stephens Electrical Engineering Graduate Student University of Wyoming falcon at uwyo.edu or 89iroc at gmail.com On Wed, Jul 23, 2008 at 4:46 PM, Carl Cerecke wrote: > OK. > > I find it really useful to be able to step from python into C# code > and back (lest you think I only complain :) > > With the 6 issues I mentioned fixed it will be a really outstanding > product. > > Cheers, > Carl. > > On Thu, Jul 24, 2008 at 10:05 AM, Oleg Tkachenko > wrote: > > Sure, IronPython Studio currently is a sample quality code, but we are > working on making it a real product. Thanks for reporting bugs. > > What I meant saying "just works" is extending it with addins in > integrated mode. > > > > -- > > Oleg > > > > > > -----Original Message----- > > From: users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] On Behalf Of Carl Cerecke > > Sent: Wednesday, July 23, 2008 2:57 PM > > To: Discussion of IronPython > > Subject: [IronPython] Inserting TABs (was Re: VS Shell Addin for > IronPython Studio) > > > > Since the topic of IronPython Studio has come up... > > > > On Thu, Jul 24, 2008 at 5:12 AM, Oleg Tkachenko > wrote: > >> In Integrated mode (when IronPython Studio isn't > >> standalone installation, but part of Visual Studio) extending scenario > just > >> works. > > > > It doesn't quite 'just work' for me. Some things are great, but others > > are frustrating: > > 1. The text editor will insert TABs from time to time in the first > > column. (even though prefs have 'Insert tabs as spaces' set). > > 2. Stepping through in the debugger, the 'show next' statement is > > sometimes incorrect > > 3. The watch window and immediate window are mostly useless while > > execution is paused. I can't see the value of most python vars. > > 4. F11 won't step into called functions (well, it does, but it goes > > through half a dozen assembly instructions first) > > 5. The auto-complete is both too eager (e.g. for statements), and not > > intelligent enough (this is a hard problem, though) > > 6. The interactive IronPython Console can be useful, but it would be > > great if it could somehow attach to the interpreter of a paused app so > > I could inspect variables and execute statements. > > > > Any ideas how to fix any these problems, please let me know. > > > > Cheers, > > Carl. > > -- > > Carl Cerecke, PhD > > Senior Software Engineer > > > > Telogis, Intelligent Location Technology > > Level 2, Building 2 > > 1 Show Place > > Addington > > CHRISTCHURCH > > New Zealand > > > > Phone: +64 03 339 2825 ext 208 > > Fax: +64 03 339 4537 > > Email: carl.cerecke at telogis.com > > > > This message (including any attachments) contains confidential > > information intended for a specific individual and purpose, and is > > protected by law. If you are not the intended recipient, you should > > delete this message and are hereby notified that any disclosure, > > copying, or distribution of this message, or the taking of any action > > based on it, is strictly prohibited. > > _______________________________________________ > > 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 > > > > > > -- > Carl Cerecke, PhD > Senior Software Engineer > > Telogis, Intelligent Location Technology > Level 2, Building 2 > 1 Show Place > Addington > CHRISTCHURCH > New Zealand > > Phone: +64 03 339 2825 ext 208 > Fax: +64 03 339 4537 > Email: carl.cerecke at telogis.com > > This message (including any attachments) contains confidential > information intended for a specific individual and purpose, and is > protected by law. If you are not the intended recipient, you should > delete this message and are hereby notified that any disclosure, > copying, or distribution of this message, or the taking of any action > based on it, is strictly prohibited. > _______________________________________________ > 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 carl.cerecke at telogis.com Thu Jul 24 06:47:29 2008 From: carl.cerecke at telogis.com (Carl Cerecke) Date: Thu, 24 Jul 2008 16:47:29 +1200 Subject: [IronPython] Inserting TABs (was Re: VS Shell Addin for IronPython Studio) In-Reply-To: References: <92fc6620807231456w389178b4xcff517bba55ce851@mail.gmail.com> <92fc6620807231546x4de38985r4a86945480d4f953@mail.gmail.com> Message-ID: <92fc6620807232147sb97a7d1p34ef93a9e12029b1@mail.gmail.com> Yes, I know. I was saying that that was a feature I find useful, not that I wanted implemented. I was just being ambiguous about it, sorry. Cheers, Carl. On Thu, Jul 24, 2008 at 4:20 PM, Michael Stephens wrote: > We can step between languages. You just need to have the files in your > solution. > Michael Stephens > > Electrical Engineering Graduate Student > University of Wyoming > falcon at uwyo.edu or 89iroc at gmail.com > > On Wed, Jul 23, 2008 at 4:46 PM, Carl Cerecke > wrote: >> >> OK. >> >> I find it really useful to be able to step from python into C# code >> and back (lest you think I only complain :) >> >> With the 6 issues I mentioned fixed it will be a really outstanding >> product. >> >> Cheers, >> Carl. >> >> On Thu, Jul 24, 2008 at 10:05 AM, Oleg Tkachenko >> wrote: >> > Sure, IronPython Studio currently is a sample quality code, but we are >> > working on making it a real product. Thanks for reporting bugs. >> > What I meant saying "just works" is extending it with addins in >> > integrated mode. >> > >> > -- >> > Oleg >> > >> > >> > -----Original Message----- >> > From: users-bounces at lists.ironpython.com >> > [mailto:users-bounces at lists.ironpython.com] On Behalf Of Carl Cerecke >> > Sent: Wednesday, July 23, 2008 2:57 PM >> > To: Discussion of IronPython >> > Subject: [IronPython] Inserting TABs (was Re: VS Shell Addin for >> > IronPython Studio) >> > >> > Since the topic of IronPython Studio has come up... >> > >> > On Thu, Jul 24, 2008 at 5:12 AM, Oleg Tkachenko >> > wrote: >> >> In Integrated mode (when IronPython Studio isn't >> >> standalone installation, but part of Visual Studio) extending scenario >> >> just >> >> works. >> > >> > It doesn't quite 'just work' for me. Some things are great, but others >> > are frustrating: >> > 1. The text editor will insert TABs from time to time in the first >> > column. (even though prefs have 'Insert tabs as spaces' set). >> > 2. Stepping through in the debugger, the 'show next' statement is >> > sometimes incorrect >> > 3. The watch window and immediate window are mostly useless while >> > execution is paused. I can't see the value of most python vars. >> > 4. F11 won't step into called functions (well, it does, but it goes >> > through half a dozen assembly instructions first) >> > 5. The auto-complete is both too eager (e.g. for statements), and not >> > intelligent enough (this is a hard problem, though) >> > 6. The interactive IronPython Console can be useful, but it would be >> > great if it could somehow attach to the interpreter of a paused app so >> > I could inspect variables and execute statements. >> > >> > Any ideas how to fix any these problems, please let me know. >> > >> > Cheers, >> > Carl. >> > -- >> > Carl Cerecke, PhD >> > Senior Software Engineer >> > >> > Telogis, Intelligent Location Technology >> > Level 2, Building 2 >> > 1 Show Place >> > Addington >> > CHRISTCHURCH >> > New Zealand >> > >> > Phone: +64 03 339 2825 ext 208 >> > Fax: +64 03 339 4537 >> > Email: carl.cerecke at telogis.com >> > >> > This message (including any attachments) contains confidential >> > information intended for a specific individual and purpose, and is >> > protected by law. If you are not the intended recipient, you should >> > delete this message and are hereby notified that any disclosure, >> > copying, or distribution of this message, or the taking of any action >> > based on it, is strictly prohibited. >> > _______________________________________________ >> > 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 >> > >> >> >> >> -- >> Carl Cerecke, PhD >> Senior Software Engineer >> >> Telogis, Intelligent Location Technology >> Level 2, Building 2 >> 1 Show Place >> Addington >> CHRISTCHURCH >> New Zealand >> >> Phone: +64 03 339 2825 ext 208 >> Fax: +64 03 339 4537 >> Email: carl.cerecke at telogis.com >> >> This message (including any attachments) contains confidential >> information intended for a specific individual and purpose, and is >> protected by law. If you are not the intended recipient, you should >> delete this message and are hereby notified that any disclosure, >> copying, or distribution of this message, or the taking of any action >> based on it, is strictly prohibited. >> _______________________________________________ >> 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 > > -- Carl Cerecke, PhD Senior Software Engineer Telogis, Intelligent Location Technology Level 2, Building 2 1 Show Place Addington CHRISTCHURCH New Zealand Phone: +64 03 339 2825 ext 208 Fax: +64 03 339 4537 Email: carl.cerecke at telogis.com This message (including any attachments) contains confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, you should delete this message and are hereby notified that any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited. From Harry.Pierson at microsoft.com Thu Jul 24 07:39:11 2008 From: Harry.Pierson at microsoft.com (Harry Pierson) Date: Wed, 23 Jul 2008 22:39:11 -0700 Subject: [IronPython] (no subject) In-Reply-To: <92fc6620807232147sb97a7d1p34ef93a9e12029b1@mail.gmail.com> References: <92fc6620807231456w389178b4xcff517bba55ce851@mail.gmail.com> <92fc6620807231546x4de38985r4a86945480d4f953@mail.gmail.com> <92fc6620807232147sb97a7d1p34ef93a9e12029b1@mail.gmail.com> Message-ID: The CodePlex team just shipped mailing list support for project discussions. Details are available at http://blogs.msdn.com/codeplex/archive/2008/07/23/codeplex-project-discussions-mailing-lists.aspx. While we've had this mailing list for years, I've spoken to the CodePlex team and it should be possible to make the switch over to the CodePlex infrastructure. However, I wouldn't want to make a change like that without getting some feedback from the community at large. If you've got a strong opinion about CodePlex mailing lists one way or another, please let me know. Harry Pierson Senior Program Mangager, IronPython Visual Studio Managed Languages email : harry.pierson at microsoft.com office : 425/705-6045 mobile : 425/761-0293 weblog : http://devhawk.net "Don't worry about people stealing your ideas. If your ideas are any good, you'll have to ram them down people's throats." - Howard Aiken From kfarmer at thuban.org Thu Jul 24 07:58:02 2008 From: kfarmer at thuban.org (Keith J. Farmer) Date: Wed, 23 Jul 2008 22:58:02 -0700 Subject: [IronPython] (no subject) In-Reply-To: References: <92fc6620807231456w389178b4xcff517bba55ce851@mail.gmail.com><92fc6620807231546x4de38985r4a86945480d4f953@mail.gmail.com><92fc6620807232147sb97a7d1p34ef93a9e12029b1@mail.gmail.com> Message-ID: I don't suppose this list could be used as a gateway (effectively making the transition transparent)? -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Harry Pierson Sent: Wednesday, July 23, 2008 10:39 PM To: Discussion of IronPython Subject: [IronPython] (no subject) The CodePlex team just shipped mailing list support for project discussions. Details are available at http://blogs.msdn.com/codeplex/archive/2008/07/23/codeplex-project-discussions-mailing-lists.aspx. While we've had this mailing list for years, I've spoken to the CodePlex team and it should be possible to make the switch over to the CodePlex infrastructure. However, I wouldn't want to make a change like that without getting some feedback from the community at large. If you've got a strong opinion about CodePlex mailing lists one way or another, please let me know. Harry Pierson Senior Program Mangager, IronPython Visual Studio Managed Languages email : harry.pierson at microsoft.com office : 425/705-6045 mobile : 425/761-0293 weblog : http://devhawk.net "Don't worry about people stealing your ideas. If your ideas are any good, you'll have to ram them down people's throats." - Howard Aiken _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Shri.Borde at microsoft.com Thu Jul 24 08:05:30 2008 From: Shri.Borde at microsoft.com (Shri Borde) Date: Wed, 23 Jul 2008 23:05:30 -0700 Subject: [IronPython] CLS compilation In-Reply-To: <7AD436E4270DD54A94238001769C2227012C935C0443@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <4875EF83.80805@voidspace.org.uk> <4882265D.10804@voidspace.org.uk><4884E7E0.80200@voidspace.org.uk> <7AD436E4270DD54A94238001769C2227012C935C0443@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <50B69702CA6E6D4E849D30CD4989AB8EE910ECDE74@DF-GRTDANE-MSG.exchange.corp.microsoft.com> I am changing the subject to better reflect the discussion. I have posted a blog at http://blogs.msdn.com/shrib/archive/2008/07/24/cls-compilation-of-ironpython.aspx discussing some issues I see. Keith, as far as exposing IronPython types as System.Type, its not just a question of inheriting from System.Type. If we did just that, the resulting Type would not be usable from important APIs like Activator.CreateInstance, from IL instructions like newobj, etc. because the CLR has special knowledge about the System.Type object it creates from metadata. Also, LINQ to SQL does look like an interesting scenario. I mention this at the end of the blog. However, the reason to collect real use cases is to know exactly what features are needed. Supporting the full range of CLS features may not be necessary. Knowing how folks are wanting to use the feature can guide the design of the feature in the future. For example LINQ to SQL only needs CustomAttributes on types but not on methods AFAIK. This may could make a significant difference as support CustomAttributes on method is much more complicated. So do send in other use cases you have run into... From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Wednesday, July 23, 2008 7:41 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap The only problem w/ the existing Type and MemberInfo classes is that they all require inheritance demands to inherit from them. That prevents us from subclassing them in anything core because it won't work in Silverlight or other partial trust scenarios. But it is something we've been working w/ the CLR team on getting fixed so we'll be able to take that approach in the future - there's other areas where it'd be useful as well. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Keith J. Farmer Sent: Wednesday, July 23, 2008 7:30 PM To: Discussion of IronPython; Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap I can answer both in one: To be able to use IronPython to create data classes, marked up with attributes, to be consumed by APIs probably written in something other than IronPython. That's it.. quite simple. Example of such an API: LINQ to SQL. Or LINQ to whatever, since outside of of Objects and XML, things pretty much end up with mapping metadata and attributes are one of the first places to look for that. And so, in light of the DLR effort, and the general push to make the static languages be able to work well with the dynamics, I think it's only right that the DLR languages be able to expose their dynamic types in such as way as to be transparent to the static languages. That's why I pointed out that Type is an abstract class and the MemberInfo subclasses themselves appear to be subclassable. It really appears that the API is there, waiting to be implemented. Otherwise, really, the dynamic languages are completely unusable for certain APIs -- they just don't interact with the reflection API in such a way that libraries can consume in a reasonable, language-neutral manner. ________________________________ From: users-bounces at lists.ironpython.com on behalf of Curt Hagenlocher Sent: Wed 7/23/2008 4:39 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap So, we had a brief hallway discussion today about this topic, and the upshot is that I'm interested in hearing your "real world" use cases for a) attributes, and b) static type generation in general By "use case", I mean a scenario that's specifically relevant to you today. By "relevant", I mean that it would be *nice* to be able to write a PowerShell extension in Python, but if you didn't end up writing the extension in another language, then it doesn't really count for what I'm looking for. :) On Mon, Jul 21, 2008 at 4:16 PM, Keith J. Farmer > wrote: We are talking about *new* features, but you're limiting yourself to existing APIs? If, for the sake of working nicely with the DLR, the existing reflection API needs to be modified to deal with a more dynamic world, that's not outside the realm of possibility in my books. After all, there has always been talk of IP being able to expose static types for consumption outside of IP. I don't see that this is any less possible now than it was at the start. Incidentally, Type is an abstract class. Also, ParameterInfo isn't sealed, and implements ICustomerAttributeProvider, which is a public interface: public interface ICustomAttributeProvider { // Methods object [] GetCustomAttributes (bool inherit); object [] GetCustomAttributes (Type attributeType, bool inherit); bool IsDefined (Type attributeType, bool inherit); } So I think, actually, that this could be done without changing much if any external API. They'd probably need to change some of the internals to return dynamic variants of the info types, but I think that's doable. ________________________________ From: users-bounces at lists.ironpython.com on behalf of Harry Pierson Sent: Mon 7/21/2008 12:59 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap All of the many overloads of GetCustomAttributes (http://msdn.microsoft.com/en-us/library/system.attribute.getcustomattributes(VS.85).aspx) need some type of static type info (Type, MemberInfo, ParameterInfo). So supporting custom attributes would require some type of static class as Michael mentions below. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Monday, July 21, 2008 12:48 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap Keith J. Farmer wrote: > Attributes can be applied to more than just types -- members, > parameters, return values (as I recall), etc. But those all presuppose a static type - right? IronPython could generate a static class in the compile phase where .NET attributes are used. Python decorator syntax could be used - class decorators are now part of Python 2.6 and no-one would object to you sneaking them into Python 2.5... Parameter and return type attributes could still use a method decorator to apply them. Michael > > ------------------------------------------------------------------------ > *From:* users-bounces at lists.ironpython.com on behalf of Curt Hagenlocher > *Sent:* Mon 7/21/2008 9:51 AM > *To:* Discussion of IronPython > *Subject:* Re: [IronPython] IronPython Post 2.0 Roadmap > > "Availability of a static type" not because IronPython would need to > access one but because it would need to expose one. > > > On Mon, Jul 21, 2008 at 9:44 AM, Keith J. Farmer > >> wrote: > > You can create your own attribute classes, for whatever markup. > Particularly since LINQ-to-*, where they often are used to > annotate data classes with strings, etc (not references to types). > > In any event, why does "availability of a static type" enter into > this? IP can access static types just as well as any other .NET > language (System.Math comes to mind). The motivation in general > is to make IP a better producer for CLR types, rather than just a > consumer, and attributes are an increasingly important thing to > support. > > As for expression trees and extension methods, those are to make > IP a better consumer of a very important API (LINQ and the > IQueryable stack from .NET 3.5). > > To be honest, once those 3 features are available in IP, I think > it would be on par with the mainstream languages in being very > usable in an exclusive sense. > > -----Original Message----- > From: users-bounces at lists.ironpython.com > > > [mailto:users-bounces at lists.ironpython.com > >] On Behalf Of Harry > Pierson > Sent: Sunday, July 20, 2008 11:14 PM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython Post 2.0 Roadmap > > Can you give me some examples where you would use these? The > problem I see is that many scenarios (WCF contracts, XML > serialization just to name two) where people want to use a custom > attribute depends on the availability of a static type. > > Harry > > -----Original Message----- > From: users-bounces at lists.ironpython.com > > > [mailto:users-bounces at lists.ironpython.com > >] On Behalf Of Keith J. > Farmer > Sent: Saturday, July 19, 2008 8:13 PM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython Post 2.0 Roadmap > > votes++ > > -----Original Message----- > From: users-bounces at lists.ironpython.com > > > [mailto:users-bounces at lists.ironpython.com > >] On Behalf Of Michael > Foord > Sent: Saturday, July 19, 2008 10:38 AM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython Post 2.0 Roadmap > > Sanghyeon Seo wrote: > > 2008/7/20 Harry Pierson > >>: > > > >> Hosting features are all done via the DLR, so that's a separate > team. As for > >> "ability to interact with the rest of the .Net framework", can > you be more > >> specific about what you're looking for in that space? What > *isn't* IPy doing > >> that you want it to? > >> > > > > .NET attributes? > > > > > +1 :-) > > Michael > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ _______________________________________________ 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 kfarmer at thuban.org Thu Jul 24 09:38:29 2008 From: kfarmer at thuban.org (Keith J. Farmer) Date: Thu, 24 Jul 2008 00:38:29 -0700 Subject: [IronPython] CLS compilation In-Reply-To: <50B69702CA6E6D4E849D30CD4989AB8EE910ECDE74@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <4875EF83.80805@voidspace.org.uk><4882265D.10804@voidspace.org.uk><4884E7E0.80200@voidspace.org.uk><7AD436E4270DD54A94238001769C2227012C935C0443@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <50B69702CA6E6D4E849D30CD4989AB8EE910ECDE74@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: LINQ to SQL needs custom attributes on members, including methods (to map columns and UDFs). Of course, we?d also need Expression support as a matter of usability. You *could* construct expressions manually ? nobody would bother. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Shri Borde Sent: Wednesday, July 23, 2008 11:06 PM To: Discussion of IronPython Subject: [IronPython] CLS compilation I am changing the subject to better reflect the discussion. I have posted a blog at http://blogs.msdn.com/shrib/archive/2008/07/24/cls-compilation-of-ironpython.aspx discussing some issues I see. Keith, as far as exposing IronPython types as System.Type, its not just a question of inheriting from System.Type. If we did just that, the resulting Type would not be usable from important APIs like Activator.CreateInstance, from IL instructions like newobj, etc. because the CLR has special knowledge about the System.Type object it creates from metadata. Also, LINQ to SQL does look like an interesting scenario. I mention this at the end of the blog. However, the reason to collect real use cases is to know exactly what features are needed. Supporting the full range of CLS features may not be necessary. Knowing how folks are wanting to use the feature can guide the design of the feature in the future. For example LINQ to SQL only needs CustomAttributes on types but not on methods AFAIK. This may could make a significant difference as support CustomAttributes on method is much more complicated. So do send in other use cases you have run into? From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Wednesday, July 23, 2008 7:41 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap The only problem w/ the existing Type and MemberInfo classes is that they all require inheritance demands to inherit from them. That prevents us from subclassing them in anything core because it won?t work in Silverlight or other partial trust scenarios. But it is something we?ve been working w/ the CLR team on getting fixed so we?ll be able to take that approach in the future ? there?s other areas where it?d be useful as well. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Keith J. Farmer Sent: Wednesday, July 23, 2008 7:30 PM To: Discussion of IronPython; Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap I can answer both in one: To be able to use IronPython to create data classes, marked up with attributes, to be consumed by APIs probably written in something other than IronPython. That's it.. quite simple. Example of such an API: LINQ to SQL. Or LINQ to whatever, since outside of of Objects and XML, things pretty much end up with mapping metadata and attributes are one of the first places to look for that. And so, in light of the DLR effort, and the general push to make the static languages be able to work well with the dynamics, I think it's only right that the DLR languages be able to expose their dynamic types in such as way as to be transparent to the static languages. That's why I pointed out that Type is an abstract class and the MemberInfo subclasses themselves appear to be subclassable. It really appears that the API is there, waiting to be implemented. Otherwise, really, the dynamic languages are completely unusable for certain APIs -- they just don't interact with the reflection API in such a way that libraries can consume in a reasonable, language-neutral manner. ________________________________ From: users-bounces at lists.ironpython.com on behalf of Curt Hagenlocher Sent: Wed 7/23/2008 4:39 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap So, we had a brief hallway discussion today about this topic, and the upshot is that I'm interested in hearing your "real world" use cases for a) attributes, and b) static type generation in general By "use case", I mean a scenario that's specifically relevant to you today. By "relevant", I mean that it would be *nice* to be able to write a PowerShell extension in Python, but if you didn't end up writing the extension in another language, then it doesn't really count for what I'm looking for. :) On Mon, Jul 21, 2008 at 4:16 PM, Keith J. Farmer wrote: We are talking about *new* features, but you're limiting yourself to existing APIs? If, for the sake of working nicely with the DLR, the existing reflection API needs to be modified to deal with a more dynamic world, that's not outside the realm of possibility in my books. After all, there has always been talk of IP being able to expose static types for consumption outside of IP. I don't see that this is any less possible now than it was at the start. Incidentally, Type is an abstract class. Also, ParameterInfo isn't sealed, and implements ICustomerAttributeProvider, which is a public interface: public interface ICustomAttributeProvider { // Methods object [] GetCustomAttributes (bool inherit); object [] GetCustomAttributes (Type attributeType, bool inherit); bool IsDefined (Type attributeType, bool inherit); } So I think, actually, that this could be done without changing much if any external API. They'd probably need to change some of the internals to return dynamic variants of the info types, but I think that's doable. ________________________________ From: users-bounces at lists.ironpython.com on behalf of Harry Pierson Sent: Mon 7/21/2008 12:59 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap All of the many overloads of GetCustomAttributes (http://msdn.microsoft.com/en-us/library/system.attribute.getcustomattributes(VS.85).aspx) need some type of static type info (Type, MemberInfo, ParameterInfo). So supporting custom attributes would require some type of static class as Michael mentions below. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Monday, July 21, 2008 12:48 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap Keith J. Farmer wrote: > Attributes can be applied to more than just types -- members, > parameters, return values (as I recall), etc. But those all presuppose a static type - right? IronPython could generate a static class in the compile phase where .NET attributes are used. Python decorator syntax could be used - class decorators are now part of Python 2.6 and no-one would object to you sneaking them into Python 2.5... Parameter and return type attributes could still use a method decorator to apply them. Michael > > ------------------------------------------------------------------------ > *From:* users-bounces at lists.ironpython.com on behalf of Curt Hagenlocher > *Sent:* Mon 7/21/2008 9:51 AM > *To:* Discussion of IronPython > *Subject:* Re: [IronPython] IronPython Post 2.0 Roadmap > > "Availability of a static type" not because IronPython would need to > access one but because it would need to expose one. > > > On Mon, Jul 21, 2008 at 9:44 AM, Keith J. Farmer > wrote: > > You can create your own attribute classes, for whatever markup. > Particularly since LINQ-to-*, where they often are used to > annotate data classes with strings, etc (not references to types). > > In any event, why does "availability of a static type" enter into > this? IP can access static types just as well as any other .NET > language (System.Math comes to mind). The motivation in general > is to make IP a better producer for CLR types, rather than just a > consumer, and attributes are an increasingly important thing to > support. > > As for expression trees and extension methods, those are to make > IP a better consumer of a very important API (LINQ and the > IQueryable stack from .NET 3.5). > > To be honest, once those 3 features are available in IP, I think > it would be on par with the mainstream languages in being very > usable in an exclusive sense. > > -----Original Message----- > From: users-bounces at lists.ironpython.com > > [mailto:users-bounces at lists.ironpython.com > ] On Behalf Of Harry > Pierson > Sent: Sunday, July 20, 2008 11:14 PM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython Post 2.0 Roadmap > > Can you give me some examples where you would use these? The > problem I see is that many scenarios (WCF contracts, XML > serialization just to name two) where people want to use a custom > attribute depends on the availability of a static type. > > Harry > > -----Original Message----- > From: users-bounces at lists.ironpython.com > > [mailto:users-bounces at lists.ironpython.com > ] On Behalf Of Keith J. > Farmer > Sent: Saturday, July 19, 2008 8:13 PM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython Post 2.0 Roadmap > > votes++ > > -----Original Message----- > From: users-bounces at lists.ironpython.com > > [mailto:users-bounces at lists.ironpython.com > ] On Behalf Of Michael > Foord > Sent: Saturday, July 19, 2008 10:38 AM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython Post 2.0 Roadmap > > Sanghyeon Seo wrote: > > 2008/7/20 Harry Pierson >: > > > >> Hosting features are all done via the DLR, so that's a separate > team. As for > >> "ability to interact with the rest of the .Net framework", can > you be more > >> specific about what you're looking for in that space? What > *isn't* IPy doing > >> that you want it to? > >> > > > > .NET attributes? > > > > > +1 :-) > > Michael > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ _______________________________________________ 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 kfarmer at thuban.org Thu Jul 24 09:45:34 2008 From: kfarmer at thuban.org (Keith J. Farmer) Date: Thu, 24 Jul 2008 00:45:34 -0700 Subject: [IronPython] CLS compilation In-Reply-To: <50B69702CA6E6D4E849D30CD4989AB8EE910ECDE74@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <4875EF83.80805@voidspace.org.uk><4882265D.10804@voidspace.org.uk><4884E7E0.80200@voidspace.org.uk><7AD436E4270DD54A94238001769C2227012C935C0443@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <50B69702CA6E6D4E849D30CD4989AB8EE910ECDE74@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: As for the rest.. fix the CLR! ;) I would *presume* that changes in certain APIs as well as the runtime would be necessary to truly make .NET dynamic-language-friendly. There?s only so far you can go, after all, without it. I?ll also respond privately with other stuff. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Shri Borde Sent: Wednesday, July 23, 2008 11:06 PM To: Discussion of IronPython Subject: [IronPython] CLS compilation I am changing the subject to better reflect the discussion. I have posted a blog at http://blogs.msdn.com/shrib/archive/2008/07/24/cls-compilation-of-ironpython.aspx discussing some issues I see. Keith, as far as exposing IronPython types as System.Type, its not just a question of inheriting from System.Type. If we did just that, the resulting Type would not be usable from important APIs like Activator.CreateInstance, from IL instructions like newobj, etc. because the CLR has special knowledge about the System.Type object it creates from metadata. Also, LINQ to SQL does look like an interesting scenario. I mention this at the end of the blog. However, the reason to collect real use cases is to know exactly what features are needed. Supporting the full range of CLS features may not be necessary. Knowing how folks are wanting to use the feature can guide the design of the feature in the future. For example LINQ to SQL only needs CustomAttributes on types but not on methods AFAIK. This may could make a significant difference as support CustomAttributes on method is much more complicated. So do send in other use cases you have run into? From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Wednesday, July 23, 2008 7:41 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap The only problem w/ the existing Type and MemberInfo classes is that they all require inheritance demands to inherit from them. That prevents us from subclassing them in anything core because it won?t work in Silverlight or other partial trust scenarios. But it is something we?ve been working w/ the CLR team on getting fixed so we?ll be able to take that approach in the future ? there?s other areas where it?d be useful as well. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Keith J. Farmer Sent: Wednesday, July 23, 2008 7:30 PM To: Discussion of IronPython; Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap I can answer both in one: To be able to use IronPython to create data classes, marked up with attributes, to be consumed by APIs probably written in something other than IronPython. That's it.. quite simple. Example of such an API: LINQ to SQL. Or LINQ to whatever, since outside of of Objects and XML, things pretty much end up with mapping metadata and attributes are one of the first places to look for that. And so, in light of the DLR effort, and the general push to make the static languages be able to work well with the dynamics, I think it's only right that the DLR languages be able to expose their dynamic types in such as way as to be transparent to the static languages. That's why I pointed out that Type is an abstract class and the MemberInfo subclasses themselves appear to be subclassable. It really appears that the API is there, waiting to be implemented. Otherwise, really, the dynamic languages are completely unusable for certain APIs -- they just don't interact with the reflection API in such a way that libraries can consume in a reasonable, language-neutral manner. ________________________________ From: users-bounces at lists.ironpython.com on behalf of Curt Hagenlocher Sent: Wed 7/23/2008 4:39 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap So, we had a brief hallway discussion today about this topic, and the upshot is that I'm interested in hearing your "real world" use cases for a) attributes, and b) static type generation in general By "use case", I mean a scenario that's specifically relevant to you today. By "relevant", I mean that it would be *nice* to be able to write a PowerShell extension in Python, but if you didn't end up writing the extension in another language, then it doesn't really count for what I'm looking for. :) On Mon, Jul 21, 2008 at 4:16 PM, Keith J. Farmer wrote: We are talking about *new* features, but you're limiting yourself to existing APIs? If, for the sake of working nicely with the DLR, the existing reflection API needs to be modified to deal with a more dynamic world, that's not outside the realm of possibility in my books. After all, there has always been talk of IP being able to expose static types for consumption outside of IP. I don't see that this is any less possible now than it was at the start. Incidentally, Type is an abstract class. Also, ParameterInfo isn't sealed, and implements ICustomerAttributeProvider, which is a public interface: public interface ICustomAttributeProvider { // Methods object [] GetCustomAttributes (bool inherit); object [] GetCustomAttributes (Type attributeType, bool inherit); bool IsDefined (Type attributeType, bool inherit); } So I think, actually, that this could be done without changing much if any external API. They'd probably need to change some of the internals to return dynamic variants of the info types, but I think that's doable. ________________________________ From: users-bounces at lists.ironpython.com on behalf of Harry Pierson Sent: Mon 7/21/2008 12:59 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap All of the many overloads of GetCustomAttributes (http://msdn.microsoft.com/en-us/library/system.attribute.getcustomattributes(VS.85).aspx) need some type of static type info (Type, MemberInfo, ParameterInfo). So supporting custom attributes would require some type of static class as Michael mentions below. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Monday, July 21, 2008 12:48 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap Keith J. Farmer wrote: > Attributes can be applied to more than just types -- members, > parameters, return values (as I recall), etc. But those all presuppose a static type - right? IronPython could generate a static class in the compile phase where .NET attributes are used. Python decorator syntax could be used - class decorators are now part of Python 2.6 and no-one would object to you sneaking them into Python 2.5... Parameter and return type attributes could still use a method decorator to apply them. Michael > > ------------------------------------------------------------------------ > *From:* users-bounces at lists.ironpython.com on behalf of Curt Hagenlocher > *Sent:* Mon 7/21/2008 9:51 AM > *To:* Discussion of IronPython > *Subject:* Re: [IronPython] IronPython Post 2.0 Roadmap > > "Availability of a static type" not because IronPython would need to > access one but because it would need to expose one. > > > On Mon, Jul 21, 2008 at 9:44 AM, Keith J. Farmer > wrote: > > You can create your own attribute classes, for whatever markup. > Particularly since LINQ-to-*, where they often are used to > annotate data classes with strings, etc (not references to types). > > In any event, why does "availability of a static type" enter into > this? IP can access static types just as well as any other .NET > language (System.Math comes to mind). The motivation in general > is to make IP a better producer for CLR types, rather than just a > consumer, and attributes are an increasingly important thing to > support. > > As for expression trees and extension methods, those are to make > IP a better consumer of a very important API (LINQ and the > IQueryable stack from .NET 3.5). > > To be honest, once those 3 features are available in IP, I think > it would be on par with the mainstream languages in being very > usable in an exclusive sense. > > -----Original Message----- > From: users-bounces at lists.ironpython.com > > [mailto:users-bounces at lists.ironpython.com > ] On Behalf Of Harry > Pierson > Sent: Sunday, July 20, 2008 11:14 PM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython Post 2.0 Roadmap > > Can you give me some examples where you would use these? The > problem I see is that many scenarios (WCF contracts, XML > serialization just to name two) where people want to use a custom > attribute depends on the availability of a static type. > > Harry > > -----Original Message----- > From: users-bounces at lists.ironpython.com > > [mailto:users-bounces at lists.ironpython.com > ] On Behalf Of Keith J. > Farmer > Sent: Saturday, July 19, 2008 8:13 PM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython Post 2.0 Roadmap > > votes++ > > -----Original Message----- > From: users-bounces at lists.ironpython.com > > [mailto:users-bounces at lists.ironpython.com > ] On Behalf Of Michael > Foord > Sent: Saturday, July 19, 2008 10:38 AM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython Post 2.0 Roadmap > > Sanghyeon Seo wrote: > > 2008/7/20 Harry Pierson >: > > > >> Hosting features are all done via the DLR, so that's a separate > team. As for > >> "ability to interact with the rest of the .Net framework", can > you be more > >> specific about what you're looking for in that space? What > *isn't* IPy doing > >> that you want it to? > >> > > > > .NET attributes? > > > > > +1 :-) > > Michael > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ _______________________________________________ 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 fuzzyman at voidspace.org.uk Thu Jul 24 10:24:39 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 24 Jul 2008 09:24:39 +0100 Subject: [IronPython] Switching Mailing List to CodePlex In-Reply-To: References: <92fc6620807231456w389178b4xcff517bba55ce851@mail.gmail.com> <92fc6620807231546x4de38985r4a86945480d4f953@mail.gmail.com> <92fc6620807232147sb97a7d1p34ef93a9e12029b1@mail.gmail.com> Message-ID: <48883C47.2070405@voidspace.org.uk> Harry Pierson wrote: > The CodePlex team just shipped mailing list support for project discussions. Details are available at http://blogs.msdn.com/codeplex/archive/2008/07/23/codeplex-project-discussions-mailing-lists.aspx. > > While we've had this mailing list for years, I've spoken to the CodePlex team and it should be possible to make the switch over to the CodePlex infrastructure. However, I wouldn't want to make a change like that without getting some feedback from the community at large. > > If you've got a strong opinion about CodePlex mailing lists one way or another, please let me know. > > Is there any *advantage* to switching? This list works fine and is linked to from many places. I'd be -1 on a switch just for the sake of it Michael Foord > Harry Pierson > Senior Program Mangager, IronPython > Visual Studio Managed Languages > > email : harry.pierson at microsoft.com > office : 425/705-6045 > mobile : 425/761-0293 > weblog : http://devhawk.net > > "Don't worry about people stealing your ideas. > If your ideas are any good, > you'll have to ram them down people's throats." > - Howard Aiken > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.resolverhacks.net/ http://wwww.theotherdelia.co.uk/ From curt at hagenlocher.org Thu Jul 24 16:39:52 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Thu, 24 Jul 2008 07:39:52 -0700 Subject: [IronPython] CLS compilation In-Reply-To: References: <4875EF83.80805@voidspace.org.uk> <4884E7E0.80200@voidspace.org.uk> <7AD436E4270DD54A94238001769C2227012C935C0443@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <50B69702CA6E6D4E849D30CD4989AB8EE910ECDE74@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: The assumption of static typing is baked pretty heavily into the existing CLR metadata APIs. Consider this runtime scenario; an application has a reference to an object o. It calls o.GetType() to get its type, then uses reflection to get a MethodInfo for the method "foo". What does this MethodInfo mean if the foo method on the Python type is changed? Or removed from the type entirely? Or overridden for just this one particular instance of the type? And this is just one example of the semantic gap between static and dynamic types; it's easy to think of others -- like the fact that the line between properties and methods is often blurred in dynamic languages. So it probably doesn't make sense to just say "fix the CLR", no matter how pithy it sounds :). And such a project is likely to be a multiyear undertaking anyway, which doesn't help anyone who's got scenarios today that they need to see addressed. That's why we want to understand what those scenarios are; to make sure that we can provide some kind of solution -- whether that's through changes to IronPython or some sample code or even simple guidance. Bottom line: keep those use cases coming! On Thu, Jul 24, 2008 at 12:45 AM, Keith J. Farmer wrote: > As for the rest.. fix the CLR! ;) > > > > I would **presume** that changes in certain APIs as well as the runtime > would be necessary to truly make .NET dynamic-language-friendly. There's > only so far you can go, after all, without it. > > > > I'll also respond privately with other stuff. > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Shri Borde > *Sent:* Wednesday, July 23, 2008 11:06 PM > *To:* Discussion of IronPython > *Subject:* [IronPython] CLS compilation > > > > I am changing the subject to better reflect the discussion. I have posted a > blog at > http://blogs.msdn.com/shrib/archive/2008/07/24/cls-compilation-of-ironpython.aspxdiscussing some issues I see. > > > > Keith, as far as exposing IronPython types as System.Type, its not just a > question of inheriting from System.Type. If we did just that, the resulting > Type would not be usable from important APIs like Activator.CreateInstance, > from IL instructions like newobj, etc. because the CLR has special knowledge > about the System.Type object it creates from metadata. > > > > Also, LINQ to SQL does look like an interesting scenario. I mention this at > the end of the blog. However, the reason to collect real use cases is to > know exactly what features are needed. Supporting the full range of CLS > features may not be necessary. Knowing how folks are wanting to use the > feature can guide the design of the feature in the future. For example LINQ > to SQL only needs CustomAttributes on types but not on methods AFAIK. This > may could make a significant difference as support CustomAttributes on > method is much more complicated. > > > > So do send in other use cases you have run into? > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Dino Viehland > *Sent:* Wednesday, July 23, 2008 7:41 PM > *To:* Discussion of IronPython > *Subject:* Re: [IronPython] IronPython Post 2.0 Roadmap > > > > The only problem w/ the existing Type and MemberInfo classes is that they > all require inheritance demands to inherit from them. That prevents us from > subclassing them in anything core because it won't work in Silverlight or > other partial trust scenarios. But it is something we've been working w/ > the CLR team on getting fixed so we'll be able to take that approach in the > future ? there's other areas where it'd be useful as well. > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Keith J. Farmer > *Sent:* Wednesday, July 23, 2008 7:30 PM > *To:* Discussion of IronPython; Discussion of IronPython > *Subject:* Re: [IronPython] IronPython Post 2.0 Roadmap > > > > I can answer both in one: To be able to use IronPython to create data > classes, marked up with attributes, to be consumed by APIs probably written > in something other than IronPython. > > > > That's it.. quite simple. > > > > Example of such an API: LINQ to SQL. Or LINQ to whatever, since outside > of of Objects and XML, things pretty much end up with mapping metadata and > attributes are one of the first places to look for that. > > > > And so, in light of the DLR effort, and the general push to make the static > languages be able to work well with the dynamics, I think it's only right > that the DLR languages be able to expose their dynamic types in such as way > as to be transparent to the static languages. That's why I pointed out that > Type is an abstract class and the MemberInfo subclasses themselves appear to > be subclassable. It really appears that the API is there, waiting to be > implemented. > > > > Otherwise, really, the dynamic languages are completely unusable for > certain APIs -- they just don't interact with the reflection API in such a > way that libraries can consume in a reasonable, language-neutral manner. > > > ------------------------------ > > *From:* users-bounces at lists.ironpython.com on behalf of Curt Hagenlocher > *Sent:* Wed 7/23/2008 4:39 PM > *To:* Discussion of IronPython > *Subject:* Re: [IronPython] IronPython Post 2.0 Roadmap > > So, we had a brief hallway discussion today about this topic, and the > upshot is that I'm interested in hearing your "real world" use cases for > > a) attributes, and > > b) static type generation in general > > > > By "use case", I mean a scenario that's specifically relevant to you > today. By "relevant", I mean that it would be *nice* to be able to write a > PowerShell extension in Python, but if you didn't end up writing the > extension in another language, then it doesn't really count for what I'm > looking for. :) > > On Mon, Jul 21, 2008 at 4:16 PM, Keith J. Farmer > wrote: > > We are talking about *new* features, but you're limiting yourself to > existing APIs? > > If, for the sake of working nicely with the DLR, the existing reflection > API needs to be modified to deal with a more dynamic world, that's not > outside the realm of possibility in my books. After all, there has always > been talk of IP being able to expose static types for consumption outside of > IP. I don't see that this is any less possible now than it was at the > start. > > Incidentally, Type is an abstract class. Also, ParameterInfo isn't sealed, > and implements ICustomerAttributeProvider, which is a public interface: > > public interface ICustomAttributeProvider < > http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Reflection.ICustomAttributeProvider > > > { > // Methods > object < > http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Object> > [] GetCustomAttributes < > http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Reflection.ICustomAttributeProvider/GetCustomAttributes(Boolean):Object%5b%5d> > (bool < > http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Boolean> > inherit); > object < > http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Object> > [] GetCustomAttributes < > http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Reflection.ICustomAttributeProvider/GetCustomAttributes(System.Type,Boolean):Object%5b%5d> > (Type < > http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Type> > attributeType, bool < > http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Boolean> > inherit); > bool < > http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Boolean> > IsDefined < > http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Reflection.ICustomAttributeProvider/IsDefined(System.Type,Boolean):Boolean> > (Type < > http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Type> > attributeType, bool < > http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:2.0.0.0:b77a5c561934e089/System.Boolean> > inherit); > } > > > So I think, actually, that this could be done without changing much if any > external API. They'd probably need to change some of the internals to > return dynamic variants of the info types, but I think that's doable. > > ________________________________ > > From: users-bounces at lists.ironpython.com on behalf of Harry Pierson > Sent: Mon 7/21/2008 12:59 PM > > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython Post 2.0 Roadmap > > > > All of the many overloads of GetCustomAttributes ( > http://msdn.microsoft.com/en-us/library/system.attribute.getcustomattributes(VS.85).aspx) > need some type of static type info (Type, MemberInfo, ParameterInfo). So > supporting custom attributes would require some type of static class as > Michael mentions below. > > > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Monday, July 21, 2008 12:48 PM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython Post 2.0 Roadmap > > Keith J. Farmer wrote: > > Attributes can be applied to more than just types -- members, > > parameters, return values (as I recall), etc. > > But those all presuppose a static type - right? > > IronPython could generate a static class in the compile phase where .NET > attributes are used. Python decorator syntax could be used - class > decorators are now part of Python 2.6 and no-one would object to you > sneaking them into Python 2.5... > > Parameter and return type attributes could still use a method decorator > to apply them. > > Michael > > > > > ------------------------------------------------------------------------ > > *From:* users-bounces at lists.ironpython.com on behalf of Curt Hagenlocher > > *Sent:* Mon 7/21/2008 9:51 AM > > *To:* Discussion of IronPython > > *Subject:* Re: [IronPython] IronPython Post 2.0 Roadmap > > > > "Availability of a static type" not because IronPython would need to > > access one but because it would need to expose one. > > > > > > On Mon, Jul 21, 2008 at 9:44 AM, Keith J. Farmer > > wrote: > > > > You can create your own attribute classes, for whatever markup. > > Particularly since LINQ-to-*, where they often are used to > > annotate data classes with strings, etc (not references to types). > > > > In any event, why does "availability of a static type" enter into > > this? IP can access static types just as well as any other .NET > > language (System.Math comes to mind). The motivation in general > > is to make IP a better producer for CLR types, rather than just a > > consumer, and attributes are an increasingly important thing to > > support. > > > > As for expression trees and extension methods, those are to make > > IP a better consumer of a very important API (LINQ and the > > IQueryable stack from .NET 3.5). > > > > To be honest, once those 3 features are available in IP, I think > > it would be on par with the mainstream languages in being very > > usable in an exclusive sense. > > > > -----Original Message----- > > From: users-bounces at lists.ironpython.com > > > > [mailto:users-bounces at lists.ironpython.com > > ] On Behalf Of Harry > > Pierson > > Sent: Sunday, July 20, 2008 11:14 PM > > To: Discussion of IronPython > > Subject: Re: [IronPython] IronPython Post 2.0 Roadmap > > > > Can you give me some examples where you would use these? The > > problem I see is that many scenarios (WCF contracts, XML > > serialization just to name two) where people want to use a custom > > attribute depends on the availability of a static type. > > > > Harry > > > > -----Original Message----- > > From: users-bounces at lists.ironpython.com > > > > [mailto:users-bounces at lists.ironpython.com > > ] On Behalf Of Keith J. > > Farmer > > Sent: Saturday, July 19, 2008 8:13 PM > > To: Discussion of IronPython > > Subject: Re: [IronPython] IronPython Post 2.0 Roadmap > > > > votes++ > > > > -----Original Message----- > > From: users-bounces at lists.ironpython.com > > > > [mailto:users-bounces at lists.ironpython.com > > ] On Behalf Of Michael > > Foord > > Sent: Saturday, July 19, 2008 10:38 AM > > To: Discussion of IronPython > > Subject: Re: [IronPython] IronPython Post 2.0 Roadmap > > > > Sanghyeon Seo wrote: > > > 2008/7/20 Harry Pierson > >: > > > > > >> Hosting features are all done via the DLR, so that's a separate > > team. As for > > >> "ability to interact with the rest of the .Net framework", can > > you be more > > >> specific about what you're looking for in that space? What > > *isn't* IPy doing > > >> that you want it to? > > >> > > > > > > .NET attributes? > > > > > > > > +1 :-) > > > > Michael > > > > -- > > http://www.ironpythoninaction.com/ > > http://www.voidspace.org.uk/ > > http://www.trypython.org/ > > http://www.ironpython.info/ > > http://www.theotherdelia.co.uk/ > > http://www.resolverhacks.net/ > > > > _______________________________________________ > > 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 > > > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 dinov at exchange.microsoft.com Thu Jul 24 17:59:24 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Thu, 24 Jul 2008 08:59:24 -0700 Subject: [IronPython] Switching Mailing List to CodePlex In-Reply-To: <48883C47.2070405@voidspace.org.uk> References: <92fc6620807231456w389178b4xcff517bba55ce851@mail.gmail.com> <92fc6620807231546x4de38985r4a86945480d4f953@mail.gmail.com> <92fc6620807232147sb97a7d1p34ef93a9e12029b1@mail.gmail.com> <48883C47.2070405@voidspace.org.uk> Message-ID: <7AD436E4270DD54A94238001769C2227012C935C04CB@DF-GRTDANE-MSG.exchange.corp.microsoft.com> I believe the advantage would be the discussions would be accessible from the web site as well as the mailing list. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Thursday, July 24, 2008 1:25 AM To: Discussion of IronPython Subject: [IronPython] Switching Mailing List to CodePlex Harry Pierson wrote: > The CodePlex team just shipped mailing list support for project discussions. Details are available at http://blogs.msdn.com/codeplex/archive/2008/07/23/codeplex-project-discussions-mailing-lists.aspx. > > While we've had this mailing list for years, I've spoken to the CodePlex team and it should be possible to make the switch over to the CodePlex infrastructure. However, I wouldn't want to make a change like that without getting some feedback from the community at large. > > If you've got a strong opinion about CodePlex mailing lists one way or another, please let me know. > > Is there any *advantage* to switching? This list works fine and is linked to from many places. I'd be -1 on a switch just for the sake of it Michael Foord > Harry Pierson > Senior Program Mangager, IronPython > Visual Studio Managed Languages > > email : harry.pierson at microsoft.com > office : 425/705-6045 > mobile : 425/761-0293 > weblog : http://devhawk.net > > "Don't worry about people stealing your ideas. > If your ideas are any good, > you'll have to ram them down people's throats." > - Howard Aiken > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.resolverhacks.net/ http://wwww.theotherdelia.co.uk/ _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From kfarmer at thuban.org Thu Jul 24 18:07:10 2008 From: kfarmer at thuban.org (Keith J. Farmer) Date: Thu, 24 Jul 2008 09:07:10 -0700 Subject: [IronPython] CLS compilation In-Reply-To: References: <4875EF83.80805@voidspace.org.uk><4884E7E0.80200@voidspace.org.uk><7AD436E4270DD54A94238001769C2227012C935C0443@DF-GRTDANE-MSG.exchange.corp.microsoft.com><50B69702CA6E6D4E849D30CD4989AB8EE910ECDE74@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: I understand multi-year undertakings. I was involved in one, myself, if you recall. J From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Curt Hagenlocher Sent: Thursday, July 24, 2008 7:40 AM To: Discussion of IronPython Subject: Re: [IronPython] CLS compilation The assumption of static typing is baked pretty heavily into the existing CLR metadata APIs. Consider this runtime scenario; an application has a reference to an object o. It calls o.GetType() to get its type, then uses reflection to get a MethodInfo for the method "foo". What does this MethodInfo mean if the foo method on the Python type is changed? Or removed from the type entirely? Or overridden for just this one particular instance of the type? And this is just one example of the semantic gap between static and dynamic types; it's easy to think of others -- like the fact that the line between properties and methods is often blurred in dynamic languages. So it probably doesn't make sense to just say "fix the CLR", no matter how pithy it sounds :). And such a project is likely to be a multiyear undertaking anyway, which doesn't help anyone who's got scenarios today that they need to see addressed. That's why we want to understand what those scenarios are; to make sure that we can provide some kind of solution -- whether that's through changes to IronPython or some sample code or even simple guidance. Bottom line: keep those use cases coming! On Thu, Jul 24, 2008 at 12:45 AM, Keith J. Farmer wrote: As for the rest.. fix the CLR! ;) I would *presume* that changes in certain APIs as well as the runtime would be necessary to truly make .NET dynamic-language-friendly. There's only so far you can go, after all, without it. I'll also respond privately with other stuff. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Shri Borde Sent: Wednesday, July 23, 2008 11:06 PM To: Discussion of IronPython Subject: [IronPython] CLS compilation I am changing the subject to better reflect the discussion. I have posted a blog at http://blogs.msdn.com/shrib/archive/2008/07/24/cls-compilation-of-ironpy thon.aspx discussing some issues I see. Keith, as far as exposing IronPython types as System.Type, its not just a question of inheriting from System.Type. If we did just that, the resulting Type would not be usable from important APIs like Activator.CreateInstance, from IL instructions like newobj, etc. because the CLR has special knowledge about the System.Type object it creates from metadata. Also, LINQ to SQL does look like an interesting scenario. I mention this at the end of the blog. However, the reason to collect real use cases is to know exactly what features are needed. Supporting the full range of CLS features may not be necessary. Knowing how folks are wanting to use the feature can guide the design of the feature in the future. For example LINQ to SQL only needs CustomAttributes on types but not on methods AFAIK. This may could make a significant difference as support CustomAttributes on method is much more complicated. So do send in other use cases you have run into... From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Wednesday, July 23, 2008 7:41 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap The only problem w/ the existing Type and MemberInfo classes is that they all require inheritance demands to inherit from them. That prevents us from subclassing them in anything core because it won't work in Silverlight or other partial trust scenarios. But it is something we've been working w/ the CLR team on getting fixed so we'll be able to take that approach in the future - there's other areas where it'd be useful as well. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Keith J. Farmer Sent: Wednesday, July 23, 2008 7:30 PM To: Discussion of IronPython; Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap I can answer both in one: To be able to use IronPython to create data classes, marked up with attributes, to be consumed by APIs probably written in something other than IronPython. That's it.. quite simple. Example of such an API: LINQ to SQL. Or LINQ to whatever, since outside of of Objects and XML, things pretty much end up with mapping metadata and attributes are one of the first places to look for that. And so, in light of the DLR effort, and the general push to make the static languages be able to work well with the dynamics, I think it's only right that the DLR languages be able to expose their dynamic types in such as way as to be transparent to the static languages. That's why I pointed out that Type is an abstract class and the MemberInfo subclasses themselves appear to be subclassable. It really appears that the API is there, waiting to be implemented. Otherwise, really, the dynamic languages are completely unusable for certain APIs -- they just don't interact with the reflection API in such a way that libraries can consume in a reasonable, language-neutral manner. ________________________________ From: users-bounces at lists.ironpython.com on behalf of Curt Hagenlocher Sent: Wed 7/23/2008 4:39 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap So, we had a brief hallway discussion today about this topic, and the upshot is that I'm interested in hearing your "real world" use cases for a) attributes, and b) static type generation in general By "use case", I mean a scenario that's specifically relevant to you today. By "relevant", I mean that it would be *nice* to be able to write a PowerShell extension in Python, but if you didn't end up writing the extension in another language, then it doesn't really count for what I'm looking for. :) On Mon, Jul 21, 2008 at 4:16 PM, Keith J. Farmer wrote: We are talking about *new* features, but you're limiting yourself to existing APIs? If, for the sake of working nicely with the DLR, the existing reflection API needs to be modified to deal with a more dynamic world, that's not outside the realm of possibility in my books. After all, there has always been talk of IP being able to expose static types for consumption outside of IP. I don't see that this is any less possible now than it was at the start. Incidentally, Type is an abstract class. Also, ParameterInfo isn't sealed, and implements ICustomerAttributeProvider, which is a public interface: public interface ICustomAttributeProvider { // Methods object [] GetCustomAttributes (bool inherit); object [] GetCustomAttributes (Type attributeType, bool inherit); bool IsDefined (Type attributeType, bool inherit); } So I think, actually, that this could be done without changing much if any external API. They'd probably need to change some of the internals to return dynamic variants of the info types, but I think that's doable. ________________________________ From: users-bounces at lists.ironpython.com on behalf of Harry Pierson Sent: Mon 7/21/2008 12:59 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap All of the many overloads of GetCustomAttributes (http://msdn.microsoft.com/en-us/library/system.attribute.getcustomattri butes(VS.85).aspx) need some type of static type info (Type, MemberInfo, ParameterInfo). So supporting custom attributes would require some type of static class as Michael mentions below. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Monday, July 21, 2008 12:48 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap Keith J. Farmer wrote: > Attributes can be applied to more than just types -- members, > parameters, return values (as I recall), etc. But those all presuppose a static type - right? IronPython could generate a static class in the compile phase where .NET attributes are used. Python decorator syntax could be used - class decorators are now part of Python 2.6 and no-one would object to you sneaking them into Python 2.5... Parameter and return type attributes could still use a method decorator to apply them. Michael > > ------------------------------------------------------------------------ > *From:* users-bounces at lists.ironpython.com on behalf of Curt Hagenlocher > *Sent:* Mon 7/21/2008 9:51 AM > *To:* Discussion of IronPython > *Subject:* Re: [IronPython] IronPython Post 2.0 Roadmap > > "Availability of a static type" not because IronPython would need to > access one but because it would need to expose one. > > > On Mon, Jul 21, 2008 at 9:44 AM, Keith J. Farmer > wrote: > > You can create your own attribute classes, for whatever markup. > Particularly since LINQ-to-*, where they often are used to > annotate data classes with strings, etc (not references to types). > > In any event, why does "availability of a static type" enter into > this? IP can access static types just as well as any other .NET > language (System.Math comes to mind). The motivation in general > is to make IP a better producer for CLR types, rather than just a > consumer, and attributes are an increasingly important thing to > support. > > As for expression trees and extension methods, those are to make > IP a better consumer of a very important API (LINQ and the > IQueryable stack from .NET 3.5). > > To be honest, once those 3 features are available in IP, I think > it would be on par with the mainstream languages in being very > usable in an exclusive sense. > > -----Original Message----- > From: users-bounces at lists.ironpython.com > > [mailto:users-bounces at lists.ironpython.com > ] On Behalf Of Harry > Pierson > Sent: Sunday, July 20, 2008 11:14 PM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython Post 2.0 Roadmap > > Can you give me some examples where you would use these? The > problem I see is that many scenarios (WCF contracts, XML > serialization just to name two) where people want to use a custom > attribute depends on the availability of a static type. > > Harry > > -----Original Message----- > From: users-bounces at lists.ironpython.com > > [mailto:users-bounces at lists.ironpython.com > ] On Behalf Of Keith J. > Farmer > Sent: Saturday, July 19, 2008 8:13 PM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython Post 2.0 Roadmap > > votes++ > > -----Original Message----- > From: users-bounces at lists.ironpython.com > > [mailto:users-bounces at lists.ironpython.com > ] On Behalf Of Michael > Foord > Sent: Saturday, July 19, 2008 10:38 AM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython Post 2.0 Roadmap > > Sanghyeon Seo wrote: > > 2008/7/20 Harry Pierson >: > > > >> Hosting features are all done via the DLR, so that's a separate > team. As for > >> "ability to interact with the rest of the .Net framework", can > you be more > >> specific about what you're looking for in that space? What > *isn't* IPy doing > >> that you want it to? > >> > > > > .NET attributes? > > > > > +1 :-) > > Michael > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ _______________________________________________ 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 curt at hagenlocher.org Thu Jul 24 18:18:05 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Thu, 24 Jul 2008 09:18:05 -0700 Subject: [IronPython] CLS compilation In-Reply-To: References: <4875EF83.80805@voidspace.org.uk> <7AD436E4270DD54A94238001769C2227012C935C0443@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <50B69702CA6E6D4E849D30CD4989AB8EE910ECDE74@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: On Thu, Jul 24, 2008 at 9:07 AM, Keith J. Farmer wrote: > > I understand multi-year undertakings. I was involved in one, myself, if you > recall. J No, I didn't -- but I do now :). -- Curt Hagenlocher curt at hagenlocher.org From kfarmer at thuban.org Thu Jul 24 18:30:24 2008 From: kfarmer at thuban.org (Keith J. Farmer) Date: Thu, 24 Jul 2008 09:30:24 -0700 Subject: [IronPython] CLS compilation In-Reply-To: References: <4875EF83.80805@voidspace.org.uk><4884E7E0.80200@voidspace.org.uk><7AD436E4270DD54A94238001769C2227012C935C0443@DF-GRTDANE-MSG.exchange.corp.microsoft.com><50B69702CA6E6D4E849D30CD4989AB8EE910ECDE74@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: As for "fix the CLR" being pithy: If the intention was that Type never be subclassed by 3rd parties, then Type should never have been made abstract. At most, it should have been sealed, and any polymorphic behavior handled internally using any of the reasonable techniques for doing so. That *not* being the case, newobj should *not* be making such assumptions on Type. So, in this sense, the combination of (CLR + ReflectionAPI) can be said to be broken: the one side implies untrue things about the other. So one or the other needs to give in order to bring Order back (as it were - I've spent way too much time in Northwind the past couple years). My preference would be a change, possibly breaking, to the way the CLR deals with the Type class. Of course, I may be wrong and it may not be breaking, but it may instead just mean the type returned is a snapshot of the type as it exists in the DLR at that time. You would need, obviously, to make the info classes behave like weak references, and include API to detect whether the reference is still valid. You could add other API to say whether it's dynamic at all. There might be a different path involving parallel classes and no CLR changes, but there would still be breaking changes, and it's a worse solution overall, I think. But, in the end, I imagine we'll hear something by PDC about the level of interop they're planning for DLR/CLR languages. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Curt Hagenlocher Sent: Thursday, July 24, 2008 7:40 AM To: Discussion of IronPython Subject: Re: [IronPython] CLS compilation The assumption of static typing is baked pretty heavily into the existing CLR metadata APIs. Consider this runtime scenario; an application has a reference to an object o. It calls o.GetType() to get its type, then uses reflection to get a MethodInfo for the method "foo". What does this MethodInfo mean if the foo method on the Python type is changed? Or removed from the type entirely? Or overridden for just this one particular instance of the type? And this is just one example of the semantic gap between static and dynamic types; it's easy to think of others -- like the fact that the line between properties and methods is often blurred in dynamic languages. So it probably doesn't make sense to just say "fix the CLR", no matter how pithy it sounds :). And such a project is likely to be a multiyear undertaking anyway, which doesn't help anyone who's got scenarios today that they need to see addressed. That's why we want to understand what those scenarios are; to make sure that we can provide some kind of solution -- whether that's through changes to IronPython or some sample code or even simple guidance. Bottom line: keep those use cases coming! On Thu, Jul 24, 2008 at 12:45 AM, Keith J. Farmer wrote: As for the rest.. fix the CLR! ;) I would *presume* that changes in certain APIs as well as the runtime would be necessary to truly make .NET dynamic-language-friendly. There's only so far you can go, after all, without it. I'll also respond privately with other stuff. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Shri Borde Sent: Wednesday, July 23, 2008 11:06 PM To: Discussion of IronPython Subject: [IronPython] CLS compilation I am changing the subject to better reflect the discussion. I have posted a blog at http://blogs.msdn.com/shrib/archive/2008/07/24/cls-compilation-of-ironpy thon.aspx discussing some issues I see. Keith, as far as exposing IronPython types as System.Type, its not just a question of inheriting from System.Type. If we did just that, the resulting Type would not be usable from important APIs like Activator.CreateInstance, from IL instructions like newobj, etc. because the CLR has special knowledge about the System.Type object it creates from metadata. Also, LINQ to SQL does look like an interesting scenario. I mention this at the end of the blog. However, the reason to collect real use cases is to know exactly what features are needed. Supporting the full range of CLS features may not be necessary. Knowing how folks are wanting to use the feature can guide the design of the feature in the future. For example LINQ to SQL only needs CustomAttributes on types but not on methods AFAIK. This may could make a significant difference as support CustomAttributes on method is much more complicated. So do send in other use cases you have run into... From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Wednesday, July 23, 2008 7:41 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap The only problem w/ the existing Type and MemberInfo classes is that they all require inheritance demands to inherit from them. That prevents us from subclassing them in anything core because it won't work in Silverlight or other partial trust scenarios. But it is something we've been working w/ the CLR team on getting fixed so we'll be able to take that approach in the future - there's other areas where it'd be useful as well. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Keith J. Farmer Sent: Wednesday, July 23, 2008 7:30 PM To: Discussion of IronPython; Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap I can answer both in one: To be able to use IronPython to create data classes, marked up with attributes, to be consumed by APIs probably written in something other than IronPython. That's it.. quite simple. Example of such an API: LINQ to SQL. Or LINQ to whatever, since outside of of Objects and XML, things pretty much end up with mapping metadata and attributes are one of the first places to look for that. And so, in light of the DLR effort, and the general push to make the static languages be able to work well with the dynamics, I think it's only right that the DLR languages be able to expose their dynamic types in such as way as to be transparent to the static languages. That's why I pointed out that Type is an abstract class and the MemberInfo subclasses themselves appear to be subclassable. It really appears that the API is there, waiting to be implemented. Otherwise, really, the dynamic languages are completely unusable for certain APIs -- they just don't interact with the reflection API in such a way that libraries can consume in a reasonable, language-neutral manner. ________________________________ From: users-bounces at lists.ironpython.com on behalf of Curt Hagenlocher Sent: Wed 7/23/2008 4:39 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap So, we had a brief hallway discussion today about this topic, and the upshot is that I'm interested in hearing your "real world" use cases for a) attributes, and b) static type generation in general By "use case", I mean a scenario that's specifically relevant to you today. By "relevant", I mean that it would be *nice* to be able to write a PowerShell extension in Python, but if you didn't end up writing the extension in another language, then it doesn't really count for what I'm looking for. :) On Mon, Jul 21, 2008 at 4:16 PM, Keith J. Farmer wrote: We are talking about *new* features, but you're limiting yourself to existing APIs? If, for the sake of working nicely with the DLR, the existing reflection API needs to be modified to deal with a more dynamic world, that's not outside the realm of possibility in my books. After all, there has always been talk of IP being able to expose static types for consumption outside of IP. I don't see that this is any less possible now than it was at the start. Incidentally, Type is an abstract class. Also, ParameterInfo isn't sealed, and implements ICustomerAttributeProvider, which is a public interface: public interface ICustomAttributeProvider { // Methods object [] GetCustomAttributes (bool inherit); object [] GetCustomAttributes (Type attributeType, bool inherit); bool IsDefined (Type attributeType, bool inherit); } So I think, actually, that this could be done without changing much if any external API. They'd probably need to change some of the internals to return dynamic variants of the info types, but I think that's doable. ________________________________ From: users-bounces at lists.ironpython.com on behalf of Harry Pierson Sent: Mon 7/21/2008 12:59 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap All of the many overloads of GetCustomAttributes (http://msdn.microsoft.com/en-us/library/system.attribute.getcustomattri butes(VS.85).aspx) need some type of static type info (Type, MemberInfo, ParameterInfo). So supporting custom attributes would require some type of static class as Michael mentions below. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Monday, July 21, 2008 12:48 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Post 2.0 Roadmap Keith J. Farmer wrote: > Attributes can be applied to more than just types -- members, > parameters, return values (as I recall), etc. But those all presuppose a static type - right? IronPython could generate a static class in the compile phase where .NET attributes are used. Python decorator syntax could be used - class decorators are now part of Python 2.6 and no-one would object to you sneaking them into Python 2.5... Parameter and return type attributes could still use a method decorator to apply them. Michael > > ------------------------------------------------------------------------ > *From:* users-bounces at lists.ironpython.com on behalf of Curt Hagenlocher > *Sent:* Mon 7/21/2008 9:51 AM > *To:* Discussion of IronPython > *Subject:* Re: [IronPython] IronPython Post 2.0 Roadmap > > "Availability of a static type" not because IronPython would need to > access one but because it would need to expose one. > > > On Mon, Jul 21, 2008 at 9:44 AM, Keith J. Farmer > wrote: > > You can create your own attribute classes, for whatever markup. > Particularly since LINQ-to-*, where they often are used to > annotate data classes with strings, etc (not references to types). > > In any event, why does "availability of a static type" enter into > this? IP can access static types just as well as any other .NET > language (System.Math comes to mind). The motivation in general > is to make IP a better producer for CLR types, rather than just a > consumer, and attributes are an increasingly important thing to > support. > > As for expression trees and extension methods, those are to make > IP a better consumer of a very important API (LINQ and the > IQueryable stack from .NET 3.5). > > To be honest, once those 3 features are available in IP, I think > it would be on par with the mainstream languages in being very > usable in an exclusive sense. > > -----Original Message----- > From: users-bounces at lists.ironpython.com > > [mailto:users-bounces at lists.ironpython.com > ] On Behalf Of Harry > Pierson > Sent: Sunday, July 20, 2008 11:14 PM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython Post 2.0 Roadmap > > Can you give me some examples where you would use these? The > problem I see is that many scenarios (WCF contracts, XML > serialization just to name two) where people want to use a custom > attribute depends on the availability of a static type. > > Harry > > -----Original Message----- > From: users-bounces at lists.ironpython.com > > [mailto:users-bounces at lists.ironpython.com > ] On Behalf Of Keith J. > Farmer > Sent: Saturday, July 19, 2008 8:13 PM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython Post 2.0 Roadmap > > votes++ > > -----Original Message----- > From: users-bounces at lists.ironpython.com > > [mailto:users-bounces at lists.ironpython.com > ] On Behalf Of Michael > Foord > Sent: Saturday, July 19, 2008 10:38 AM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython Post 2.0 Roadmap > > Sanghyeon Seo wrote: > > 2008/7/20 Harry Pierson >: > > > >> Hosting features are all done via the DLR, so that's a separate > team. As for > >> "ability to interact with the rest of the .Net framework", can > you be more > >> specific about what you're looking for in that space? What > *isn't* IPy doing > >> that you want it to? > >> > > > > .NET attributes? > > > > > +1 :-) > > Michael > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ _______________________________________________ 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 fuzzyman at voidspace.org.uk Thu Jul 24 18:48:44 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 24 Jul 2008 17:48:44 +0100 Subject: [IronPython] Switching Mailing List to CodePlex In-Reply-To: <7AD436E4270DD54A94238001769C2227012C935C04CB@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <92fc6620807231456w389178b4xcff517bba55ce851@mail.gmail.com> <92fc6620807231546x4de38985r4a86945480d4f953@mail.gmail.com> <92fc6620807232147sb97a7d1p34ef93a9e12029b1@mail.gmail.com> <48883C47.2070405@voidspace.org.uk> <7AD436E4270DD54A94238001769C2227012C935C04CB@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <4888B26C.7090607@voidspace.org.uk> Dino Viehland wrote: > I believe the advantage would be the discussions would be accessible from the web site as well as the mailing list. > The current list is already available for reading on the web via the current list archive and for reading / posting from google groups. Those archives, and links to those archives, would rot if the list was moved... Michael > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Thursday, July 24, 2008 1:25 AM > To: Discussion of IronPython > Subject: [IronPython] Switching Mailing List to CodePlex > > Harry Pierson wrote: > >> The CodePlex team just shipped mailing list support for project discussions. Details are available at http://blogs.msdn.com/codeplex/archive/2008/07/23/codeplex-project-discussions-mailing-lists.aspx. >> >> While we've had this mailing list for years, I've spoken to the CodePlex team and it should be possible to make the switch over to the CodePlex infrastructure. However, I wouldn't want to make a change like that without getting some feedback from the community at large. >> >> If you've got a strong opinion about CodePlex mailing lists one way or another, please let me know. >> >> >> > > Is there any *advantage* to switching? > > This list works fine and is linked to from many places. I'd be -1 on a > switch just for the sake of it > > Michael Foord > >> Harry Pierson >> Senior Program Mangager, IronPython >> Visual Studio Managed Languages >> >> email : harry.pierson at microsoft.com >> office : 425/705-6045 >> mobile : 425/761-0293 >> weblog : http://devhawk.net >> >> "Don't worry about people stealing your ideas. >> If your ideas are any good, >> you'll have to ram them down people's throats." >> - Howard Aiken >> >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.resolverhacks.net/ > http://wwww.theotherdelia.co.uk/ > > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.resolverhacks.net/ http://www.theotherdelia.co.uk/ From graham.bloice at trihedral.com Thu Jul 24 18:59:53 2008 From: graham.bloice at trihedral.com (Graham Bloice) Date: Thu, 24 Jul 2008 17:59:53 +0100 Subject: [IronPython] Switching Mailing List to CodePlex In-Reply-To: <7AD436E4270DD54A94238001769C2227012C935C04CB@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <92fc6620807231456w389178b4xcff517bba55ce851@mail.gmail.com> <92fc6620807231546x4de38985r4a86945480d4f953@mail.gmail.com> <92fc6620807232147sb97a7d1p34ef93a9e12029b1@mail.gmail.com> <48883C47.2070405@voidspace.org.uk> <7AD436E4270DD54A94238001769C2227012C935C04CB@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <4888B509.9020902@trihedral.com> Dino Viehland wrote: > I believe the advantage would be the discussions would be accessible from the web site as well as the mailing list. > > I really don't mean to be elitist but recent experience on another mail list that added a Web interface (not on Codeplex) was that it drastically reduced the signal to noise ratio. -- Regards, Graham Bloice From sanxiyn at gmail.com Fri Jul 25 01:48:46 2008 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Fri, 25 Jul 2008 08:48:46 +0900 Subject: [IronPython] os.system In-Reply-To: <358E5F25E7526644AA6B3324DEB18BDA27C9E95E45@NA-EXMSG-C124.redmond.corp.microsoft.com> References: <358E5F25E7526644AA6B3324DEB18BDA27C9E95E45@NA-EXMSG-C124.redmond.corp.microsoft.com> Message-ID: <5b0248170807241648r54e46439pbc37348ebc038e02@mail.gmail.com> 2008/7/24 John Case (Excell Data Corporation) : > With IronPython, what do I use instead of os.system('dir'), or > os.popen('dir') to achieve the same result? Other people replied with good answers for os.popen/os.system matters, but you can achieve the same result with os.listdir, if what you want to run is just dir. -- Seo Sanghyeon From sanxiyn at gmail.com Fri Jul 25 01:55:07 2008 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Fri, 25 Jul 2008 08:55:07 +0900 Subject: [IronPython] Switching Mailing List to CodePlex In-Reply-To: <48883C47.2070405@voidspace.org.uk> References: <92fc6620807231456w389178b4xcff517bba55ce851@mail.gmail.com> <92fc6620807231546x4de38985r4a86945480d4f953@mail.gmail.com> <92fc6620807232147sb97a7d1p34ef93a9e12029b1@mail.gmail.com> <48883C47.2070405@voidspace.org.uk> Message-ID: <5b0248170807241655s1fe6fb70q610876a4e253d@mail.gmail.com> > If you've got a strong opinion about CodePlex mailing lists one way or > another, please let me know. I am okay with it provided that all previous links to Mailman archive transparently redirects, forever, to the correct place. Otherwise I am strongly against. (I probably made hundreds of links to the archive of this mailing list, and it's only me.) -- Seo Sanghyeon From Harry.Pierson at microsoft.com Fri Jul 25 02:10:35 2008 From: Harry.Pierson at microsoft.com (Harry Pierson) Date: Thu, 24 Jul 2008 17:10:35 -0700 Subject: [IronPython] Switching Mailing List to CodePlex In-Reply-To: <5b0248170807241655s1fe6fb70q610876a4e253d@mail.gmail.com> References: <92fc6620807231456w389178b4xcff517bba55ce851@mail.gmail.com> <92fc6620807231546x4de38985r4a86945480d4f953@mail.gmail.com> <92fc6620807232147sb97a7d1p34ef93a9e12029b1@mail.gmail.com> <48883C47.2070405@voidspace.org.uk> <5b0248170807241655s1fe6fb70q610876a4e253d@mail.gmail.com> Message-ID: Good point Seo, thanks for pointing that out. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Sanghyeon Seo Sent: Thursday, July 24, 2008 4:55 PM To: Discussion of IronPython Subject: Re: [IronPython] Switching Mailing List to CodePlex > If you've got a strong opinion about CodePlex mailing lists one way or > another, please let me know. I am okay with it provided that all previous links to Mailman archive transparently redirects, forever, to the correct place. Otherwise I am strongly against. (I probably made hundreds of links to the archive of this mailing list, and it's only me.) -- Seo Sanghyeon _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From stefan.dobrev at gmail.com Fri Jul 25 08:38:50 2008 From: stefan.dobrev at gmail.com (Stefan Dobrev) Date: Fri, 25 Jul 2008 09:38:50 +0300 Subject: [IronPython] DLR IDE Message-ID: <928de89c0807242338s59aadf34uf29936c844d0c30f@mail.gmail.com> Hi all, Wouldn't be nice if we all create a DLR IDE. I have being thinking for this for quite some times recently. As usually happens someone else also has been thinking of this and actually blogged about it here. Saying: --- So what's my point? I think all of these projects are great and kudos to the people that built them. It takes a lot of time and effort above and beyond just regular work hours. I have been there myself, my hats off to you folks! But, there are 8 versions of the interactive console and a few versions of a basic code editor. I know it may be a dream, but it would be great to collaborate with these people and write out a simple set of requirements for what a great DLR console and code editor would be. And then as a virtual team, implement it. After all, to a large degree, it will be how well supported the language is from a tools perspective that will really determine the rate of adoption. And right now, the tools (or IDE) experience for Dynamic Languages on .NET is severely lacking to the point of having several people independently developing their own tooling. In this post I only pointed out a handful of these tools and I know there are others, but I was really targeting web-based IDE's. Maybe that is an opportunity? Or is it a pipe dream? --- So let's come together and build a difference. I have made the first step and created a project on codeplex - http://codeplex.com/dlride. I have also written some basic requirements for the project in the wiki. Let we all collaborate on them. For everyone who want to take a part, please feel free to contact me, so I can give you permissions for the project on codeplex. Regards, Stefan -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben2004uk at googlemail.com Fri Jul 25 11:33:46 2008 From: ben2004uk at googlemail.com (Ben Hall) Date: Fri, 25 Jul 2008 10:33:46 +0100 Subject: [IronPython] [Ironruby-core] DLR IDE In-Reply-To: <928de89c0807242338s59aadf34uf29936c844d0c30f@mail.gmail.com> References: <928de89c0807242338s59aadf34uf29936c844d0c30f@mail.gmail.com> Message-ID: Hi Stefan, An interesting approach - you want people to collaborate so you start a new project? When writing the editors, people have lots of different reasons for doing so - not everyone wants to create an IDE, some people just want to create a cool sample to learn Silverlight \ DLR which they then release. Some people don't want to collaborate with others, that is not their aim and you can't blame people for that. Personally, since releasing IronEditor I have had loads of people sending me sample code, feature requests, and some other really really interesting stuff. People are collaborating behind the scenes to improve the application, personally I have a list of other people I want to contact about improving the application and working together. Same with Michael Foord's TryPython, lots of people provided feedback after he went live. Collaboration isn't just code. Good luck with your IDE, but open source projects are not as easy as they sound, I look forward to seeing how it goes. I tried to make this point on your post, however your spam filter wasn't displaying any images - makes it difficult to make a comment then :) On a side note, if people want to help with IronEditor - contact me offline. Thanks for everyone who has already. Thanks Ben Blog.BenHall.me.uk On Fri, Jul 25, 2008 at 7:38 AM, Stefan Dobrev wrote: > Hi all, > > Wouldn't be nice if we all create a DLR IDE. I have being thinking for this > for quite some times recently. As usually happens someone else also has been > thinking of this and actually blogged about it here. Saying: > --- > > So what's my point? I think all of these projects are great and kudos to > the people that built them. It takes a lot of time and effort above and > beyond just regular work hours. I have been there myself, my hats off to you > folks! But, there are 8 versions of the interactive console and a few > versions of a basic code editor. I know it may be a dream, but it would be > great to collaborate with these people and write out a simple set of > requirements for what a great DLR console and code editor would be. And > then as a virtual team, implement it. > > > > After all, to a large degree, it will be how well supported the language is > from a tools perspective that will really determine the rate of adoption. > And right now, the tools (or IDE) experience for Dynamic Languages on .NET > is severely lacking to the point of having several people independently > developing their own tooling. In this post I only pointed out a handful of > these tools and I know there are others, but I was really targeting > web-based IDE's. Maybe that is an opportunity? Or is it a pipe dream? > > --- > > So let's come together and build a difference. > > I have made the first step and created a project on codeplex - > http://codeplex.com/dlride. I have also written some basic requirements for > the project in the wiki. Let we all collaborate on them. > > For everyone who want to take a part, please feel free to contact me, so I > can give you permissions for the project on codeplex. > > Regards, > Stefan > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > From dblank at brynmawr.edu Fri Jul 25 13:56:52 2008 From: dblank at brynmawr.edu (Douglas Blank) Date: Fri, 25 Jul 2008 07:56:52 -0400 (EDT) Subject: [IronPython] [Ironruby-core] DLR IDE In-Reply-To: <1168836735.2884381216986070126.JavaMail.root@ganesh.brynmawr.edu> Message-ID: <1986630732.2885041216987012204.JavaMail.root@ganesh.brynmawr.edu> Stefan, Ben, and all, It looks like there may be a few choices to choose from! We are also working on an IDE, but it is part of a larger project. Our goal is to create an educational framework for teaching ideas in computer science. It is also open source, but no doubt differs from your initial ideas---but we could all work together as well. Our main goals: - crossplatform (Mac, Windows, Linux) - multi-programming language (DLR languages: initially Python, Ruby, and Scheme) - i18n support - IDE with color syntax, and emacs-like extensibility/use - designed for ease-of-use, but powerful - easy to install and run - collect of libraries that are fast and easy Our IDE is part of the Pyjama Project. The IDE you can think of it as IDLE for .NET/Mono. One of the specific goals is to allow easy connections to Microsoft Robotics Developer Studio, but it has a much larger scope, too. We are putting together some libraries that will be very useful in interactive environments. Of course, these libraries will be able to be used by any .NET/Mono system. These include: - 2d graphics (see Zelle's Python graphics.py and Guzdial's Media Computation) - 3d graphics and games (like pygame) - artificial intelligence (see http://pyrorobotics.org) We'll be announcing some more details about the Pyjama Project, but would love to collaborate with others in whatever ways possible. Perhaps initially a single mailing list to discuss the details would be useful? Count us in! -Doug ----- "Ben Hall" wrote: > Hi Stefan, > > An interesting approach - you want people to collaborate so you start > a new project? > > When writing the editors, people have lots of different reasons for > doing so - not everyone wants to create an IDE, some people just want > to create a cool sample to learn Silverlight \ DLR which they then > release. Some people don't want to collaborate with others, that is > not their aim and you can't blame people for that. > > Personally, since releasing IronEditor I have had loads of people > sending me sample code, feature requests, and some other really > really > interesting stuff. People are collaborating behind the scenes to > improve the application, personally I have a list of other people I > want to contact about improving the application and working together. > Same with Michael Foord's TryPython, lots of people provided feedback > after he went live. Collaboration isn't just code. > > Good luck with your IDE, but open source projects are not as easy as > they sound, I look forward to seeing how it goes. I tried to make > this point on your post, however your spam filter wasn't displaying > any images - makes it difficult to make a comment then :) > > On a side note, if people want to help with IronEditor - contact me > offline. Thanks for everyone who has already. > > Thanks > > Ben > Blog.BenHall.me.uk > > > On Fri, Jul 25, 2008 at 7:38 AM, Stefan Dobrev > wrote: > > Hi all, > > > > Wouldn't be nice if we all create a DLR IDE. I have being thinking > for this > > for quite some times recently. As usually happens someone else also > has been > > thinking of this and actually blogged about it here. Saying: > > --- > > > > So what's my point? I think all of these projects are great and > kudos to > > the people that built them. It takes a lot of time and effort above > and > > beyond just regular work hours. I have been there myself, my hats > off to you > > folks! But, there are 8 versions of the interactive console and a > few > > versions of a basic code editor. I know it may be a dream, but it > would be > > great to collaborate with these people and write out a simple set > of > > requirements for what a great DLR console and code editor would be. > And > > then as a virtual team, implement it. > > > > > > > > After all, to a large degree, it will be how well supported the > language is > > from a tools perspective that will really determine the rate of > adoption. > > And right now, the tools (or IDE) experience for Dynamic Languages > on .NET > > is severely lacking to the point of having several people > independently > > developing their own tooling. In this post I only pointed out a > handful of > > these tools and I know there are others, but I was really targeting > > web-based IDE's. Maybe that is an opportunity? Or is it a pipe > dream? > > > > --- > > > > So let's come together and build a difference. > > > > I have made the first step and created a project on codeplex - > > http://codeplex.com/dlride. I have also written some basic > requirements for > > the project in the wiki. Let we all collaborate on them. > > > > For everyone who want to take a part, please feel free to contact > me, so I > > can give you permissions for the project on codeplex. > > > > Regards, > > Stefan > > > > _______________________________________________ > > Ironruby-core mailing list > > Ironruby-core at rubyforge.org > > http://rubyforge.org/mailman/listinfo/ironruby-core > > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From ben2004uk at googlemail.com Fri Jul 25 14:32:18 2008 From: ben2004uk at googlemail.com (Ben Hall) Date: Fri, 25 Jul 2008 13:32:18 +0100 Subject: [IronPython] [Ironruby-core] DLR IDE In-Reply-To: <1986630732.2885041216987012204.JavaMail.root@ganesh.brynmawr.edu> References: <1168836735.2884381216986070126.JavaMail.root@ganesh.brynmawr.edu> <1986630732.2885041216987012204.JavaMail.root@ganesh.brynmawr.edu> Message-ID: Hi Douglas, Integration into Microsoft Robotics Developer Studio for IronPython is something which is very interesting. It sounds like you guys are doing some interesting stuff, maybe a bit out of the scope which I had planned for IronEditor. I take it as your using this as an educational exercise, you will want to write everything from scatch? Maybe we should share ideas about how you go about implementing syntax highlighting etc What do you think about using IronEditor (or similar) as the base and for me to allow some more extendability to allow you to customise the IDE Part (Editor + Output)? It would be interesting to chat with you about this offline. Ben On Fri, Jul 25, 2008 at 12:56 PM, Douglas Blank wrote: > Stefan, Ben, and all, > > It looks like there may be a few choices to choose from! We are also working on an IDE, but it is part of a larger project. Our goal is to create an educational framework for teaching ideas in computer science. It is also open source, but no doubt differs from your initial ideas---but we could all work together as well. Our main goals: > > - crossplatform (Mac, Windows, Linux) > - multi-programming language (DLR languages: initially Python, Ruby, and Scheme) > - i18n support > - IDE with color syntax, and emacs-like extensibility/use > - designed for ease-of-use, but powerful > - easy to install and run > - collect of libraries that are fast and easy > > Our IDE is part of the Pyjama Project. The IDE you can think of it as IDLE for .NET/Mono. One of the specific goals is to allow easy connections to Microsoft Robotics Developer Studio, but it has a much larger scope, too. We are putting together some libraries that will be very useful in interactive environments. Of course, these libraries will be able to be used by any .NET/Mono system. These include: > > - 2d graphics (see Zelle's Python graphics.py and Guzdial's Media Computation) > - 3d graphics and games (like pygame) > - artificial intelligence (see http://pyrorobotics.org) > > We'll be announcing some more details about the Pyjama Project, but would love to collaborate with others in whatever ways possible. Perhaps initially a single mailing list to discuss the details would be useful? > > Count us in! > > -Doug > > ----- "Ben Hall" wrote: > >> Hi Stefan, >> >> An interesting approach - you want people to collaborate so you start >> a new project? >> >> When writing the editors, people have lots of different reasons for >> doing so - not everyone wants to create an IDE, some people just want >> to create a cool sample to learn Silverlight \ DLR which they then >> release. Some people don't want to collaborate with others, that is >> not their aim and you can't blame people for that. >> >> Personally, since releasing IronEditor I have had loads of people >> sending me sample code, feature requests, and some other really >> really >> interesting stuff. People are collaborating behind the scenes to >> improve the application, personally I have a list of other people I >> want to contact about improving the application and working together. >> Same with Michael Foord's TryPython, lots of people provided feedback >> after he went live. Collaboration isn't just code. >> >> Good luck with your IDE, but open source projects are not as easy as >> they sound, I look forward to seeing how it goes. I tried to make >> this point on your post, however your spam filter wasn't displaying >> any images - makes it difficult to make a comment then :) >> >> On a side note, if people want to help with IronEditor - contact me >> offline. Thanks for everyone who has already. >> >> Thanks >> >> Ben >> Blog.BenHall.me.uk >> >> >> On Fri, Jul 25, 2008 at 7:38 AM, Stefan Dobrev >> wrote: >> > Hi all, >> > >> > Wouldn't be nice if we all create a DLR IDE. I have being thinking >> for this >> > for quite some times recently. As usually happens someone else also >> has been >> > thinking of this and actually blogged about it here. Saying: >> > --- >> > >> > So what's my point? I think all of these projects are great and >> kudos to >> > the people that built them. It takes a lot of time and effort above >> and >> > beyond just regular work hours. I have been there myself, my hats >> off to you >> > folks! But, there are 8 versions of the interactive console and a >> few >> > versions of a basic code editor. I know it may be a dream, but it >> would be >> > great to collaborate with these people and write out a simple set >> of >> > requirements for what a great DLR console and code editor would be. >> And >> > then as a virtual team, implement it. >> > >> > >> > >> > After all, to a large degree, it will be how well supported the >> language is >> > from a tools perspective that will really determine the rate of >> adoption. >> > And right now, the tools (or IDE) experience for Dynamic Languages >> on .NET >> > is severely lacking to the point of having several people >> independently >> > developing their own tooling. In this post I only pointed out a >> handful of >> > these tools and I know there are others, but I was really targeting >> > web-based IDE's. Maybe that is an opportunity? Or is it a pipe >> dream? >> > >> > --- >> > >> > So let's come together and build a difference. >> > >> > I have made the first step and created a project on codeplex - >> > http://codeplex.com/dlride. I have also written some basic >> requirements for >> > the project in the wiki. Let we all collaborate on them. >> > >> > For everyone who want to take a part, please feel free to contact >> me, so I >> > can give you permissions for the project on codeplex. >> > >> > Regards, >> > Stefan >> > >> > _______________________________________________ >> > Ironruby-core mailing list >> > Ironruby-core at rubyforge.org >> > http://rubyforge.org/mailman/listinfo/ironruby-core >> > >> > >> _______________________________________________ >> 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 stefan.dobrev at gmail.com Fri Jul 25 16:16:56 2008 From: stefan.dobrev at gmail.com (Stefan Dobrev) Date: Fri, 25 Jul 2008 17:16:56 +0300 Subject: [IronPython] [Ironruby-core] DLR IDE In-Reply-To: References: <928de89c0807242338s59aadf34uf29936c844d0c30f@mail.gmail.com> Message-ID: <928de89c0807250716k164fc697w91e379fb8ea09960@mail.gmail.com> Hi Benn, I haven't created the codeplex project to start coding ASAP. My idea was to use the codeplex wiki to gather requirements for what a good DLR IDE (name it editor if you like). Actually I have first created a pbwiki for this, but then realized that codeplex's wiki can be used as well, so no need to have two different places for information about the same project. My idea about the project is have something similar to TextMate, but web based. Naming it IDE doesn't imply that it should be huge as VS, does it? I just find it more funny and easy to pronanunce dlride (DLR IDE) that can pronanunce (D L ride) - saying that your are riding (on) dynamic languges. I don't want this to be my IDE. I just want it to be ours - from the community to the community. That's it. Have fun, Stefan 2008/7/25 Ben Hall > Hi Stefan, > > An interesting approach - you want people to collaborate so you start > a new project? > > When writing the editors, people have lots of different reasons for > doing so - not everyone wants to create an IDE, some people just want > to create a cool sample to learn Silverlight \ DLR which they then > release. Some people don't want to collaborate with others, that is > not their aim and you can't blame people for that. > > Personally, since releasing IronEditor I have had loads of people > sending me sample code, feature requests, and some other really really > interesting stuff. People are collaborating behind the scenes to > improve the application, personally I have a list of other people I > want to contact about improving the application and working together. > Same with Michael Foord's TryPython, lots of people provided feedback > after he went live. Collaboration isn't just code. > > Good luck with your IDE, but open source projects are not as easy as > they sound, I look forward to seeing how it goes. I tried to make > this point on your post, however your spam filter wasn't displaying > any images - makes it difficult to make a comment then :) > > On a side note, if people want to help with IronEditor - contact me > offline. Thanks for everyone who has already. > > Thanks > > Ben > Blog.BenHall.me.uk > > > On Fri, Jul 25, 2008 at 7:38 AM, Stefan Dobrev > wrote: > > Hi all, > > > > Wouldn't be nice if we all create a DLR IDE. I have being thinking for > this > > for quite some times recently. As usually happens someone else also has > been > > thinking of this and actually blogged about it here. Saying: > > --- > > > > So what's my point? I think all of these projects are great and kudos to > > the people that built them. It takes a lot of time and effort above and > > beyond just regular work hours. I have been there myself, my hats off to > you > > folks! But, there are 8 versions of the interactive console and a few > > versions of a basic code editor. I know it may be a dream, but it would > be > > great to collaborate with these people and write out a simple set of > > requirements for what a great DLR console and code editor would be. And > > then as a virtual team, implement it. > > > > > > > > After all, to a large degree, it will be how well supported the language > is > > from a tools perspective that will really determine the rate of adoption. > > And right now, the tools (or IDE) experience for Dynamic Languages on > .NET > > is severely lacking to the point of having several people independently > > developing their own tooling. In this post I only pointed out a handful > of > > these tools and I know there are others, but I was really targeting > > web-based IDE's. Maybe that is an opportunity? Or is it a pipe dream? > > > > --- > > > > So let's come together and build a difference. > > > > I have made the first step and created a project on codeplex - > > http://codeplex.com/dlride. I have also written some basic requirements > for > > the project in the wiki. Let we all collaborate on them. > > > > For everyone who want to take a part, please feel free to contact me, so > I > > can give you permissions for the project on codeplex. > > > > Regards, > > Stefan > > > > _______________________________________________ > > Ironruby-core mailing list > > Ironruby-core at rubyforge.org > > http://rubyforge.org/mailman/listinfo/ironruby-core > > > > > _______________________________________________ > 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 mbarnett at uniserve.com Fri Jul 25 19:00:07 2008 From: mbarnett at uniserve.com (Mitch Barnett) Date: Fri, 25 Jul 2008 10:00:07 -0700 Subject: [IronPython] DLR IDE In-Reply-To: <928de89c0807242338s59aadf34uf29936c844d0c30f@mail.gmail.com> References: <928de89c0807242338s59aadf34uf29936c844d0c30f@mail.gmail.com> Message-ID: <000f01c8ee77$e4601480$6500a8c0@valleyforge> Hi Stefan, Looks like fun, count me in! Mitch _____ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Stefan Dobrev Sent: Thursday, July 24, 2008 11:39 PM To: Discussion of IronPython; ironruby-core at rubyforge.org Subject: [IronPython] DLR IDE Hi all, Wouldn't be nice if we all create a DLR IDE. I have being thinking for this for quite some times recently. As usually happens someone else also has been thinking of this and actually blogged about it here . Saying: --- So what's my point? I think all of these projects are great and kudos to the people that built them. It takes a lot of time and effort above and beyond just regular work hours. I have been there myself, my hats off to you folks! But, there are 8 versions of the interactive console and a few versions of a basic code editor. I know it may be a dream, but it would be great to collaborate with these people and write out a simple set of requirements for what a great DLR console and code editor would be. And then as a virtual team, implement it. After all, to a large degree, it will be how well supported the language is from a tools perspective that will really determine the rate of adoption. And right now, the tools (or IDE) experience for Dynamic Languages on .NET is severely lacking to the point of having several people independently developing their own tooling. In this post I only pointed out a handful of these tools and I know there are others, but I was really targeting web-based IDE's. Maybe that is an opportunity? Or is it a pipe dream? --- So let's come together and build a difference. I have made the first step and created a project on codeplex - http://codeplex.com/dlride. I have also written some basic requirements for the project in the wiki. Let we all collaborate on them. For everyone who want to take a part, please feel free to contact me, so I can give you permissions for the project on codeplex. Regards, Stefan -------------- next part -------------- An HTML attachment was scrubbed... URL: From christian.muirhead at resolversystems.com Fri Jul 25 19:28:42 2008 From: christian.muirhead at resolversystems.com (Christian Muirhead) Date: Fri, 25 Jul 2008 18:28:42 +0100 Subject: [IronPython] Garbage collection of imported modules Message-ID: <488A0D4A.4080500@resolversystems.com> Hi guys - If I execute the following: ### from System.Diagnostics import Process M = 1024 * 1024 import bigmodule for i in range(1000): m = reload(bigmodule) print i, Process.GetCurrentProcess().PrivateMemorySize64 / M ### (in IP 1.1.1), I see steadily increasing memory usage - the assemblies created by reloading each module are not being garbage collected. Talking to Giles (the boss here), he remembered a conversation with someone at the Languages.NET conference about how some assemblies aren't collectable, while others that are generated without debugging information can be collected. Looking at the source for PythonEngine I can see the EngineOptions.ClrDebuggingEnabled property, with a comment saying essentially the same thing. However, when I try to use this with the following code, I still get increasing memory usage. ### from textwrap import dedent from IronPython.Hosting import PythonEngine, EngineOptions from System.Diagnostics import Process M = 1024 * 1024 o = EngineOptions() o.ClrDebuggingEnabled = False p = PythonEngine(o) p.Sys.path.append('.') for i in range(1000): p.Execute(dedent('''\ import bigmodule reload(bigmodule) ''')) print i, Process.GetCurrentProcess().PrivateMemorySize64 / M ### So the assemblies generated from compiling the imported module are still not collectable. (I've also tried running the first script in an interpreter (with ClrDebuggingEnabled off) embedded in a C# application, to make sure there's nothing untoward happening because of nested PythonEngines, but I see the same behaviour). Is there any way to have these modules collected? Is the situation the same in IP 2.*? Thanks, Christian -- Christian Muirhead Resolver Systems christian.muirhead at resolversystems.com We're hiring! http://www.resolversystems.com/jobs/ Resolver Systems Ltd 17a Clerkenwell Road, London EC1M 5RD, UK VAT No.: GB 893 5643 79 Registered in England and Wales as company number 5467329. Registered address: 843 Finchley Road, London NW11 8NA, UK From dinov at exchange.microsoft.com Fri Jul 25 20:14:44 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Fri, 25 Jul 2008 11:14:44 -0700 Subject: [IronPython] Garbage collection of imported modules In-Reply-To: <488A0D4A.4080500@resolversystems.com> References: <488A0D4A.4080500@resolversystems.com> Message-ID: <7AD436E4270DD54A94238001769C2227012C935C075B@DF-GRTDANE-MSG.exchange.corp.microsoft.com> It's not just tied to debug because there's also performance reasons to generate it as an uncollectible type. In 1.x there is a -X:GenerateAsSnippets command line option which forces the modules to be collectible (you could also programmatically set Options.GenerateModulesAsSnippets to true). If you want to do this for someone off code I'd suggest using the built-in compile or execfile functions as they'll ensure the code is collectible. In 2.0 the story is the same bug the command line option is -X:LightweightScopes. We could consider adding another way to reload modules which would do so in a collectible manner (e.g. clr.ReloadModule) if necessary. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Christian Muirhead Sent: Friday, July 25, 2008 10:29 AM To: Discussion of IronPython Subject: [IronPython] Garbage collection of imported modules Hi guys - If I execute the following: ### from System.Diagnostics import Process M = 1024 * 1024 import bigmodule for i in range(1000): m = reload(bigmodule) print i, Process.GetCurrentProcess().PrivateMemorySize64 / M ### (in IP 1.1.1), I see steadily increasing memory usage - the assemblies created by reloading each module are not being garbage collected. Talking to Giles (the boss here), he remembered a conversation with someone at the Languages.NET conference about how some assemblies aren't collectable, while others that are generated without debugging information can be collected. Looking at the source for PythonEngine I can see the EngineOptions.ClrDebuggingEnabled property, with a comment saying essentially the same thing. However, when I try to use this with the following code, I still get increasing memory usage. ### from textwrap import dedent from IronPython.Hosting import PythonEngine, EngineOptions from System.Diagnostics import Process M = 1024 * 1024 o = EngineOptions() o.ClrDebuggingEnabled = False p = PythonEngine(o) p.Sys.path.append('.') for i in range(1000): p.Execute(dedent('''\ import bigmodule reload(bigmodule) ''')) print i, Process.GetCurrentProcess().PrivateMemorySize64 / M ### So the assemblies generated from compiling the imported module are still not collectable. (I've also tried running the first script in an interpreter (with ClrDebuggingEnabled off) embedded in a C# application, to make sure there's nothing untoward happening because of nested PythonEngines, but I see the same behaviour). Is there any way to have these modules collected? Is the situation the same in IP 2.*? Thanks, Christian -- Christian Muirhead Resolver Systems christian.muirhead at resolversystems.com We're hiring! http://www.resolversystems.com/jobs/ Resolver Systems Ltd 17a Clerkenwell Road, London EC1M 5RD, UK VAT No.: GB 893 5643 79 Registered in England and Wales as company number 5467329. Registered address: 843 Finchley Road, London NW11 8NA, UK _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From fuzzyman at voidspace.org.uk Fri Jul 25 21:12:52 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Fri, 25 Jul 2008 20:12:52 +0100 Subject: [IronPython] [Ironruby-core] DLR IDE In-Reply-To: References: <928de89c0807242338s59aadf34uf29936c844d0c30f@mail.gmail.com> Message-ID: <488A25B4.8090409@voidspace.org.uk> Ben Hall wrote: > Hi Stefan, > > An interesting approach - you want people to collaborate so you start > a new project? > > Hehe. That's a computing classic. "There are too many protocols, we need to invent a new one so that everyone will use that one..." Michael > When writing the editors, people have lots of different reasons for > doing so - not everyone wants to create an IDE, some people just want > to create a cool sample to learn Silverlight \ DLR which they then > release. Some people don't want to collaborate with others, that is > not their aim and you can't blame people for that. > > Personally, since releasing IronEditor I have had loads of people > sending me sample code, feature requests, and some other really really > interesting stuff. People are collaborating behind the scenes to > improve the application, personally I have a list of other people I > want to contact about improving the application and working together. > Same with Michael Foord's TryPython, lots of people provided feedback > after he went live. Collaboration isn't just code. > > Good luck with your IDE, but open source projects are not as easy as > they sound, I look forward to seeing how it goes. I tried to make > this point on your post, however your spam filter wasn't displaying > any images - makes it difficult to make a comment then :) > > On a side note, if people want to help with IronEditor - contact me > offline. Thanks for everyone who has already. > > Thanks > > Ben > Blog.BenHall.me.uk > > > On Fri, Jul 25, 2008 at 7:38 AM, Stefan Dobrev wrote: > >> Hi all, >> >> Wouldn't be nice if we all create a DLR IDE. I have being thinking for this >> for quite some times recently. As usually happens someone else also has been >> thinking of this and actually blogged about it here. Saying: >> --- >> >> So what's my point? I think all of these projects are great and kudos to >> the people that built them. It takes a lot of time and effort above and >> beyond just regular work hours. I have been there myself, my hats off to you >> folks! But, there are 8 versions of the interactive console and a few >> versions of a basic code editor. I know it may be a dream, but it would be >> great to collaborate with these people and write out a simple set of >> requirements for what a great DLR console and code editor would be. And >> then as a virtual team, implement it. >> >> >> >> After all, to a large degree, it will be how well supported the language is >> from a tools perspective that will really determine the rate of adoption. >> And right now, the tools (or IDE) experience for Dynamic Languages on .NET >> is severely lacking to the point of having several people independently >> developing their own tooling. In this post I only pointed out a handful of >> these tools and I know there are others, but I was really targeting >> web-based IDE's. Maybe that is an opportunity? Or is it a pipe dream? >> >> --- >> >> So let's come together and build a difference. >> >> I have made the first step and created a project on codeplex - >> http://codeplex.com/dlride. I have also written some basic requirements for >> the project in the wiki. Let we all collaborate on them. >> >> For everyone who want to take a part, please feel free to contact me, so I >> can give you permissions for the project on codeplex. >> >> Regards, >> Stefan >> >> _______________________________________________ >> Ironruby-core mailing list >> Ironruby-core at rubyforge.org >> http://rubyforge.org/mailman/listinfo/ironruby-core >> >> >> > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From fuzzyman at voidspace.org.uk Fri Jul 25 21:30:44 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Fri, 25 Jul 2008 20:30:44 +0100 Subject: [IronPython] IronPython Post 2.0 Roadmap In-Reply-To: References: <4875EF83.80805@voidspace.org.uk> <4882265D.10804@voidspace.org.uk> <4884E7E0.80200@voidspace.org.uk> Message-ID: <488A29E4.4040303@voidspace.org.uk> Curt Hagenlocher wrote: > So, we had a brief hallway discussion today about this topic, and the > upshot is that I'm interested in hearing your "real world" use cases for > a) attributes, and At Resolver Systems we've used the DllImport attribute extensively. In my own projects I've used the Silverlight Scriptable attribute several times. Michael > b) static type generation in general > > By "use case", I mean a scenario that's specifically relevant to you > today. By "relevant", I mean that it would be *nice* to be able to > write a PowerShell extension in Python, but if you didn't end up > writing the extension in another language, then it doesn't really > count for what I'm looking for. :) > > On Mon, Jul 21, 2008 at 4:16 PM, Keith J. Farmer > wrote: > > We are talking about *new* features, but you're limiting yourself > to existing APIs? > > If, for the sake of working nicely with the DLR, the existing > reflection API needs to be modified to deal with a more dynamic > world, that's not outside the realm of possibility in my books. > After all, there has always been talk of IP being able to expose > static types for consumption outside of IP. I don't see that this > is any less possible now than it was at the start. > > Incidentally, Type is an abstract class. Also, ParameterInfo > isn't sealed, and implements ICustomerAttributeProvider, which is > a public interface: > > public interface ICustomAttributeProvider > > { > // Methods > object > > [] GetCustomAttributes > > > (bool > > inherit); > object > > [] GetCustomAttributes > > > (Type > > attributeType, bool > > inherit); > bool > > IsDefined > > > (Type > > attributeType, bool > > inherit); > } > > > So I think, actually, that this could be done without changing > much if any external API. They'd probably need to change some of > the internals to return dynamic variants of the info types, but I > think that's doable. > > ________________________________ > > From: users-bounces at lists.ironpython.com > on behalf of Harry Pierson > Sent: Mon 7/21/2008 12:59 PM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython Post 2.0 Roadmap > > > > All of the many overloads of GetCustomAttributes > (http://msdn.microsoft.com/en-us/library/system.attribute.getcustomattributes(VS.85).aspx > ) > need some type of static type info (Type, MemberInfo, > ParameterInfo). So supporting custom attributes would require some > type of static class as Michael mentions below. > > > > -----Original Message----- > From: users-bounces at lists.ironpython.com > > [mailto:users-bounces at lists.ironpython.com > ] On Behalf Of Michael > Foord > Sent: Monday, July 21, 2008 12:48 PM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython Post 2.0 Roadmap > > Keith J. Farmer wrote: > > Attributes can be applied to more than just types -- members, > > parameters, return values (as I recall), etc. > > But those all presuppose a static type - right? > > IronPython could generate a static class in the compile phase > where .NET > attributes are used. Python decorator syntax could be used - class > decorators are now part of Python 2.6 and no-one would object to you > sneaking them into Python 2.5... > > Parameter and return type attributes could still use a method > decorator > to apply them. > > Michael > > > > > > ------------------------------------------------------------------------ > > *From:* users-bounces at lists.ironpython.com > on behalf of Curt > Hagenlocher > > *Sent:* Mon 7/21/2008 9:51 AM > > *To:* Discussion of IronPython > > *Subject:* Re: [IronPython] IronPython Post 2.0 Roadmap > > > > "Availability of a static type" not because IronPython would need to > > access one but because it would need to expose one. > > > > > > On Mon, Jul 21, 2008 at 9:44 AM, Keith J. Farmer > > > >> wrote: > > > > You can create your own attribute classes, for whatever markup. > > Particularly since LINQ-to-*, where they often are used to > > annotate data classes with strings, etc (not references to > types). > > > > In any event, why does "availability of a static type" enter > into > > this? IP can access static types just as well as any other .NET > > language (System.Math comes to mind). The motivation in general > > is to make IP a better producer for CLR types, rather than > just a > > consumer, and attributes are an increasingly important thing to > > support. > > > > As for expression trees and extension methods, those are to make > > IP a better consumer of a very important API (LINQ and the > > IQueryable stack from .NET 3.5). > > > > To be honest, once those 3 features are available in IP, I think > > it would be on par with the mainstream languages in being very > > usable in an exclusive sense. > > > > -----Original Message----- > > From: users-bounces at lists.ironpython.com > > > > > > [mailto:users-bounces at lists.ironpython.com > > > >] On Behalf Of Harry > > Pierson > > Sent: Sunday, July 20, 2008 11:14 PM > > To: Discussion of IronPython > > Subject: Re: [IronPython] IronPython Post 2.0 Roadmap > > > > Can you give me some examples where you would use these? The > > problem I see is that many scenarios (WCF contracts, XML > > serialization just to name two) where people want to use a > custom > > attribute depends on the availability of a static type. > > > > Harry > > > > -----Original Message----- > > From: users-bounces at lists.ironpython.com > > > > > > [mailto:users-bounces at lists.ironpython.com > > > >] On Behalf Of Keith J. > > Farmer > > Sent: Saturday, July 19, 2008 8:13 PM > > To: Discussion of IronPython > > Subject: Re: [IronPython] IronPython Post 2.0 Roadmap > > > > votes++ > > > > -----Original Message----- > > From: users-bounces at lists.ironpython.com > > > > > > [mailto:users-bounces at lists.ironpython.com > > > >] On Behalf Of Michael > > Foord > > Sent: Saturday, July 19, 2008 10:38 AM > > To: Discussion of IronPython > > Subject: Re: [IronPython] IronPython Post 2.0 Roadmap > > > > Sanghyeon Seo wrote: > > > 2008/7/20 Harry Pierson > > >>: > > > > > >> Hosting features are all done via the DLR, so that's a > separate > > team. As for > > >> "ability to interact with the rest of the .Net > framework", can > > you be more > > >> specific about what you're looking for in that space? What > > *isn't* IPy doing > > >> that you want it to? > > >> > > > > > > .NET attributes? > > > > > > > > +1 :-) > > > > Michael > > > > -- > > http://www.ironpythoninaction.com/ > > http://www.voidspace.org.uk/ > > http://www.trypython.org/ > > http://www.ironpython.info/ > > http://www.theotherdelia.co.uk/ > > http://www.resolverhacks.net/ > > > > _______________________________________________ > > 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 > > > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From curt at hagenlocher.org Fri Jul 25 22:58:17 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Fri, 25 Jul 2008 13:58:17 -0700 Subject: [IronPython] IronPython Post 2.0 Roadmap In-Reply-To: <488A29E4.4040303@voidspace.org.uk> References: <4875EF83.80805@voidspace.org.uk> <4884E7E0.80200@voidspace.org.uk> <488A29E4.4040303@voidspace.org.uk> Message-ID: On Fri, Jul 25, 2008 at 12:30 PM, Michael Foord wrote: > > At Resolver Systems we've used the DllImport attribute extensively. If we had a good ctypes/native interop mechanism, would it take care of that? > In my own projects I've used the Silverlight Scriptable attribute several times. I'll add that to my list. -- Curt Hagenlocher curt at hagenlocher.org From fuzzyman at voidspace.org.uk Fri Jul 25 23:00:12 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Fri, 25 Jul 2008 22:00:12 +0100 Subject: [IronPython] IronPython Post 2.0 Roadmap In-Reply-To: References: <4875EF83.80805@voidspace.org.uk> <4884E7E0.80200@voidspace.org.uk> <488A29E4.4040303@voidspace.org.uk> Message-ID: <488A3EDC.8070205@voidspace.org.uk> Curt Hagenlocher wrote: > On Fri, Jul 25, 2008 at 12:30 PM, Michael Foord > wrote: > >> At Resolver Systems we've used the DllImport attribute extensively. >> > > If we had a good ctypes/native interop mechanism, would it take care of that? > > Yep. :-) Thanks Michae; >> In my own projects I've used the Silverlight Scriptable attribute several times. >> > > I'll add that to my list. > > -- > Curt Hagenlocher > curt at hagenlocher.org > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From dblank at brynmawr.edu Fri Jul 25 23:24:38 2008 From: dblank at brynmawr.edu (Douglas S. Blank) Date: Fri, 25 Jul 2008 17:24:38 -0400 Subject: [IronPython] [Ironruby-core] DLR IDE In-Reply-To: References: <1168836735.2884381216986070126.JavaMail.root@ganesh.brynmawr.edu> <1986630732.2885041216987012204.JavaMail.root@ganesh.brynmawr.edu> Message-ID: <488A4496.10701@brynmawr.edu> Ben Hall wrote: > Hi Douglas, > > Integration into Microsoft Robotics Developer Studio for IronPython is > something which is very interesting. It sounds like you guys are > doing some interesting stuff, maybe a bit out of the scope which I had > planned for IronEditor. > > I take it as your using this as an educational exercise, you will want > to write everything from scatch? Maybe we should share ideas about how > you go about implementing syntax highlighting etc > > What do you think about using IronEditor (or similar) as the base and > for me to allow some more extendability to allow you to customise the > IDE Part (Editor + Output)? > > It would be interesting to chat with you about this offline. Ben, No, Pyjama is not meant to be an educational exercise---it is intended to be a solid platform for teaching (and doing research in) computer science. We do not *want* to write anything from scratch... only when we have to! But we are a little picky about how the system will work :) For example, it must work in a cross-platform (.NET/Mono) manner. Let's do chat... in fact to get the ball rolling I've taken the liberty of creating a mailing list to discuss IDE's focused on the DLR. Anyone interested please feel free to join here: http://myro.roboteducation.org/mailman/listinfo/ide-developer I've made the archives (when there are some) to be publicly viewable. Let's chat! Ideas for topics for discussion: - how to have a shell for which many languages can be entered? - color-syntax highlighting---what are the options? - can there be a common API for IDEs? what can we share? -Doug > Ben > > On Fri, Jul 25, 2008 at 12:56 PM, Douglas Blank wrote: >> Stefan, Ben, and all, >> >> It looks like there may be a few choices to choose from! We are also working on an IDE, but it is part of a larger project. Our goal is to create an educational framework for teaching ideas in computer science. It is also open source, but no doubt differs from your initial ideas---but we could all work together as well. Our main goals: >> >> - crossplatform (Mac, Windows, Linux) >> - multi-programming language (DLR languages: initially Python, Ruby, and Scheme) >> - i18n support >> - IDE with color syntax, and emacs-like extensibility/use >> - designed for ease-of-use, but powerful >> - easy to install and run >> - collect of libraries that are fast and easy >> >> Our IDE is part of the Pyjama Project. The IDE you can think of it as IDLE for .NET/Mono. One of the specific goals is to allow easy connections to Microsoft Robotics Developer Studio, but it has a much larger scope, too. We are putting together some libraries that will be very useful in interactive environments. Of course, these libraries will be able to be used by any .NET/Mono system. These include: >> >> - 2d graphics (see Zelle's Python graphics.py and Guzdial's Media Computation) >> - 3d graphics and games (like pygame) >> - artificial intelligence (see http://pyrorobotics.org) >> >> We'll be announcing some more details about the Pyjama Project, but would love to collaborate with others in whatever ways possible. Perhaps initially a single mailing list to discuss the details would be useful? >> >> Count us in! >> >> -Doug >> >> ----- "Ben Hall" wrote: >> >>> Hi Stefan, >>> >>> An interesting approach - you want people to collaborate so you start >>> a new project? >>> >>> When writing the editors, people have lots of different reasons for >>> doing so - not everyone wants to create an IDE, some people just want >>> to create a cool sample to learn Silverlight \ DLR which they then >>> release. Some people don't want to collaborate with others, that is >>> not their aim and you can't blame people for that. >>> >>> Personally, since releasing IronEditor I have had loads of people >>> sending me sample code, feature requests, and some other really >>> really >>> interesting stuff. People are collaborating behind the scenes to >>> improve the application, personally I have a list of other people I >>> want to contact about improving the application and working together. >>> Same with Michael Foord's TryPython, lots of people provided feedback >>> after he went live. Collaboration isn't just code. >>> >>> Good luck with your IDE, but open source projects are not as easy as >>> they sound, I look forward to seeing how it goes. I tried to make >>> this point on your post, however your spam filter wasn't displaying >>> any images - makes it difficult to make a comment then :) >>> >>> On a side note, if people want to help with IronEditor - contact me >>> offline. Thanks for everyone who has already. >>> >>> Thanks >>> >>> Ben >>> Blog.BenHall.me.uk >>> >>> >>> On Fri, Jul 25, 2008 at 7:38 AM, Stefan Dobrev >>> wrote: >>>> Hi all, >>>> >>>> Wouldn't be nice if we all create a DLR IDE. I have being thinking >>> for this >>>> for quite some times recently. As usually happens someone else also >>> has been >>>> thinking of this and actually blogged about it here. Saying: >>>> --- >>>> >>>> So what's my point? I think all of these projects are great and >>> kudos to >>>> the people that built them. It takes a lot of time and effort above >>> and >>>> beyond just regular work hours. I have been there myself, my hats >>> off to you >>>> folks! But, there are 8 versions of the interactive console and a >>> few >>>> versions of a basic code editor. I know it may be a dream, but it >>> would be >>>> great to collaborate with these people and write out a simple set >>> of >>>> requirements for what a great DLR console and code editor would be. >>> And >>>> then as a virtual team, implement it. >>>> >>>> >>>> >>>> After all, to a large degree, it will be how well supported the >>> language is >>>> from a tools perspective that will really determine the rate of >>> adoption. >>>> And right now, the tools (or IDE) experience for Dynamic Languages >>> on .NET >>>> is severely lacking to the point of having several people >>> independently >>>> developing their own tooling. In this post I only pointed out a >>> handful of >>>> these tools and I know there are others, but I was really targeting >>>> web-based IDE's. Maybe that is an opportunity? Or is it a pipe >>> dream? >>>> --- >>>> >>>> So let's come together and build a difference. >>>> >>>> I have made the first step and created a project on codeplex - >>>> http://codeplex.com/dlride. I have also written some basic >>> requirements for >>>> the project in the wiki. Let we all collaborate on them. >>>> >>>> For everyone who want to take a part, please feel free to contact >>> me, so I >>>> can give you permissions for the project on codeplex. >>>> >>>> Regards, >>>> Stefan >>>> >>>> _______________________________________________ >>>> Ironruby-core mailing list >>>> Ironruby-core at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/ironruby-core >>>> >>>> >>> _______________________________________________ >>> 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 Jimmy.Schementi at microsoft.com Fri Jul 25 23:58:48 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Fri, 25 Jul 2008 14:58:48 -0700 Subject: [IronPython] Switching Mailing List to CodePlex In-Reply-To: References: <92fc6620807231456w389178b4xcff517bba55ce851@mail.gmail.com> <92fc6620807231546x4de38985r4a86945480d4f953@mail.gmail.com> <92fc6620807232147sb97a7d1p34ef93a9e12029b1@mail.gmail.com> <48883C47.2070405@voidspace.org.uk> <5b0248170807241655s1fe6fb70q610876a4e253d@mail.gmail.com> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A32845D48A7BF8@NA-EXMSG-C116.redmond.corp.microsoft.com> If anything, the mailman archive would stay where it is, no point in removing it. Harry, when we spoke with the Codeplex folks, I gave them a feature request to allow using this feature with existing addresses, like google groups where you just tell them an external email address and they keep a record of it for you, and let people post from the web. I'd be much more comfortable using this feature then. Also, just as a "let's try it out", we could forward all traffic from users at lists.ironpython.com to the codeplex address. This should keep the mailman archive as well, but everything we talk about will be nicely archived on codeplex. Both addresses would work, but anything sent to the codeplex address, or from the website, wouldn't go to this current list; incentive to use the new one. If we hate it, we can stop the forward. Just a thought ... ~Jimmy > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Harry Pierson > Sent: Thursday, July 24, 2008 5:11 PM > To: Discussion of IronPython > Subject: Re: [IronPython] Switching Mailing List to CodePlex > > Good point Seo, thanks for pointing that out. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Sanghyeon Seo > Sent: Thursday, July 24, 2008 4:55 PM > To: Discussion of IronPython > Subject: Re: [IronPython] Switching Mailing List to CodePlex > > > If you've got a strong opinion about CodePlex mailing lists one way > or > > another, please let me know. > > I am okay with it provided that all previous links to Mailman archive > transparently redirects, forever, to the correct place. > > Otherwise I am strongly against. (I probably made hundreds of links to > the archive of this mailing list, and it's only me.) > > -- > 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 Sat Jul 26 01:39:58 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Fri, 25 Jul 2008 16:39:58 -0700 Subject: [IronPython] imports & .NET classes... Message-ID: <7AD436E4270DD54A94238001769C2227012C935C083C@DF-GRTDANE-MSG.exchange.corp.microsoft.com> We've recently been discussing a bug ( http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=16323 ) internally and thought we'd get some broader input on it. Just so you don't have to click on this link this bug is all about how properties get imported and additionally how we deal with static classes in the face of import. There's several different aspects to this. First we have whether the class you're doing an import from is a static class or an instance class. Next we have whether the user is doing an import * or from import. And finally we have whether the members being extracted are properties/methods and whether they're instance or static members. Let's take a look at each of those... First if the class is a static class life is pretty good. A .NET static class is much like a Python module. For example consider the class System.Math. This contains a bunch of static methods and some read-only fields. Doing from System.Math import * seems perfectly reasonable in this case. We're currently thinking about treating these types much like a module with __all__ defined on it - and we'll even add __all__ to the type. The current thoughts on what goes into __all__ is: __all__ contains all members except: __doc__/__class__ Properties/indexers Non-const/read-only fields Built-in methods/functions inherited from non-static types (really just object unless you use ilasm to create your static type) Next we have import * vs. from import. Import * should naturally respect __all__ so for static classes it will follow the above rules. From staticClass import x should allow importing of anything from a module as long as it exists - so it'll work the same way for static classes as well. That will allow "from System.Environment import CommandLine" to work will bring in the value for the command line. Because non-static types won't have __all__ we will disallow from System.DateTime import *. Now it starts to get tricky when you have a non-static class because we have instance vs static members. To enable a better story w/ .NET we would like to enable from System.DateTime import Parse - supporting the import of static functions. But the interesting question then becomes should we allow from System.DateTime import Now - a static property? Finally, should we allow from System.DateTime import AddMonths - an instance method? So in summary the static classes seem to be straight forward. Instance members and non-static classes make the story much more complicated. We'd love to hear what everyone thinks about the trickier cases or the plan in general. -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Sat Jul 26 02:12:37 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sat, 26 Jul 2008 01:12:37 +0100 Subject: [IronPython] imports & .NET classes... In-Reply-To: <7AD436E4270DD54A94238001769C2227012C935C083C@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <7AD436E4270DD54A94238001769C2227012C935C083C@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <488A6BF5.4040304@voidspace.org.uk> Dino Viehland wrote: > > We?ve recently been discussing a bug ( > http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=16323 > ) internally and thought we?d get some broader input on it. Just so > you don?t have to click on this link this bug is all about how > properties get imported and additionally how we deal with static > classes in the face of import. > > There?s several different aspects to this. First we have whether the > class you?re doing an import from is a static class or an instance > class. Next we have whether the user is doing an import * or from > import. And finally we have whether the members being extracted are > properties/methods and whether they?re instance or static members. > Let?s take a look at each of those? > > First if the class is a static class life is pretty good. A .NET > static class is much like a Python module. For example consider the > class System.Math. This contains a bunch of static methods and some > read-only fields. Doing from System.Math import * seems perfectly > reasonable in this case. We?re currently thinking about treating these > types much like a module with __all__ defined on it - and we?ll even > add __all__ to the type. The current thoughts on what goes into > __all__ is: > > __all__ contains all members *except*: > > __doc__/__class__ > > Properties/indexers > > Non-const/read-only fields > > Built-in methods/functions inherited from non-static types (really > just object unless you use ilasm to create your static type) > > Next we have import * vs. from import. Import * should naturally > respect __all__ so for static classes it will follow the above rules. > From staticClass import x should allow importing of anything from a > module as long as it exists ? so it?ll work the same way for static > classes as well. That will allow ?from System.Environment import > CommandLine? to work will bring in the value for the command line. > Because non-static types won?t have __all__ we will disallow from > System.DateTime import *. > > Now it starts to get tricky when you have a non-static class because > we have instance vs static members. To enable a better story w/ .NET > we would like to enable from System.DateTime import Parse ? supporting > the import of static functions. But the interesting question then > becomes should we allow from System.DateTime import Now ? a static > property? Finally, should we allow from System.DateTime import > AddMonths ? an instance method? > > So in summary the static classes seem to be straight forward. Instance > members and non-static classes make the story much more complicated. > We?d love to hear what everyone thinks about the trickier cases or the > plan in general. > I like your proposal for static classes. .NET only needs static classes because it doesn't have proper functions anyway... ;-) I think disallowing the import of static members on non-static classes is a reasonable restriction, and I think being able to import instance members is just plain odd. Importing static members is ok - but can be confusing in the case of properties. I dislike the idea of importing the property getter in this case as it has different semantics to accessing the property as a member on the class. Michael > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From Colin.Han at grapecity.com Sat Jul 26 07:43:58 2008 From: Colin.Han at grapecity.com (Han Kejing) Date: Sat, 26 Jul 2008 13:43:58 +0800 Subject: [IronPython] FW: What is mean of "/*!*/" in source code. Message-ID: <8FAE2A142FCABE4EB6B37348D78A9BFE027052BA@XAEXG.GRAPECITY.NET> Hi, all, I'm reading the source code of IronPython 2.0 beta 4. I found some flags like "/*!*/" in source code. Who can tell me what is mean of this flag? I'm not sure that there is right place to ask this question. But I cannot find the answer from Google & Baidu J Thanks. ---------------------------------------------------------------- Do ONE thing, and do it WELL. Colin Han @ GrapeCity -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdhardy at gmail.com Sat Jul 26 20:59:48 2008 From: jdhardy at gmail.com (Jeff Hardy) Date: Sat, 26 Jul 2008 12:59:48 -0600 Subject: [IronPython] FW: What is mean of "/*!*/" in source code. In-Reply-To: <8FAE2A142FCABE4EB6B37348D78A9BFE027052BA@XAEXG.GRAPECITY.NET> References: <8FAE2A142FCABE4EB6B37348D78A9BFE027052BA@XAEXG.GRAPECITY.NET> Message-ID: On Fri, Jul 25, 2008 at 11:43 PM, Han Kejing wrote: > Hi, all, > > I'm reading the source code of IronPython 2.0 beta 4. I found some flags > like "/*!*/" in source code. Who can tell me what is mean of this flag? It comes from Spec#, in which you can add a ! to a type (such as string!) to indicate that it cannot be null. C# doesn't support that, unfortunately, but I believe one of MS's static analysis tools will recognize /*!*/ and treat it the same way. Personally, I'm really hoping that notation makes it into C# 4. -Jeff From fuzzyman at voidspace.org.uk Sat Jul 26 21:40:42 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sat, 26 Jul 2008 20:40:42 +0100 Subject: [IronPython] Using Python special methods in C# In-Reply-To: <7AD436E4270DD54A94238001769C2227012C93430DE7@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <4817b6fc0807131014v72644dd8r9ea464631e43e147@mail.gmail.com> <487A398D.8070109@voidspace.org.uk> <7AD436E4270DD54A94238001769C2227012C93430DE7@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <488B7DBA.2060700@voidspace.org.uk> Dino Viehland wrote: > Srivatsn's blog is an important piece of the puzzle, but the more general answer is implementing the __*__ method directly should always work. If it doesn't then it's a bug - like where __repr__ wasn't working w/o implementing the interface until recently. > Hello Dino, The following doesn't work for me with IronPython 2.0B3. namespace example { public class Example { private Dictionary store = new Dictionary(); public void __setattr__(string key, object value) { store[key] = value; } public object __getattr__(string key) { return store[key]; } } } When using it: >>> clr.AddReference('example') >>> from example import Example >>> e = Example() >>> e.a = 1 Traceback (most recent call last): File "", line 1, in AttributeError: 'Example' object has no attribute 'a' Do you know what protocol methods actually work? Michael > But there is a good reason to not implement the __*__ method - and that's ensuring that your objects will work good in a multi-language environment. What IronPython does to expose .NET objects into Python is it maps a large number of .NET interfaces and methods into Python methods. If you'd like to see the all of the mappings they're contained entirely in TypeInfo.cs. So instead of implementing __getitem__ you can implement a C# indexer, instead of __enter__/__exit__ you can implement IDisposable - assuming you're not doing more interesting things w/ __enter__/__exit__, etc... If there's some mapping that you think should exist but we don't have let us know - for example until recently we had overlooked mapping IDisposable. > > To get the best interop if there's a .NET interface or operator method that maps onto the Python methods you should use that. That includes the extended operators that we've defined for the DLR default binder like GetCustomMember as Srivatsn's blog demonstrates. Otherwise fallback to the __*_- method. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Sunday, July 13, 2008 10:21 AM > To: Discussion of IronPython > Subject: Re: [IronPython] Using Python special methods in C# > > Dan Eloff wrote: > >> Something I've found a little difficult in C# is python special >> methods. It seems sometimes you can just declare them on the C# class, >> (__repr__?) and they will work, other times you need to implement an >> interface (__call__?) is there any place this is documented? >> >> I'm a little confused about how to add special methods on C# classes. >> >> I want to add __getattr__ to a C# class (actually a subclass of >> PythonDictionary), and I have no idea how. >> >> > > This example from Srivatsn shows you how: > > http://blogs.msdn.com/srivatsn/archive/2008/04/12/turning-your-net-object-models-dynamic-for-ironpython.aspx > > Michael > >> Thanks, >> -Dan >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From erich.neuwirth at univie.ac.at Sat Jul 26 22:21:53 2008 From: erich.neuwirth at univie.ac.at (Erich Neuwirth) Date: Sat, 26 Jul 2008 22:21:53 +0200 Subject: [IronPython] Using Python special methods in C# In-Reply-To: <488B7DBA.2060700@voidspace.org.uk> References: <4817b6fc0807131014v72644dd8r9ea464631e43e147@mail.gmail.com> <487A398D.8070109@voidspace.org.uk> <7AD436E4270DD54A94238001769C2227012C93430DE7@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <488B7DBA.2060700@voidspace.org.uk> Message-ID: <488B8761.3050901@univie.ac.at> another thing. when you use MakeArgs, all the numbers that end up in the parameter string should be wrapped in a call to the function RNumber. RNumber makes sure the string has the correct decimal separator in an language combination of Excel, Windows, and R. Michael Foord wrote: > Dino Viehland wrote: >> Srivatsn's blog is an important piece of the puzzle, but the more >> general answer is implementing the __*__ method directly should always >> work. If it doesn't then it's a bug - like where __repr__ wasn't >> working w/o implementing the interface until recently. >> > > Hello Dino, > > The following doesn't work for me with IronPython 2.0B3. > > namespace example > { > public class Example > { > private Dictionary store = new Dictionary object>(); > > public void __setattr__(string key, object value) > { > store[key] = value; > } > > public object __getattr__(string key) > { > return store[key]; > } > } > } > > > When using it: > > >>> clr.AddReference('example') > >>> from example import Example > >>> e = Example() > >>> e.a = 1 > Traceback (most recent call last): > File "", line 1, in > AttributeError: 'Example' object has no attribute 'a' > > > Do you know what protocol methods actually work? > > Michael > >> But there is a good reason to not implement the __*__ method - and >> that's ensuring that your objects will work good in a multi-language >> environment. What IronPython does to expose .NET objects into Python >> is it maps a large number of .NET interfaces and methods into Python >> methods. If you'd like to see the all of the mappings they're >> contained entirely in TypeInfo.cs. So instead of implementing >> __getitem__ you can implement a C# indexer, instead of >> __enter__/__exit__ you can implement IDisposable - assuming you're not >> doing more interesting things w/ __enter__/__exit__, etc... If >> there's some mapping that you think should exist but we don't have let >> us know - for example until recently we had overlooked mapping >> IDisposable. >> >> To get the best interop if there's a .NET interface or operator method >> that maps onto the Python methods you should use that. That includes >> the extended operators that we've defined for the DLR default binder >> like GetCustomMember as Srivatsn's blog demonstrates. Otherwise >> fallback to the __*_- method. >> >> -----Original Message----- >> From: users-bounces at lists.ironpython.com >> [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord >> Sent: Sunday, July 13, 2008 10:21 AM >> To: Discussion of IronPython >> Subject: Re: [IronPython] Using Python special methods in C# >> >> Dan Eloff wrote: >> >>> Something I've found a little difficult in C# is python special >>> methods. It seems sometimes you can just declare them on the C# class, >>> (__repr__?) and they will work, other times you need to implement an >>> interface (__call__?) is there any place this is documented? >>> >>> I'm a little confused about how to add special methods on C# classes. >>> >>> I want to add __getattr__ to a C# class (actually a subclass of >>> PythonDictionary), and I have no idea how. >>> >>> >> >> This example from Srivatsn shows you how: >> >> http://blogs.msdn.com/srivatsn/archive/2008/04/12/turning-your-net-object-models-dynamic-for-ironpython.aspx >> >> >> Michael >> >>> Thanks, >>> -Dan >>> _______________________________________________ >>> Users mailing list >>> Users at lists.ironpython.com >>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>> >>> >> >> >> -- >> http://www.ironpythoninaction.com/ >> http://www.voidspace.org.uk/ >> http://www.trypython.org/ >> http://www.ironpython.info/ >> http://www.theotherdelia.co.uk/ >> http://www.resolverhacks.net/ >> >> _______________________________________________ >> 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 >> > > -- Erich Neuwirth, University of Vienna Faculty of Computer Science Computer Supported Didactics Working Group Visit our SunSITE at http://sunsite.univie.ac.at Phone: +43-1-4277-39464 Fax: +43-1-4277-39459 From fuzzyman at voidspace.org.uk Sat Jul 26 22:32:57 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sat, 26 Jul 2008 21:32:57 +0100 Subject: [IronPython] Using Python special methods in C# In-Reply-To: <7AD436E4270DD54A94238001769C2227012C93430DE7@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <4817b6fc0807131014v72644dd8r9ea464631e43e147@mail.gmail.com> <487A398D.8070109@voidspace.org.uk> <7AD436E4270DD54A94238001769C2227012C93430DE7@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <488B89F9.7090406@voidspace.org.uk> Hello Dino, The original question was about '__call__'. As far as I can *tell* that doesn't work either: namespace example { public class Example { public int __call__(string key) { Console.WriteLine(key); return 3; } } } >>> clr.AddReference('example') >>> from example import Example >>> >>> e = Example() >>> e('r') Traceback (most recent call last): File "", line 1, in TypeError: Example is not callable >>> e.__call__('r') r 3 >>> Michael Dino Viehland wrote: > Srivatsn's blog is an important piece of the puzzle, but the more general answer is implementing the __*__ method directly should always work. If it doesn't then it's a bug - like where __repr__ wasn't working w/o implementing the interface until recently. > > But there is a good reason to not implement the __*__ method - and that's ensuring that your objects will work good in a multi-language environment. What IronPython does to expose .NET objects into Python is it maps a large number of .NET interfaces and methods into Python methods. If you'd like to see the all of the mappings they're contained entirely in TypeInfo.cs. So instead of implementing __getitem__ you can implement a C# indexer, instead of __enter__/__exit__ you can implement IDisposable - assuming you're not doing more interesting things w/ __enter__/__exit__, etc... If there's some mapping that you think should exist but we don't have let us know - for example until recently we had overlooked mapping IDisposable. > > To get the best interop if there's a .NET interface or operator method that maps onto the Python methods you should use that. That includes the extended operators that we've defined for the DLR default binder like GetCustomMember as Srivatsn's blog demonstrates. Otherwise fallback to the __*_- method. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Sunday, July 13, 2008 10:21 AM > To: Discussion of IronPython > Subject: Re: [IronPython] Using Python special methods in C# > > Dan Eloff wrote: > >> Something I've found a little difficult in C# is python special >> methods. It seems sometimes you can just declare them on the C# class, >> (__repr__?) and they will work, other times you need to implement an >> interface (__call__?) is there any place this is documented? >> >> I'm a little confused about how to add special methods on C# classes. >> >> I want to add __getattr__ to a C# class (actually a subclass of >> PythonDictionary), and I have no idea how. >> >> > > This example from Srivatsn shows you how: > > http://blogs.msdn.com/srivatsn/archive/2008/04/12/turning-your-net-object-models-dynamic-for-ironpython.aspx > > Michael > >> Thanks, >> -Dan >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From erich.neuwirth at univie.ac.at Sat Jul 26 23:14:59 2008 From: erich.neuwirth at univie.ac.at (Erich Neuwirth) Date: Sat, 26 Jul 2008 23:14:59 +0200 Subject: [IronPython] Using Python special methods in C# In-Reply-To: <488B8761.3050901@univie.ac.at> References: <4817b6fc0807131014v72644dd8r9ea464631e43e147@mail.gmail.com> <487A398D.8070109@voidspace.org.uk> <7AD436E4270DD54A94238001769C2227012C93430DE7@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <488B7DBA.2060700@voidspace.org.uk> <488B8761.3050901@univie.ac.at> Message-ID: <488B93D3.2070700@univie.ac.at> Sorry for the nonsense, I did not notice I was answering to the wrong email. Hit the reply button with the cursor one line off. Erich Neuwirth wrote: > another thing. > when you use MakeArgs, > all the numbers that end up in the parameter string should > be wrapped in a call to the function RNumber. > RNumber makes sure the string has the correct decimal separator > in an language combination of Excel, Windows, and R. > > > > Michael Foord wrote: >> Dino Viehland wrote: >>> Srivatsn's blog is an important piece of the puzzle, but the more >>> general answer is implementing the __*__ method directly should >>> always work. If it doesn't then it's a bug - like where __repr__ >>> wasn't working w/o implementing the interface until recently. >>> >> >> Hello Dino, >> >> The following doesn't work for me with IronPython 2.0B3. >> >> namespace example >> { >> public class Example >> { >> private Dictionary store = new >> Dictionary(); >> >> public void __setattr__(string key, object value) >> { >> store[key] = value; >> } >> >> public object __getattr__(string key) >> { >> return store[key]; >> } >> } >> } >> >> >> When using it: >> >> >>> clr.AddReference('example') >> >>> from example import Example >> >>> e = Example() >> >>> e.a = 1 >> Traceback (most recent call last): >> File "", line 1, in >> AttributeError: 'Example' object has no attribute 'a' >> >> >> Do you know what protocol methods actually work? >> >> Michael >> >>> But there is a good reason to not implement the __*__ method - and >>> that's ensuring that your objects will work good in a multi-language >>> environment. What IronPython does to expose .NET objects into Python >>> is it maps a large number of .NET interfaces and methods into Python >>> methods. If you'd like to see the all of the mappings they're >>> contained entirely in TypeInfo.cs. So instead of implementing >>> __getitem__ you can implement a C# indexer, instead of >>> __enter__/__exit__ you can implement IDisposable - assuming you're >>> not doing more interesting things w/ __enter__/__exit__, etc... If >>> there's some mapping that you think should exist but we don't have >>> let us know - for example until recently we had overlooked mapping >>> IDisposable. >>> >>> To get the best interop if there's a .NET interface or operator >>> method that maps onto the Python methods you should use that. That >>> includes the extended operators that we've defined for the DLR >>> default binder like GetCustomMember as Srivatsn's blog demonstrates. >>> Otherwise fallback to the __*_- method. >>> >>> -----Original Message----- >>> From: users-bounces at lists.ironpython.com >>> [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord >>> Sent: Sunday, July 13, 2008 10:21 AM >>> To: Discussion of IronPython >>> Subject: Re: [IronPython] Using Python special methods in C# >>> >>> Dan Eloff wrote: >>> >>>> Something I've found a little difficult in C# is python special >>>> methods. It seems sometimes you can just declare them on the C# class, >>>> (__repr__?) and they will work, other times you need to implement an >>>> interface (__call__?) is there any place this is documented? >>>> >>>> I'm a little confused about how to add special methods on C# classes. >>>> >>>> I want to add __getattr__ to a C# class (actually a subclass of >>>> PythonDictionary), and I have no idea how. >>>> >>>> >>> >>> This example from Srivatsn shows you how: >>> >>> http://blogs.msdn.com/srivatsn/archive/2008/04/12/turning-your-net-object-models-dynamic-for-ironpython.aspx >>> >>> >>> Michael >>> >>>> Thanks, >>>> -Dan >>>> _______________________________________________ >>>> Users mailing list >>>> Users at lists.ironpython.com >>>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>>> >>>> >>> >>> >>> -- >>> http://www.ironpythoninaction.com/ >>> http://www.voidspace.org.uk/ >>> http://www.trypython.org/ >>> http://www.ironpython.info/ >>> http://www.theotherdelia.co.uk/ >>> http://www.resolverhacks.net/ >>> >>> _______________________________________________ >>> 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 >>> >> >> > -- Erich Neuwirth, University of Vienna Faculty of Computer Science Computer Supported Didactics Working Group Visit our SunSITE at http://sunsite.univie.ac.at Phone: +43-1-4277-39464 Fax: +43-1-4277-39459 From dan.eloff at gmail.com Sun Jul 27 18:24:08 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Sun, 27 Jul 2008 11:24:08 -0500 Subject: [IronPython] imports & .NET classes... In-Reply-To: <7AD436E4270DD54A94238001769C2227012C935C083C@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <7AD436E4270DD54A94238001769C2227012C935C083C@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <4817b6fc0807270924w65feb016u9d16a0874e1b1511@mail.gmail.com> On Fri, Jul 25, 2008 at 6:39 PM, Dino Viehland wrote: > To enable a better story w/ .NET we would like > to enable from System.DateTime import Parse ? supporting the import of > static functions. That seems reasonable, and it's consistent with being able to import static functions from static classes, which I like. > But the interesting question then becomes should we allow > from System.DateTime import Now ? a static property? Yes. To be honest I'd rather see this either disallowed altogether, or to function as it does currently. If you import a static property, it's like treating it as a module scoped variable in python, so it should behave like one, giving you the value of the property at import time. This means importing Now would make no sense unless you want the time at import. However, think if MaxValue was implemented as a static property. Treating it as a module scoped variable makes sense. Finally, should we > allow from System.DateTime import AddMonths ? an instance method? No. There is no precedent for that, it would be unexpected behavior. -Dan From dinov at exchange.microsoft.com Mon Jul 28 18:05:45 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 28 Jul 2008 09:05:45 -0700 Subject: [IronPython] Using Python special methods in C# In-Reply-To: <488B89F9.7090406@voidspace.org.uk> References: <4817b6fc0807131014v72644dd8r9ea464631e43e147@mail.gmail.com> <487A398D.8070109@voidspace.org.uk> <7AD436E4270DD54A94238001769C2227012C93430DE7@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <488B89F9.7090406@voidspace.org.uk> Message-ID: <7AD436E4270DD54A94238001769C2227012C935C090F@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Oh, yeah, I guess I was wrong about call/get/set/delete member customizers... Those are handled by the default DLR binder and Python doesn't recognize the __*__ names. I failed to consider that - sorry about that :) It's certainly true for all the complex Python operators such as binary operators, unary operators, indexing, slicing, etc... Instead for these you can use methods w/ special names which provide that functionality. That includes: GetCustomMember(string name) - gets a 1st try at all attribute access (e.g. __getattribute__) GetBoundMember(string name) - gets a last try at attribute access (e.g. __getattr__) SetMember(string name, object value) - gets 1st try at all attribute sets (e.g. __setattr__) SetMemberAfter(string name, object value) - gets the last try at attribute sets (no Python equivalent, runs if no .NET binding is available) DeleteMember(string name) - runs for deletes (__delattr__, there are no .NET deletes so no before/after semantics) These methods can have a strongly typed return type if you know you'll always return the same value. They can also return OperationFailed.Value to indicate that normal processing should continue. In other words you could have a GetCustomMember & GetBoundMember and GCM could defer back by returning OperationFailed.Value. All the methods need to be marked with a [SpecialName] attribute. Likewise you can define a Call method: [SpecialName] object Call(string someArg, int someOtherArg) and you can have various strongly typed overloads, etc... -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Saturday, July 26, 2008 1:33 PM To: Discussion of IronPython Subject: Re: [IronPython] Using Python special methods in C# Hello Dino, The original question was about '__call__'. As far as I can *tell* that doesn't work either: namespace example { public class Example { public int __call__(string key) { Console.WriteLine(key); return 3; } } } >>> clr.AddReference('example') >>> from example import Example >>> >>> e = Example() >>> e('r') Traceback (most recent call last): File "", line 1, in TypeError: Example is not callable >>> e.__call__('r') r 3 >>> Michael Dino Viehland wrote: > Srivatsn's blog is an important piece of the puzzle, but the more general answer is implementing the __*__ method directly should always work. If it doesn't then it's a bug - like where __repr__ wasn't working w/o implementing the interface until recently. > > But there is a good reason to not implement the __*__ method - and that's ensuring that your objects will work good in a multi-language environment. What IronPython does to expose .NET objects into Python is it maps a large number of .NET interfaces and methods into Python methods. If you'd like to see the all of the mappings they're contained entirely in TypeInfo.cs. So instead of implementing __getitem__ you can implement a C# indexer, instead of __enter__/__exit__ you can implement IDisposable - assuming you're not doing more interesting things w/ __enter__/__exit__, etc... If there's some mapping that you think should exist but we don't have let us know - for example until recently we had overlooked mapping IDisposable. > > To get the best interop if there's a .NET interface or operator method that maps onto the Python methods you should use that. That includes the extended operators that we've defined for the DLR default binder like GetCustomMember as Srivatsn's blog demonstrates. Otherwise fallback to the __*_- method. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Sunday, July 13, 2008 10:21 AM > To: Discussion of IronPython > Subject: Re: [IronPython] Using Python special methods in C# > > Dan Eloff wrote: > >> Something I've found a little difficult in C# is python special >> methods. It seems sometimes you can just declare them on the C# class, >> (__repr__?) and they will work, other times you need to implement an >> interface (__call__?) is there any place this is documented? >> >> I'm a little confused about how to add special methods on C# classes. >> >> I want to add __getattr__ to a C# class (actually a subclass of >> PythonDictionary), and I have no idea how. >> >> > > This example from Srivatsn shows you how: > > http://blogs.msdn.com/srivatsn/archive/2008/04/12/turning-your-net-object-models-dynamic-for-ironpython.aspx > > Michael > >> Thanks, >> -Dan >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Tue Jul 29 01:41:31 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 28 Jul 2008 16:41:31 -0700 Subject: [IronPython] Protected members breaking change... Message-ID: <7AD436E4270DD54A94238001769C2227012C935C0AB3@DF-GRTDANE-MSG.exchange.corp.microsoft.com> We're soon (post-Beta 4) going to be making a breaking change which will alter how protected members are exposed. Currently outside Silverlight or other partial trust scenarios you can access protected members on any type. For example today you can do: import clr # required for access to .NET members on object object().MemberwiseClone() in beta 3 this started issuing a warning* so if you've been doing this hopefully you've stopped :) You will still be able to do: class x(object): pass x().MemberwiseClone() as you will then be accessing the type through a derived type. Likewise we'll need to make sure that things like super continue to work as well. The main reason I'm sending this out is just so that everyone is aware of the upcoming change. But also I wanted to let you know of one breaking change. That is that you will no longer be able to access protected nested classes. So if in C# you've written: public class Outer { protected class Inner { public int x = 3; } } And in Python even if you subclass this: class x(Outer): pass you will not be able to access Inner. The reason why we won't support this is really just a matter of prioritization of work - we could enable richer .NET interop here if anyone was interested. But so far this seems like a sufficiently narrow corner case and it requires a significant amount of work so we're just trying to punt on it. Furthermore it's not a very interesting corner case because .NET design guidelines recommend against having non-private nested classes. If this is problematic for anyone please let us know. Thanks! *(that warning is overly aggressive so just because you see it doesn't mean you're doing something wrong) -------------- next part -------------- An HTML attachment was scrubbed... URL: From huzi_1982 at hotmail.com Tue Jul 29 09:25:40 2008 From: huzi_1982 at hotmail.com (Huzaifa) Date: Tue, 29 Jul 2008 00:25:40 -0700 (PDT) Subject: [IronPython] IAttributesInjector Message-ID: <18701101.post@talk.nabble.com> I can not find this interface in ironpython 2.0 .What is the alternative if this interface have been removed. -- View this message in context: http://www.nabble.com/IAttributesInjector-tp18701101p18701101.html Sent from the IronPython mailing list archive at Nabble.com. From Colin.Han at grapecity.com Tue Jul 29 10:00:01 2008 From: Colin.Han at grapecity.com (Han Kejing) Date: Tue, 29 Jul 2008 16:00:01 +0800 Subject: [IronPython] IAttributesInjector In-Reply-To: <18701101.post@talk.nabble.com> References: <18701101.post@talk.nabble.com> Message-ID: <8FAE2A142FCABE4EB6B37348D78A9BFE02705AD9@XAEXG.GRAPECITY.NET> Maybe is the "Microsoft.Scripting.Runtime.ExtensionTypeAttribute" attribute. You can found some simples in IronPythonTest project. ---------------------------------------------------------------- Follow my heart Colin Han @ GrapeCity -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Huzaifa Sent: 2008?7?29? 15:26 To: users at lists.ironpython.com Subject: [IronPython] IAttributesInjector I can not find this interface in ironpython 2.0 .What is the alternative if this interface have been removed. -- View this message in context: http://www.nabble.com/IAttributesInjector-tp18701101p18701101.html Sent from the IronPython mailing list archive at Nabble.com. _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From TPT at kamstrup.dk Tue Jul 29 13:16:46 2008 From: TPT at kamstrup.dk (Troels Pil Thomsen) Date: Tue, 29 Jul 2008 13:16:46 +0200 Subject: [IronPython] exception during ExecuteFile, when file is on network share Message-ID: <33EE873BE0061443B6ED20DC3BE88245067DF651@kamstrupexch1.kamstrup.dk> Hello, I have a python 1.1.1.0 host in my c# app, and when doing a engine.ExecuteFile(file); i often get the error below, when "file" is on a network share : (winXp client , windows ??? server) 21-07-2008 12:47:28 : Traceback (most recent call last): 21-07-2008 12:47:28 : File c:\sandbox\xxx.cs 21-07-2008 12:47:28 : File c:\sandboxx\yyy.cs 21-07-2008 12:47:28 : File mscorlib, line unknown, in ReadAllBytes 21-07-2008 12:47:28 : File mscorlib, line unknown, in Read 21-07-2008 12:47:28 : File mscorlib, line unknown, in ReadCore 21-07-2008 12:47:28 : File mscorlib, line unknown, in WinIOError 21-07-2008 12:47:28 : IOError: The specified network name is no longer available. 21-07-2008 12:47:28 : Exception is caught before first line in python is executed. If the file is not found , it fails with another IOError ("File not found") and another path down through mscorlib. Other parts of the program is also accessing the network (for copying files etc), and never fails, so networks connection is "ok" (maybe not perfect, but at least present.) Is the ExecuteFile reading the contents of the .py file differently than a "copy" primitive is (other timeout/retry values) ? Does anyone have any ideas of how to setup windows , ironpython host or .NET lib differently, to stop it doing this ? Fallback solution is to copy file locally before execution, but I would rather fix this. thx -------------- next part -------------- An HTML attachment was scrubbed... URL: From tpt at kamstrup.dk Tue Jul 29 14:39:11 2008 From: tpt at kamstrup.dk (mindmind) Date: Tue, 29 Jul 2008 05:39:11 -0700 (PDT) Subject: [IronPython] exception during ExecuteFile, when file is on network share In-Reply-To: <33EE873BE0061443B6ED20DC3BE88245067DF651@kamstrupexch1.kamstrup.dk> References: <33EE873BE0061443B6ED20DC3BE88245067DF651@kamstrupexch1.kamstrup.dk> Message-ID: <5d21acc2-88bb-410d-879b-0512216235c4@a1g2000hsb.googlegroups.com> > i often get the error below, when "file" is on a network share : During a nightly stress test, the program was set to run every 5 minutes, and the above error occured roughly 1 out of 4 times. From dinov at exchange.microsoft.com Tue Jul 29 18:30:23 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 29 Jul 2008 09:30:23 -0700 Subject: [IronPython] exception during ExecuteFile, when file is on network share In-Reply-To: <33EE873BE0061443B6ED20DC3BE88245067DF651@kamstrupexch1.kamstrup.dk> References: <33EE873BE0061443B6ED20DC3BE88245067DF651@kamstrupexch1.kamstrup.dk> Message-ID: <7AD436E4270DD54A94238001769C2227012C935C0BA9@DF-GRTDANE-MSG.exchange.corp.microsoft.com> We're just using a StreamReader and reading all the bytes in so we're not doing anything special here. There seem to be a lot of results for the problem (http://www.google.com/search?hl=en&q=.net+%22The+specified+network+name+is+no+longer+available.%22&start=10&sa=N) and many of them recommend looking at the event log (eventvwr) or upgrading network drivers. I doubt there's anything we're doing that would cause this but I also don't know why it'd only happen when we're doing the I/O either. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Troels Pil Thomsen Sent: Tuesday, July 29, 2008 4:17 AM To: users at lists.ironpython.com Subject: [IronPython] exception during ExecuteFile, when file is on network share Hello, I have a python 1.1.1.0 host in my c# app, and when doing a engine.ExecuteFile(file); i often get the error below, when "file" is on a network share : (winXp client , windows ??? server) 21-07-2008 12:47:28 : Traceback (most recent call last): 21-07-2008 12:47:28 : File c:\sandbox\xxx.cs 21-07-2008 12:47:28 : File c:\sandboxx\yyy.cs 21-07-2008 12:47:28 : File mscorlib, line unknown, in ReadAllBytes 21-07-2008 12:47:28 : File mscorlib, line unknown, in Read 21-07-2008 12:47:28 : File mscorlib, line unknown, in ReadCore 21-07-2008 12:47:28 : File mscorlib, line unknown, in WinIOError 21-07-2008 12:47:28 : IOError: The specified network name is no longer available. 21-07-2008 12:47:28 : Exception is caught before first line in python is executed. If the file is not found , it fails with another IOError ("File not found") and another path down through mscorlib. Other parts of the program is also accessing the network (for copying files etc), and never fails, so networks connection is "ok" (maybe not perfect, but at least present.) Is the ExecuteFile reading the contents of the .py file differently than a "copy" primitive is (other timeout/retry values) ? Does anyone have any ideas of how to setup windows , ironpython host or .NET lib differently, to stop it doing this ? Fallback solution is to copy file locally before execution, but I would rather fix this. thx -------------- next part -------------- An HTML attachment was scrubbed... URL: From huzi_1982 at hotmail.com Tue Jul 29 20:31:24 2008 From: huzi_1982 at hotmail.com (Huzaifa) Date: Tue, 29 Jul 2008 11:31:24 -0700 (PDT) Subject: [IronPython] IAttributesInjector In-Reply-To: <8FAE2A142FCABE4EB6B37348D78A9BFE02705AD9@XAEXG.GRAPECITY.NET> References: <18701101.post@talk.nabble.com> <8FAE2A142FCABE4EB6B37348D78A9BFE02705AD9@XAEXG.GRAPECITY.NET> Message-ID: <18718581.post@talk.nabble.com> I could not find it "Microsoft.Scripting.Runtime.ExtensionTypeAttribute" Han Kejing wrote: > > Maybe is the "Microsoft.Scripting.Runtime.ExtensionTypeAttribute" > attribute. > You can found some simples in IronPythonTest project. > > ---------------------------------------------------------------- > Follow my heart > Colin Han @ GrapeCity > > -----Original Message----- > From: users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] On Behalf Of Huzaifa > Sent: 2008?7?29? 15:26 > To: users at lists.ironpython.com > Subject: [IronPython] IAttributesInjector > > > I can not find this interface in ironpython 2.0 .What is the alternative > if > this interface have been removed. > -- > View this message in context: > http://www.nabble.com/IAttributesInjector-tp18701101p18701101.html > Sent from the IronPython mailing list archive at Nabble.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 > > -- View this message in context: http://www.nabble.com/IAttributesInjector-tp18701101p18718581.html Sent from the IronPython mailing list archive at Nabble.com. From huzi_1982 at hotmail.com Tue Jul 29 20:33:23 2008 From: huzi_1982 at hotmail.com (Huzaifa) Date: Tue, 29 Jul 2008 11:33:23 -0700 (PDT) Subject: [IronPython] difference b/w ironpython 1 and 2. Message-ID: <18718624.post@talk.nabble.com> Suggest me a book or link to find changes b/w ironpython 1 and 2. -- View this message in context: http://www.nabble.com/difference-b-w-ironpython-1-and-2.-tp18718624p18718624.html Sent from the IronPython mailing list archive at Nabble.com. From dinov at exchange.microsoft.com Tue Jul 29 20:39:27 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 29 Jul 2008 11:39:27 -0700 Subject: [IronPython] IAttributesInjector In-Reply-To: <18718581.post@talk.nabble.com> References: <18701101.post@talk.nabble.com> <8FAE2A142FCABE4EB6B37348D78A9BFE02705AD9@XAEXG.GRAPECITY.NET> <18718581.post@talk.nabble.com> Message-ID: <7AD436E4270DD54A94238001769C2227012C9376B89A@DF-GRTDANE-MSG.exchange.corp.microsoft.com> It's located in Microsoft.Scripting.dll (not to be confused w/ Microsoft.Scripting.Core.dll). The way you use this is you apply the assembly level attribute like: [assembly: ExtensionType(typeof(String), typeof(MyStringExtensions))] And then you define MyStringExtensions: public static class MyStringExtensions { [SpecialName] public static string GetCustomMember(string self, string name) { return name; } [SpecialName] public static void SetMember(string self, string name, object value) { Console.WriteLine("Set called, {0}, {1}", name, value); } } -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Huzaifa Sent: Tuesday, July 29, 2008 11:31 AM To: users at lists.ironpython.com Subject: Re: [IronPython] IAttributesInjector I could not find it "Microsoft.Scripting.Runtime.ExtensionTypeAttribute" Han Kejing wrote: > > Maybe is the "Microsoft.Scripting.Runtime.ExtensionTypeAttribute" > attribute. > You can found some simples in IronPythonTest project. > > ---------------------------------------------------------------- > Follow my heart > Colin Han @ GrapeCity > > -----Original Message----- > From: users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] On Behalf Of Huzaifa > Sent: 2008?7?29? 15:26 > To: users at lists.ironpython.com > Subject: [IronPython] IAttributesInjector > > > I can not find this interface in ironpython 2.0 .What is the alternative > if > this interface have been removed. > -- > View this message in context: > http://www.nabble.com/IAttributesInjector-tp18701101p18701101.html > Sent from the IronPython mailing list archive at Nabble.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 > > -- View this message in context: http://www.nabble.com/IAttributesInjector-tp18701101p18718581.html Sent from the IronPython mailing list archive at Nabble.com. _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Tue Jul 29 20:46:59 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 29 Jul 2008 11:46:59 -0700 Subject: [IronPython] difference b/w ironpython 1 and 2. In-Reply-To: <18718624.post@talk.nabble.com> References: <18718624.post@talk.nabble.com> Message-ID: <7AD436E4270DD54A94238001769C2227012C9376B8A7@DF-GRTDANE-MSG.exchange.corp.microsoft.com> The high level differences are: CPython 2.5 compatibility DLR support New hosting APIs New dispatch/binding infrastructure The beginnings of x-lang dynamic lang support Tons of bug fixes & general Python compatibility work -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Huzaifa Sent: Tuesday, July 29, 2008 11:33 AM To: users at lists.ironpython.com Subject: [IronPython] difference b/w ironpython 1 and 2. Suggest me a book or link to find changes b/w ironpython 1 and 2. -- View this message in context: http://www.nabble.com/difference-b-w-ironpython-1-and-2.-tp18718624p18718624.html Sent from the IronPython mailing list archive at Nabble.com. _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From huzi_1982 at hotmail.com Tue Jul 29 22:01:53 2008 From: huzi_1982 at hotmail.com (Huzaifa) Date: Tue, 29 Jul 2008 13:01:53 -0700 (PDT) Subject: [IronPython] PythonEngine Message-ID: <18720203.post@talk.nabble.com> I am not able to run this code with ironpython 2.0 PythonEngine _pyEngine; pyEngine = new PythonEngine(); _pyEngine.Globals["x"] = _x; -- View this message in context: http://www.nabble.com/PythonEngine-tp18720203p18720203.html Sent from the IronPython mailing list archive at Nabble.com. From dinov at exchange.microsoft.com Tue Jul 29 22:05:48 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 29 Jul 2008 13:05:48 -0700 Subject: [IronPython] PythonEngine In-Reply-To: <18720203.post@talk.nabble.com> References: <18720203.post@talk.nabble.com> Message-ID: <7AD436E4270DD54A94238001769C2227012C9376B8EB@DF-GRTDANE-MSG.exchange.corp.microsoft.com> PythonEngine has been replaced w/ the DLR hosting APIs. You'll want to do something more like: ScriptRuntime sr = ScriptRuntime.Create(); sr.Globals["x"] = _x; ScriptEngine se = sr.GetEngine("py"); There is a spec available for the hosting APIs at http://compilerlab.members.winisp.net/dlr-spec-hosting.pdf -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Huzaifa Sent: Tuesday, July 29, 2008 1:02 PM To: users at lists.ironpython.com Subject: [IronPython] PythonEngine I am not able to run this code with ironpython 2.0 PythonEngine _pyEngine; pyEngine = new PythonEngine(); _pyEngine.Globals["x"] = _x; -- View this message in context: http://www.nabble.com/PythonEngine-tp18720203p18720203.html Sent from the IronPython mailing list archive at Nabble.com. _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From fuzzyman at voidspace.org.uk Tue Jul 29 22:30:17 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 29 Jul 2008 21:30:17 +0100 Subject: [IronPython] IronPython Tutorial at PyCon UK Message-ID: <488F7DD9.2010802@voidspace.org.uk> Hello all, September 12-14th at the Birmingham Conservatoire is the 2nd UK Python Conference, organised by the UK Python community. This year the conference starts with a tutorial day, and Christian Muirhead [#]_, Menno Smits and I will be running a half day IronPython tutorial. The tutorial day is only ?30, so if you're interested in learning about IronPython it is an ideal opportunity. Tutorials: http://www.pyconuk.org/timetable.html Currently accepted talks: http://www.pyconuk.org/talk_abstracts.html Booking: http://www.pyconuk.org/booking.html Details on a summary of the accepted talks and tutorials on my blog. http://www.voidspace.org.uk/python/weblog/arch_d7_2008_07_26.shtml#e996 Thanks Michael Foord .. [#] Christian and I are the authors of the nearly published IronPython in Action with Manning Publications. -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ From Jimmy.Schementi at microsoft.com Wed Jul 30 02:11:35 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Tue, 29 Jul 2008 17:11:35 -0700 Subject: [IronPython] IronPython Tutorial at PyCon UK In-Reply-To: <488F7DD9.2010802@voidspace.org.uk> References: <488F7DD9.2010802@voidspace.org.uk> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A32845D498057D@NA-EXMSG-C116.redmond.corp.microsoft.com> Have fun! Wish I was there ... =P > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Tuesday, July 29, 2008 1:30 PM > To: Discussion of IronPython > Subject: [IronPython] IronPython Tutorial at PyCon UK > > Hello all, > > September 12-14th at the Birmingham Conservatoire is the 2nd UK Python > Conference, organised by the UK Python community. > > This year the conference starts with a tutorial day, and Christian > Muirhead [#]_, Menno Smits and I will be running a half day IronPython > tutorial. The tutorial day is only ?30, so if you're interested in > learning about IronPython it is an ideal opportunity. > > Tutorials: http://www.pyconuk.org/timetable.html > Currently accepted talks: http://www.pyconuk.org/talk_abstracts.html > Booking: http://www.pyconuk.org/booking.html > > Details on a summary of the accepted talks and tutorials on my blog. > http://www.voidspace.org.uk/python/weblog/arch_d7_2008_07_26.shtml#e996 > > Thanks > > Michael Foord > > .. [#] Christian and I are the authors of the nearly published > IronPython in Action with Manning Publications. > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From desleo at gmail.com Thu Jul 31 04:07:09 2008 From: desleo at gmail.com (Leo Carbajal) Date: Wed, 30 Jul 2008 21:07:09 -0500 Subject: [IronPython] Sandboxing using AppDomains Message-ID: Howdy all, I know this is a topic that comes up again and again but I was hoping I could get a bit of understanding from someone. So, like many others, I'm looking to get IPy to work in a relatively safe environment. My application is a game-server and exposes many entry points for user created scripts to essentially extend the game's reactions. Because these scripts are open to the public I need to be sure that it cannot do nasty things like delete all the script files, my app or anything else on the server, access my other non-exposed functions, etc. Anyway, so after reading up a little on AppDomains it sounds like running IPy through one could be a little prohibitive. I'm not really passing value-types to work on, I'm allowing the scripts to directly access and modify the objects themselves. I guess I'm not sure if what I want to do will even work, and I haven't had a chance to put together a test. The use of scripting in the application is extensive so I worry that I may have to scale back - or risk having someone one day using a little reflection to snoop out my app's API and calling functions that the scriptShell was never intended to be able to use. Would using permission.Deny for the permissions I want to disallow be enough to keep things safe? I.E. something like: //elsewhere private static PermissionSet ps = new PermissionSet(PermissionState.None); ps.AddPermission(new SecurityPermission(SecurityPermissionFlag.Execution)); ps.AddPermission(new FileIOPermission(FileIOPermissionAccess.PathDiscovery | FileIOPermissionAccess.Read, Path)); public static void PlayFirstFile(Item caller) { locals.Add("Artifact", new ScriptableItem(caller)); string script = (Path + "script.py"); ps.Deny(); engine.ExecuteFile(script, engine.DefaultModule, locals); locals.Clear(); } ScriptableItem, by the way, is a class wrapper to hide private methods in Item after I found out that passing something as a template doesn't work to occlude methods\properties I don't want called. =\ I'm a little lost when it comes to all this security stuff, I could really use a bit of explanation and would really appreciate any help that can come this way. I'm using IronPython 1.1.2 as I haven't had the chance to sit down and really play with 2.0, it seems a bit more convoluted to set-up but thats entirely a from-the-outside perspective at the moment. --- LC -------------- next part -------------- An HTML attachment was scrubbed... URL: From huzi_1982 at hotmail.com Thu Jul 31 07:51:14 2008 From: huzi_1982 at hotmail.com (Huzaifa) Date: Wed, 30 Jul 2008 22:51:14 -0700 (PDT) Subject: [IronPython] pyEngine.Execute Message-ID: <18748152.post@talk.nabble.com> pyEngine.Execute(script); What is the equivalent of this code in ironpython 2 . -- View this message in context: http://www.nabble.com/pyEngine.Execute-tp18748152p18748152.html Sent from the IronPython mailing list archive at Nabble.com. From Colin.Han at grapecity.com Thu Jul 31 08:04:27 2008 From: Colin.Han at grapecity.com (Han Kejing) Date: Thu, 31 Jul 2008 14:04:27 +0800 Subject: [IronPython] Sandboxing using AppDomains In-Reply-To: References: Message-ID: <8FAE2A142FCABE4EB6B37348D78A9BFE0273D83F@XAEXG.GRAPECITY.NET> Hi, Leo, Maybe follows document is helpful for you. http://blogs.msdn.com/shawnfa/archive/2005/08/08/449050.aspx PermissionSet.Deny is not safe. User code may use PermissionSet.Assert to get the power easily. ---------------------------------------------------------------- Follow my heart Colin Han @ MultiRow Developer Team (A Strong Team) From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Leo Carbajal Sent: 2008?7?31? 10:07 To: Users at lists.ironpython.com Subject: [IronPython] Sandboxing using AppDomains Howdy all, I know this is a topic that comes up again and again but I was hoping I could get a bit of understanding from someone. So, like many others, I'm looking to get IPy to work in a relatively safe environment. My application is a game-server and exposes many entry points for user created scripts to essentially extend the game's reactions. Because these scripts are open to the public I need to be sure that it cannot do nasty things like delete all the script files, my app or anything else on the server, access my other non-exposed functions, etc. Anyway, so after reading up a little on AppDomains it sounds like running IPy through one could be a little prohibitive. I'm not really passing value-types to work on, I'm allowing the scripts to directly access and modify the objects themselves. I guess I'm not sure if what I want to do will even work, and I haven't had a chance to put together a test. The use of scripting in the application is extensive so I worry that I may have to scale back - or risk having someone one day using a little reflection to snoop out my app's API and calling functions that the scriptShell was never intended to be able to use. Would using permission.Deny for the permissions I want to disallow be enough to keep things safe? I.E. something like: //elsewhere private static PermissionSet ps = new PermissionSet(PermissionState.None); ps.AddPermission(new SecurityPermission(SecurityPermissionFlag.Execution)); ps.AddPermission(new FileIOPermission(FileIOPermissionAccess.PathDiscovery | FileIOPermissionAccess.Read, Path)); public static void PlayFirstFile(Item caller) { locals.Add("Artifact", new ScriptableItem(caller)); string script = (Path + "script.py"); ps.Deny(); engine.ExecuteFile(script, engine.DefaultModule, locals); locals.Clear(); } ScriptableItem, by the way, is a class wrapper to hide private methods in Item after I found out that passing something as a template doesn't work to occlude methods\properties I don't want called. =\ I'm a little lost when it comes to all this security stuff, I could really use a bit of explanation and would really appreciate any help that can come this way. I'm using IronPython 1.1.2 as I haven't had the chance to sit down and really play with 2.0, it seems a bit more convoluted to set-up but thats entirely a from-the-outside perspective at the moment. --- LC -------------- next part -------------- An HTML attachment was scrubbed... URL: From Colin.Han at grapecity.com Thu Jul 31 08:14:13 2008 From: Colin.Han at grapecity.com (Han Kejing) Date: Thu, 31 Jul 2008 14:14:13 +0800 Subject: [IronPython] Sandboxing using AppDomains In-Reply-To: <8FAE2A142FCABE4EB6B37348D78A9BFE0273D83F@XAEXG.GRAPECITY.NET> References: <8FAE2A142FCABE4EB6B37348D78A9BFE0273D83F@XAEXG.GRAPECITY.NET> Message-ID: <8FAE2A142FCABE4EB6B37348D78A9BFE0273D859@XAEXG.GRAPECITY.NET> Sorry, My English is so bad. I cannot write more details about this topic. I had a sample to test the security of .NET FW. If you want it, you can send mail to me (colin DOT han AT grapecity DOT com). I will send it to you. ---------------------------------------------------------------- Follow my heart Colin Han @ MultiRow Developer Team (A Strong Team) From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Han Kejing Sent: 2008?7?31? 14:04 To: Discussion of IronPython Subject: Re: [IronPython] Sandboxing using AppDomains Hi, Leo, Maybe follows document is helpful for you. http://blogs.msdn.com/shawnfa/archive/2005/08/08/449050.aspx PermissionSet.Deny is not safe. User code may use PermissionSet.Assert to get the power easily. ---------------------------------------------------------------- Follow my heart Colin Han @ MultiRow Developer Team (A Strong Team) From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Leo Carbajal Sent: 2008?7?31? 10:07 To: Users at lists.ironpython.com Subject: [IronPython] Sandboxing using AppDomains Howdy all, I know this is a topic that comes up again and again but I was hoping I could get a bit of understanding from someone. So, like many others, I'm looking to get IPy to work in a relatively safe environment. My application is a game-server and exposes many entry points for user created scripts to essentially extend the game's reactions. Because these scripts are open to the public I need to be sure that it cannot do nasty things like delete all the script files, my app or anything else on the server, access my other non-exposed functions, etc. Anyway, so after reading up a little on AppDomains it sounds like running IPy through one could be a little prohibitive. I'm not really passing value-types to work on, I'm allowing the scripts to directly access and modify the objects themselves. I guess I'm not sure if what I want to do will even work, and I haven't had a chance to put together a test. The use of scripting in the application is extensive so I worry that I may have to scale back - or risk having someone one day using a little reflection to snoop out my app's API and calling functions that the scriptShell was never intended to be able to use. Would using permission.Deny for the permissions I want to disallow be enough to keep things safe? I.E. something like: //elsewhere private static PermissionSet ps = new PermissionSet(PermissionState.None); ps.AddPermission(new SecurityPermission(SecurityPermissionFlag.Execution)); ps.AddPermission(new FileIOPermission(FileIOPermissionAccess.PathDiscovery | FileIOPermissionAccess.Read, Path)); public static void PlayFirstFile(Item caller) { locals.Add("Artifact", new ScriptableItem(caller)); string script = (Path + "script.py"); ps.Deny(); engine.ExecuteFile(script, engine.DefaultModule, locals); locals.Clear(); } ScriptableItem, by the way, is a class wrapper to hide private methods in Item after I found out that passing something as a template doesn't work to occlude methods\properties I don't want called. =\ I'm a little lost when it comes to all this security stuff, I could really use a bit of explanation and would really appreciate any help that can come this way. I'm using IronPython 1.1.2 as I haven't had the chance to sit down and really play with 2.0, it seems a bit more convoluted to set-up but thats entirely a from-the-outside perspective at the moment. --- LC -------------- next part -------------- An HTML attachment was scrubbed... URL: From huzi_1982 at hotmail.com Thu Jul 31 08:58:17 2008 From: huzi_1982 at hotmail.com (Huzaifa) Date: Wed, 30 Jul 2008 23:58:17 -0700 (PDT) Subject: [IronPython] how to convert this code in py 2.0 Message-ID: <18748830.post@talk.nabble.com> Ops.ExtractException (ex, _pythonengine.Sys); TraceBack tb = _pythonengine.Sys.exc_traceback as TraceBack; if (tb != null) { ex.Data["LineNumber"] = tb.Line; //How to get Column? ex.Data["Offset"] = tb.Offset; //doesn't work? I am not able to convert this code into Ironpython 2 -- View this message in context: http://www.nabble.com/how-to-convert-this-code-in-py-2.0-tp18748830p18748830.html Sent from the IronPython mailing list archive at Nabble.com. From Jimmy.Schementi at microsoft.com Thu Jul 31 10:39:42 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Thu, 31 Jul 2008 01:39:42 -0700 Subject: [IronPython] loading an image in silverlight, in xaml, from the .xap In-Reply-To: <4817b6fc0807112352n11f18dfexb6f7acb9fbfe69dd@mail.gmail.com> References: <4817b6fc0807112352n11f18dfexb6f7acb9fbfe69dd@mail.gmail.com> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A32845D4A07EA2@NA-EXMSG-C116.redmond.corp.microsoft.com> Dan, http://silverlight.net/forums/p/17003/76203.aspx#76203 You're definitely not doing anything wrong. Here's a repro of your issue: http://jimmy.schementi.com/silverlight/xaml-image-bug/ The crazy thing is this only repros in Firefox3, and is perfectly fine in IE8! Even crazier, I just made a C# project with the Silverlight VS tools, and it worked both in FF3 and IE8, ugh. There's nothing fundamentally different about the 2, so I'm a little confused. I'm trying to make a minimal C# repro and figure out who to blame, me or the SL team. =P ~js > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Dan Eloff > Sent: Friday, July 11, 2008 11:53 PM > To: Discussion of IronPython > Subject: [IronPython] loading an image in silverlight, in xaml, from > the .xap > > I cannot load an image from in the xap file via uri. > > This one has been bugging me for a long time now. I think it must have > something to do with a difference between a Chiron xap and a VS built > xap. > > Could someone on the silverlight team (Jimmy!) please take a look at > the demo project and tell me what I'm doing wrong? > > http://silverlight.net/forums/t/17003.aspx > > Thanks, > -Dan > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From empirebuilder at gmail.com Thu Jul 31 12:11:41 2008 From: empirebuilder at gmail.com (Dody Gunawinata) Date: Thu, 31 Jul 2008 13:11:41 +0300 Subject: [IronPython] how to convert this code in py 2.0 In-Reply-To: <18748830.post@talk.nabble.com> References: <18748830.post@talk.nabble.com> Message-ID: <8cd017b80807310311w703295e0sd9eaea2a45cd270d@mail.gmail.com> You can get those information via SyntaxErrorException On Thu, Jul 31, 2008 at 9:58 AM, Huzaifa wrote: > > Ops.ExtractException (ex, _pythonengine.Sys); > TraceBack tb = _pythonengine.Sys.exc_traceback as TraceBack; > if (tb != null) { > ex.Data["LineNumber"] = tb.Line; > //How to get Column? > ex.Data["Offset"] = tb.Offset; //doesn't work? > > > I am not able to convert this code into Ironpython 2 > -- > View this message in context: > http://www.nabble.com/how-to-convert-this-code-in-py-2.0-tp18748830p18748830.html > Sent from the IronPython mailing list archive at Nabble.com. > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- nomadlife.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Thu Jul 31 17:12:09 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Thu, 31 Jul 2008 08:12:09 -0700 Subject: [IronPython] how to convert this code in py 2.0 In-Reply-To: <8cd017b80807310311w703295e0sd9eaea2a45cd270d@mail.gmail.com> References: <18748830.post@talk.nabble.com> <8cd017b80807310311w703295e0sd9eaea2a45cd270d@mail.gmail.com> Message-ID: <7AD436E4270DD54A94238001769C2227012C9376BD26@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Or RuntimeHelpers.GetDynamicStackFrames to get the line number information for exceptions that occur at runtime. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dody Gunawinata Sent: Thursday, July 31, 2008 3:12 AM To: Discussion of IronPython Subject: Re: [IronPython] how to convert this code in py 2.0 You can get those information via SyntaxErrorException On Thu, Jul 31, 2008 at 9:58 AM, Huzaifa > wrote: Ops.ExtractException (ex, _pythonengine.Sys); TraceBack tb = _pythonengine.Sys.exc_traceback as TraceBack; if (tb != null) { ex.Data["LineNumber"] = tb.Line; //How to get Column? ex.Data["Offset"] = tb.Offset; //doesn't work? I am not able to convert this code into Ironpython 2 -- View this message in context: http://www.nabble.com/how-to-convert-this-code-in-py-2.0-tp18748830p18748830.html Sent from the IronPython mailing list archive at Nabble.com. _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- nomadlife.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From seshapv at microsoft.com Thu Jul 31 17:38:29 2008 From: seshapv at microsoft.com (Seshadri Pillailokam Vijayaraghavan) Date: Thu, 31 Jul 2008 08:38:29 -0700 Subject: [IronPython] pyEngine.Execute In-Reply-To: <18748152.post@talk.nabble.com> References: <18748152.post@talk.nabble.com> Message-ID: <4F06AAB8EC03C349A5D6D0A797C4881C40B5B69C1F@NA-EXMSG-C112.redmond.corp.microsoft.com> See if the information in this post helps - http://blogs.msdn.com/seshadripv/archive/2008/07/28/various-ways-to-execute-script-using-the-dlr-hosting-api.aspx -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Huzaifa Sent: Wednesday, July 30, 2008 10:51 PM To: users at lists.ironpython.com Subject: [IronPython] pyEngine.Execute pyEngine.Execute(script); What is the equivalent of this code in ironpython 2 . -- View this message in context: http://www.nabble.com/pyEngine.Execute-tp18748152p18748152.html Sent from the IronPython mailing list archive at Nabble.com. _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From anders.elfgren at avalanchestudios.se Thu Jul 31 18:22:01 2008 From: anders.elfgren at avalanchestudios.se (Anders Elfgren) Date: Thu, 31 Jul 2008 18:22:01 +0200 Subject: [IronPython] Using a c library as a dll or assembly Message-ID: <698E8783CC407F4EB0DC9E994B6D4540906D64@nut.avalanchestudios.se> Hi, First let me say that I'm new to Iron Python, but at least I've read this in the FAQ.. :) Q: How do I build and call into PYD libraries? A: IronPython does not support using PYDs built for CPython since they leverage implementation details of CPython. You can get a similar effect for new "PYD"s you would like to implement by writing them in C# or VB and building a DLL for .NET. That said, I've got some questions to see if what I'm doing is possible anyway. We've got a c library of which most of the code has also been written in Python. We want to create an editor using .net forms which we can use to edit some files, and to do that we need some data structures that exist in this library. My current idea is to interface against the python library using IronPython, and then accessing the datastructures through that in C# (although if absolutely necessary, we could write the editor in IronPython too). The thing that is standing against me now is that one function that exists a small C dll. Since IronPython can't access this (unless this has changed since the FAQ was written?), I was thinking that maybe I can compile the dll using the /clr flag and thus get a .net assembly. Would I then be able to use the function? The Python code just tries to import it: import AvHash And then use it.. def AdfHash(str): return AvHash.HashString(str) At the import statement, this error is raised: Traceback (most recent call last): File X:\ctg\libs\ADF\main\common\modeditor.ipy, line 20, in Initialize File , line 0, in __import__##4 File X:\ctg\libs\ADF\main\common\AdfLib.py, line 1, in Initialize File , line 0, in __import__##4 ImportError: No module named AvHash Or is there some other solution? I've just started researching how to interface between C/C#/Python/IronPython so there may well be things I haven't heard of... I hope I've made my problem clear, thanks for any responses. :) /Anders -------------- next part -------------- An HTML attachment was scrubbed... URL: From srivatsn at microsoft.com Thu Jul 31 18:26:13 2008 From: srivatsn at microsoft.com (Srivatsn Narayanan) Date: Thu, 31 Jul 2008 09:26:13 -0700 Subject: [IronPython] Using a c library as a dll or assembly In-Reply-To: <698E8783CC407F4EB0DC9E994B6D4540906D64@nut.avalanchestudios.se> References: <698E8783CC407F4EB0DC9E994B6D4540906D64@nut.avalanchestudios.se> Message-ID: Did you add a reference to the dll before importing it - like this: import clr clr.AddReference("myclib.dll") From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Anders Elfgren Sent: Thursday, July 31, 2008 9:22 AM To: users at lists.ironpython.com Subject: [IronPython] Using a c library as a dll or assembly Hi, First let me say that I'm new to Iron Python, but at least I've read this in the FAQ.. :) Q: How do I build and call into PYD libraries? A: IronPython does not support using PYDs built for CPython since they leverage implementation details of CPython. You can get a similar effect for new "PYD"s you would like to implement by writing them in C# or VB and building a DLL for .NET. That said, I've got some questions to see if what I'm doing is possible anyway. We've got a c library of which most of the code has also been written in Python. We want to create an editor using .net forms which we can use to edit some files, and to do that we need some data structures that exist in this library. My current idea is to interface against the python library using IronPython, and then accessing the datastructures through that in C# (although if absolutely necessary, we could write the editor in IronPython too). The thing that is standing against me now is that one function that exists a small C dll. Since IronPython can't access this (unless this has changed since the FAQ was written?), I was thinking that maybe I can compile the dll using the /clr flag and thus get a .net assembly. Would I then be able to use the function? The Python code just tries to import it: import AvHash And then use it.. def AdfHash(str): return AvHash.HashString(str) At the import statement, this error is raised: Traceback (most recent call last): File X:\ctg\libs\ADF\main\common\modeditor.ipy, line 20, in Initialize File , line 0, in __import__##4 File X:\ctg\libs\ADF\main\common\AdfLib.py, line 1, in Initialize File , line 0, in __import__##4 ImportError: No module named AvHash Or is there some other solution? I've just started researching how to interface between C/C#/Python/IronPython so there may well be things I haven't heard of... I hope I've made my problem clear, thanks for any responses. :) /Anders -------------- next part -------------- An HTML attachment was scrubbed... URL: From Harry.Pierson at microsoft.com Thu Jul 31 19:22:15 2008 From: Harry.Pierson at microsoft.com (Harry Pierson) Date: Thu, 31 Jul 2008 10:22:15 -0700 Subject: [IronPython] IPy Post 2.0 Roadmap Clarifications In-Reply-To: <698E8783CC407F4EB0DC9E994B6D4540906D64@nut.avalanchestudios.se> References: <698E8783CC407F4EB0DC9E994B6D4540906D64@nut.avalanchestudios.se> Message-ID: I posted an update to the roadmap on my blog to address two questions that came up in my comments section. http://devhawk.net/2008/07/30/IPy+Post+20+Roadmap+Clarifications.aspx. We discussed Michael Foord's question "will you actively maintain IronPython 2 and IronPython 3 in parallel?" here on the list. The short answer was "this will be driven mostly by the needs of our community". Francois wanted to "Will it be necessary to buy VS standard/Pro to benefit from it?" Short answer: "No" Harry -------------- next part -------------- An HTML attachment was scrubbed... URL: From curt at hagenlocher.org Thu Jul 31 20:21:04 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Thu, 31 Jul 2008 11:21:04 -0700 Subject: [IronPython] Using a c library as a dll or assembly In-Reply-To: <698E8783CC407F4EB0DC9E994B6D4540906D64@nut.avalanchestudios.se> References: <698E8783CC407F4EB0DC9E994B6D4540906D64@nut.avalanchestudios.se> Message-ID: It wouldn't be sufficient to recompile with /clr. When you do that, your classes don't automatically become managed classes. You would still need to either modify your classes or to create wrappers using C++/CLI ( http://en.wikipedia.org/wiki/C%2B%2B/CLI). In order for a C++ class to be visible to IronPython, it would need to be declared as a "ref class" -- you can see more about that at the referenced Wikipedia article. On Thu, Jul 31, 2008 at 9:22 AM, Anders Elfgren < anders.elfgren at avalanchestudios.se> wrote: > Hi, > > First let me say that I'm new to Iron Python, but at least I've read this > in the FAQ.. :) > > Q: How do I build and call into *PYD* libraries? > A: *IronPython* does not support using PYDs built for CPython since they > leverage implementation details of CPython. You can get a similar effect > for new "*PYD*"s you would like to implement by writing them in C# or VB > and building a DLL for .NET. > > That said, I've got some questions to see if what I'm doing is possible > anyway. > > We've got a c library of which most of the code has also been written in > Python. We want to create an editor using .net forms which we can use to > edit some files, and to do that we need some data structures that exist in > this library. > > My current idea is to interface against the python library using > IronPython, and then accessing the datastructures through that in C# > (although if absolutely necessary, we could write the editor in IronPython > too). The thing that is standing against me now is that one function that > exists a small C dll. Since IronPython can't access this (unless this has > changed since the FAQ was written?), I was thinking that maybe I can compile > the dll using the /clr flag and thus get a .net assembly. Would I then be > able to use the function? > > The Python code just tries to import it: > import AvHash > > And then use it.. > def AdfHash(str): > return AvHash.HashString(str) > > > At the import statement, this error is raised: > Traceback (most recent call last): > File X:\ctg\libs\ADF\main\common\modeditor.ipy, line 20, in Initialize > File , line 0, in __import__##4 > File X:\ctg\libs\ADF\main\common\AdfLib.py, line 1, in Initialize > File , line 0, in __import__##4 > ImportError: No module named AvHash > > > > Or is there some other solution? I've just started researching how to > interface between C/C#/Python/IronPython so there may well be things I > haven't heard of... > I hope I've made my problem clear, thanks for any responses. :) > > /Anders > > > _______________________________________________ > 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 ctrachte at gmail.com Thu Jul 31 22:54:09 2008 From: ctrachte at gmail.com (Carl Trachte) Date: Thu, 31 Jul 2008 13:54:09 -0700 Subject: [IronPython] IronPython Code Coverage - any options? Message-ID: <426ada670807311354n2dae668buf9245dfad37b8bd3@mail.gmail.com> Hello, I just did a Google search and found Michael Foord's blog post on coverage tools, among other things test related: http://www.voidspace.org.uk/python/weblog/arch_d7_2006_06_17.shtml Has anything else come up since then? Does (if I can ask) Resolver use a code coverage tool? I'm just getting started testing with unitttest and I'd like to gauge my progress as I implement testing in more of my code. Thanks a ton for any information you can provide. Carl T. From fuzzyman at voidspace.org.uk Thu Jul 31 23:30:09 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 31 Jul 2008 22:30:09 +0100 Subject: [IronPython] IPy Post 2.0 Roadmap Clarifications In-Reply-To: References: <698E8783CC407F4EB0DC9E994B6D4540906D64@nut.avalanchestudios.se> Message-ID: <48922EE1.7020909@voidspace.org.uk> That's a great entry - good news! Michael Harry Pierson wrote: > > I posted an update to the roadmap on my blog to address two questions > that came up in my comments section. > http://devhawk.net/2008/07/30/IPy+Post+20+Roadmap+Clarifications.aspx. > > We discussed Michael Foord?s question "will you actively maintain > IronPython 2 and IronPython 3 in parallel?" here on the list. The > short answer was ?this will be driven mostly by the needs of our > community?. > > Francois wanted to "Will it be necessary to buy VS standard/Pro to > benefit from it?" Short answer: ?No? > > Harry > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/