From fuzzyman at voidspace.org.uk Sun Jul 1 21:00:41 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sun, 01 Jul 2007 20:00:41 +0100 Subject: [IronPython] IronPython 2.0 Alpha 2 Message-ID: <4687F9D9.3040801@voidspace.org.uk> Hello all, I've been playing with a simple C# script illustrating embedding IronPython 2.0. The following code works fine for 2.0 Alpha 1: using System; using Microsoft.Scripting; namespace IronPythonScriptHost { class Program { static void Main(string[] args) { string code = "print \"Hello\" + Name"; Script.SetVariable("Name", "Nick"); Script.Execute("py", code); Console.Read(); } } } When run with 2.0 Alpha 2, it produces the following error (saying that the version of the Python language provider is incorrect): Unhandled Exception: Microsoft.Scripting.MissingTypeException: Type 'IronPython, Version=2.0.0.100, Culture=neutral, PublicKeyToken=31bf3856ad364e35, IronPython.Hosting.PythonLanguageProvider' is missing or cannot be loaded. ---> System.IO.FileLoadException: Could not load file or assembly 'IronPython, Version=2.0.0.100, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) File name: 'IronPython, Version=2.0.0.100, Culture=neutral, PublicKeyToken=31bf3856ad364e35' at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) at System.Reflection.Assembly.Load(String assemblyString) at Microsoft.Scripting.Hosting.PlatformAdaptationLayer.LoadAssembly(String name) at Microsoft.Scripting.ScriptDomainManager.LanguageProviderDesc.LoadProvider(ScriptDomainManager manager) As far as I can see from the docs, this part of the API should still work, and I am referencing the DLLs provided in the Alpha 2 release. Any clues? Michael Foord http://www.voidspace.org.uk/ironpython/index.shtml From andy.tao at freeborders.com.cn Mon Jul 2 02:54:29 2007 From: andy.tao at freeborders.com.cn (=?gb2312?B?zNXX5rrp?=) Date: Mon, 2 Jul 2007 08:54:29 +0800 Subject: [IronPython] IronPython v2.0 Alpha 2 Released! In-Reply-To: <46857F0D.7000601@v-sim.com> References: <7AD436E4270DD54A94238001769C2227A71E579E94@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <46857F0D.7000601@v-sim.com> Message-ID: <005a01c7bc43$8b857b00$3069a8c0@china.freeborders> Hi, Dino: Thanks for your hard work! I noticed that the demos showed on MIX'07 about multiple script language share data and functions, can you give us a example to do that using new release. Thanks. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Tony Djordjevski Sent: Saturday, June 30, 2007 05:52 To: Discussion of IronPython Subject: Re: [IronPython] IronPython v2.0 Alpha 2 Released! Hi Dino, Congrats on the new release! Can you give us an update on the status of the multiple engine debate and does this release change anything on that front? When Alpha 1 was released, we discussed swappable SystemStates as an alternative to multiple engine instances. Does this release include this functionality? Thanks, Tony Dino Viehland wrote: > Hello IronPython Community, > > We have just released IronPython 2.0 Alpha 2. This release is a snapshot of the on-going progress with IronPython 2.0 and the DLR. > One of the most significant changes in this release is the removal of Microsoft.Scripting.Vestigial. Previously this DLL was a combination of both IronPython support code as well as portions of the DLR. With Alpha 2 Microsoft.Scripting.dll contains all portions of the DLR and IronPython.dll contains the IronPython implementation which builds upon the DLR. This should help consumers of the DLR to better understand the public surface area. Being early in the product cycle this surface area may still change significantly but there are now bright lines between what DLR code is and what IronPython code is. > > IronPython also continues to use the underlying concepts of the DLR more and more. In the Alpha 1 release there were numerous locations where IronPython would use DynamicSites but fallback to runtime lookups because the site couldn't perform optimally. In this release we've continued to flush out these corner cases and improve IronPython's support for generating proper rules when using DynamicSites. We've also improved the shared infrastructure the DLR provides for creating rules and moved IronPython to this shared infrastructure. > > Significant changes in the DLR include the removal of Microsoft.Scripting. Vestigial, continued refinement of the AST and dynamic site support, and replacement of the old IDynamicObject with the new IDynamicObject. IronPython has also been updated to use more of the DLR concepts. > The DLR also continues to be expanded and improved. The DLR AST has been improved with support for more static constructs such as simple exception handling constructors and better variable support. The DLR AST factory methods have also been moved to a static Ast class to enable easier construction of ASTs. There have also been some additional convenience methods added to various nodes to make construction even easier still. Finally the DLR also has been improved to support an arbitrary number of arguments inside a DynamicSite which helps to enable calling all functions in an optimized manner. > > One of the most significant (although fairly small) improvements is the introduction of the IDynamicObject interface under its proper name. In the Alpha 1 release this interface was temporarily named IActionable because IronPython had previously shipped with an IDynamicObject interface. In this new release the old interface has been completely removed and the DLR now provides the correct IDynamicObject interface. This interface lives at the heart of the DLR so it's noteworthy that it's now found its final home. > > Note: Due to dependencies upon APIs that are not present in Silverlight 1. 1 Alpha (released at MIX) you won't be able to re-build this release for use with Silverlight. As both products stabilize more we expect better compatibility between releases. > > You can download IronPython v2.0 at: > http://www.codeplex.com/IronPython/Release/ProjectReleases.aspx?Releas > eId=5246 > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.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 davidjensen at usa.net Mon Jul 2 12:49:27 2007 From: davidjensen at usa.net (David Jensen) Date: Mon, 02 Jul 2007 06:49:27 -0400 Subject: [IronPython] zope, cherrypy Message-ID: <032LgBkWb4680S02.1183373367@cmsweb02.cms.usa.net> Will IronPython on the backend support web server software such as Zope and CherryPy, and, therefore, Plone, TurboGears, Django, etc.? David Jensen From sh at defuze.org Mon Jul 2 12:57:42 2007 From: sh at defuze.org (Sylvain Hellegouarch) Date: Mon, 02 Jul 2007 11:57:42 +0100 Subject: [IronPython] zope, cherrypy In-Reply-To: <032LgBkWb4680S02.1183373367@cmsweb02.cms.usa.net> References: <032LgBkWb4680S02.1183373367@cmsweb02.cms.usa.net> Message-ID: <4688DA26.2040109@defuze.org> David Jensen a ?crit : > Will IronPython on the backend support web server software such as Zope and > CherryPy, and, therefore, Plone, TurboGears, Django, etc.? > I cannot speak for Zope but IP1.1 will not run CherryPy 3 as-is because there are some shotcomings in IP1.1 that prevent it. However it is possible to run part of CP3, notably its HTTP server. Note that I believe those issues will be addressed in IP2 and I do hope we will be able to run CP3 without hack. Nonetheless, Zope, TurboGears and other large frameworks do tend to use Python to its stretch and may rely on some behavior inherent to CPython itself. It might never be possible to run those completely with IP, at least not without some hacking. - Sylvain From fuzzyman at voidspace.org.uk Mon Jul 2 13:00:51 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 02 Jul 2007 12:00:51 +0100 Subject: [IronPython] zope, cherrypy In-Reply-To: <4688DA26.2040109@defuze.org> References: <032LgBkWb4680S02.1183373367@cmsweb02.cms.usa.net> <4688DA26.2040109@defuze.org> Message-ID: <4688DAE3.6030408@voidspace.org.uk> Although some folk have had Django running on IP. Michael Foord http://www.voidspace.org.uk/ironpython/index.shtml Sylvain Hellegouarch wrote: > David Jensen a ?crit : > >> Will IronPython on the backend support web server software such as Zope and >> CherryPy, and, therefore, Plone, TurboGears, Django, etc.? >> >> > > I cannot speak for Zope but IP1.1 will not run CherryPy 3 as-is because > there are some shotcomings in IP1.1 that prevent it. > > However it is possible to run part of CP3, notably its HTTP server. > > Note that I believe those issues will be addressed in IP2 and I do hope > we will be able to run CP3 without hack. > > Nonetheless, Zope, TurboGears and other large frameworks do tend to use > Python to its stretch and may rely on some behavior inherent to CPython > itself. It might never be possible to run those completely with IP, at > least not without some hacking. > > - Sylvain > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > From sanxiyn at gmail.com Mon Jul 2 13:42:04 2007 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Mon, 2 Jul 2007 20:42:04 +0900 Subject: [IronPython] zope, cherrypy In-Reply-To: <032LgBkWb4680S02.1183373367@cmsweb02.cms.usa.net> References: <032LgBkWb4680S02.1183373367@cmsweb02.cms.usa.net> Message-ID: <5b0248170707020442m4b0253dfnfa4778ea36f9f4a@mail.gmail.com> 2007/7/2, David Jensen : > Will IronPython on the backend support web server software such as Zope and > CherryPy, and, therefore, Plone, TurboGears, Django, etc.? This is ultimately the goal of FePy project. On the other hand, Microsoft doesn't seem to be interested in this side of IronPython usage, as far as I can tell from their behaviour to the date. -- Seo Sanghyeon From dinov at exchange.microsoft.com Mon Jul 2 17:49:01 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 2 Jul 2007 08:49:01 -0700 Subject: [IronPython] IronPython 2.0 Alpha 2 In-Reply-To: <4687F9D9.3040801@voidspace.org.uk> References: <4687F9D9.3040801@voidspace.org.uk> Message-ID: <7AD436E4270DD54A94238001769C2227A71E579FD1@DF-GRTDANE-MSG.exchange.corp.microsoft.com> This is a bug. Unfortunately it looks like one of the version numbers didn't get updated. In Src\Microsoft.Scripting\Hosting\PlatformAdapationLayer.cs there are currently some version numbers hard-coded until we get a better configuration story: PlatformAdaptationLayer.cs: _assemblyFullNames.Add("microsoft.scripting", "Microsoft.Scripting, Version=1.0.0.100, PublicKeyToken=b03f5f7f11d50a3a"); PlatformAdaptationLayer.cs: _assemblyFullNames.Add("microsoft.scripting.vestigial", "Microsoft.Scripting.Vestigial, Version=1.0.0.100, PublicKeyToken =b03f5f7f11d50a3a"); PlatformAdaptationLayer.cs: _assemblyFullNames.Add("ironpython", "IronPython, Version=2.0.0.100, PublicKeyToken=b03f5f7f11d50a3a"); PlatformAdaptationLayer.cs: _assemblyFullNames.Add("ironpython.modules", "IronPython.Modules, Version=2.0.0.100, PublicKeyToken=b03f5f7f11d50a3a"); Those should all be .200 for the alpha 2 release. We have a better script for automatically updating these so this shouldn't be an issue w/ future releases (and hopefully these hard coded strings will go away fairly soon anyway). Sorry for the trouble. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Sunday, July 01, 2007 12:01 PM To: Discussion of IronPython Subject: [IronPython] IronPython 2.0 Alpha 2 Hello all, I've been playing with a simple C# script illustrating embedding IronPython 2.0. The following code works fine for 2.0 Alpha 1: using System; using Microsoft.Scripting; namespace IronPythonScriptHost { class Program { static void Main(string[] args) { string code = "print \"Hello\" + Name"; Script.SetVariable("Name", "Nick"); Script.Execute("py", code); Console.Read(); } } } When run with 2.0 Alpha 2, it produces the following error (saying that the version of the Python language provider is incorrect): Unhandled Exception: Microsoft.Scripting.MissingTypeException: Type 'IronPython, Version=2.0.0.100, Culture=neutral, PublicKeyToken=31bf3856ad364e35, IronPython.Hosting.PythonLanguageProvider' is missing or cannot be loaded. ---> System.IO.FileLoadException: Could not load file or assembly 'IronPython, Version=2.0.0.100, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) File name: 'IronPython, Version=2.0.0.100, Culture=neutral, PublicKeyToken=31bf3856ad364e35' at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) at System.Reflection.Assembly.Load(String assemblyString) at Microsoft.Scripting.Hosting.PlatformAdaptationLayer.LoadAssembly(String name) at Microsoft.Scripting.ScriptDomainManager.LanguageProviderDesc.LoadProvider(ScriptDomainManager manager) As far as I can see from the docs, this part of the API should still work, and I am referencing the DLLs provided in the Alpha 2 release. Any clues? Michael Foord http://www.voidspace.org.uk/ironpython/index.shtml _______________________________________________ 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 2 17:52:47 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 2 Jul 2007 08:52:47 -0700 Subject: [IronPython] IronPython v2.0 Alpha 2 Released! In-Reply-To: <005a01c7bc43$8b857b00$3069a8c0@china.freeborders> References: <7AD436E4270DD54A94238001769C2227A71E579E94@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <46857F0D.7000601@v-sim.com> <005a01c7bc43$8b857b00$3069a8c0@china.freeborders> Message-ID: <7AD436E4270DD54A94238001769C2227A71E579FD2@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Unfortunately you're going to need another DLR language in order to demonstrate that. This refresh only includes IronPython so there isn't much to see there (as the previously released JS bits won't run against it). Here's some sample code of how it would work if you had a 2nd language and that 2nd language happened to be JavaScript: CompiledCode pyCode = new SourceCodeUnit(PY, "def pyf(): return 42").Compile(); CompiledCode jsCode = new SourceCodeUnit(JS, "function jsf() { return pyf(); } ").Compile(); IScriptModule sm = _env.CreateModule("test", pyCode, jsCode); sm.Execute(); Assert(sm.VariableExists("pyf"), "python function not defined"); Assert(sm.VariableExists("jsf"), "JavaScript function not defined"); object x = PythonCalls.Call(sm.LookupVariable("pyf")); AreEqual(x, 42); object y = JSCall(sm, "jsf"); AreEqual(y, 42); Where "PY" == an instance of PythonEngine and JS is an instance of JavaScript's ScriptEngine. Basically this is compiling some code in both JS & VB, putting that code into one shared module (so they have the same set of global variables), and then executing the code. This is more or less what the DLR console does to enable multiple language support. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of ??? Sent: Sunday, July 01, 2007 5:54 PM To: 'Discussion of IronPython' Subject: Re: [IronPython] IronPython v2.0 Alpha 2 Released! Hi, Dino: Thanks for your hard work! I noticed that the demos showed on MIX'07 about multiple script language share data and functions, can you give us a example to do that using new release. Thanks. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Tony Djordjevski Sent: Saturday, June 30, 2007 05:52 To: Discussion of IronPython Subject: Re: [IronPython] IronPython v2.0 Alpha 2 Released! Hi Dino, Congrats on the new release! Can you give us an update on the status of the multiple engine debate and does this release change anything on that front? When Alpha 1 was released, we discussed swappable SystemStates as an alternative to multiple engine instances. Does this release include this functionality? Thanks, Tony Dino Viehland wrote: > Hello IronPython Community, > > We have just released IronPython 2.0 Alpha 2. This release is a snapshot of the on-going progress with IronPython 2.0 and the DLR. > One of the most significant changes in this release is the removal of Microsoft.Scripting.Vestigial. Previously this DLL was a combination of both IronPython support code as well as portions of the DLR. With Alpha 2 Microsoft.Scripting.dll contains all portions of the DLR and IronPython.dll contains the IronPython implementation which builds upon the DLR. This should help consumers of the DLR to better understand the public surface area. Being early in the product cycle this surface area may still change significantly but there are now bright lines between what DLR code is and what IronPython code is. > > IronPython also continues to use the underlying concepts of the DLR more and more. In the Alpha 1 release there were numerous locations where IronPython would use DynamicSites but fallback to runtime lookups because the site couldn't perform optimally. In this release we've continued to flush out these corner cases and improve IronPython's support for generating proper rules when using DynamicSites. We've also improved the shared infrastructure the DLR provides for creating rules and moved IronPython to this shared infrastructure. > > Significant changes in the DLR include the removal of Microsoft.Scripting. Vestigial, continued refinement of the AST and dynamic site support, and replacement of the old IDynamicObject with the new IDynamicObject. IronPython has also been updated to use more of the DLR concepts. > The DLR also continues to be expanded and improved. The DLR AST has been improved with support for more static constructs such as simple exception handling constructors and better variable support. The DLR AST factory methods have also been moved to a static Ast class to enable easier construction of ASTs. There have also been some additional convenience methods added to various nodes to make construction even easier still. Finally the DLR also has been improved to support an arbitrary number of arguments inside a DynamicSite which helps to enable calling all functions in an optimized manner. > > One of the most significant (although fairly small) improvements is the introduction of the IDynamicObject interface under its proper name. In the Alpha 1 release this interface was temporarily named IActionable because IronPython had previously shipped with an IDynamicObject interface. In this new release the old interface has been completely removed and the DLR now provides the correct IDynamicObject interface. This interface lives at the heart of the DLR so it's noteworthy that it's now found its final home. > > Note: Due to dependencies upon APIs that are not present in Silverlight 1. 1 Alpha (released at MIX) you won't be able to re-build this release for use with Silverlight. As both products stabilize more we expect better compatibility between releases. > > You can download IronPython v2.0 at: > http://www.codeplex.com/IronPython/Release/ProjectReleases.aspx?Releas > eId=5246 > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.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 hfoffani at gmail.com Wed Jul 4 18:14:03 2007 From: hfoffani at gmail.com (Hernan M Foffani) Date: Wed, 4 Jul 2007 18:14:03 +0200 Subject: [IronPython] DB-API for OleDb Message-ID: <11fab4bc0707040914y2790580ej882fb14c800dd08a@mail.gmail.com> Has someone written a DB-API compliant module for OleDb? Or for SQL*? I think that it should be a pretty straightforward task but don't want to reinvent the wheel. Thanks and regards, -Hern?n. From hfoffani at gmail.com Wed Jul 4 18:27:11 2007 From: hfoffani at gmail.com (Hernan M Foffani) Date: Wed, 4 Jul 2007 18:27:11 +0200 Subject: [IronPython] DB-API for OleDb In-Reply-To: <11fab4bc0707040914y2790580ej882fb14c800dd08a@mail.gmail.com> References: <11fab4bc0707040914y2790580ej882fb14c800dd08a@mail.gmail.com> Message-ID: <11fab4bc0707040927o63035277y65982381d1ebf586@mail.gmail.com> On 7/4/07, Hernan M Foffani wrote: > Has someone written a DB-API compliant module > for OleDb? Or for SQL*? > I think that it should be a pretty straightforward > task but don't want to reinvent the wheel. Wooops... Seems that one is included in FePy. Mailing list search is my friend. I've should know that, sorry. And thanks, Seo. ;-) -H. From giles.thomas at resolversystems.com Wed Jul 4 21:27:34 2007 From: giles.thomas at resolversystems.com (Giles Thomas) Date: Wed, 04 Jul 2007 20:27:34 +0100 Subject: [IronPython] op_Implicit - workarounds to avoid C# code? Message-ID: <468BF4A6.8070507@resolversystems.com> Hi all, I am working with a C# library that has two classes with no inheritance relationship, Class1 and Class2, where Class2 has an op_Implicit that allows you to construct an instance of it from an instance of Class1. In the same library there is a method Class3.TheMethod, which takes an instance of Class2. There is C# code for this below. I have an instance of Class1, c1, and I want to be able to call it in IronPython with an instance of Class2 that has been created using the op_Implicit; C# code that does this is also below. So far I've had no luck; I understand that op_Implicit isn't very well supported in IP currently, but any workarounds that avoid having to drop into C# would be much appreciated. I've tried getting it to work two ways - again, IP code is below: * Doing it directly with C3.TheMethod(c1) just says "expected Class2, got Class1", as you would expect. * Trying the trick that Dino Viehland suggested on 22 June, which involves putting the instance into a generic list parameterised to hold instances of Class2 just moves the problem to the call to list.Add. Am I missing something? If not, can anyone think of any other workarounds? Or am I just going to have to grit my teeth and drop into C#? Regards, Giles -- Giles Thomas giles.thomas at resolversystems.com +44 (0) 20 7253 6372 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 C# library code: ============================================= namespace OpImplicitTest { public class Class1 { public int value; public Class1(int value) { this.value = value; } } public class Class2 { public int otherValue; private Class2(int value) { this.otherValue = value; } public static implicit operator Class2(Class1 c) { return new Class2(c.value); } } public class Class3 { public void TheMethod(Class2 c2) { Console.Out.WriteLine(c2.otherValue); } } } C# library code: ============================================= Class1 c1 = new Class1(23); Class3 c3 = new Class3(); c3.TheMethod(c1); IP code ============================================= import clr clr.AddReference('OpImplicitTest') from OpImplicitTest import Class1, Class2, Class3 c3 = Class3() c1 = Class1(23) # Try calling it directly as per the C# - this blows up c3.TheMethod(c1) # Try Dino's workaround... from System.Collections.Generic import List l = List[Class2]() # ...and this blows up. l.Add(c1) -------------- next part -------------- An HTML attachment was scrubbed... URL: From giles.thomas at resolversystems.com Thu Jul 5 17:42:34 2007 From: giles.thomas at resolversystems.com (Giles Thomas) Date: Thu, 05 Jul 2007 16:42:34 +0100 Subject: [IronPython] Future handling of op_Implicit Message-ID: <468D116A.20701@resolversystems.com> Hi, I guess we're going to have to use C# to work around the lack of op_Implicit support in the short term, but I'm interested in knowing about the IP team's plans for handling conversion operators going forward. Here's our situation; we have a highly-scriptable application, and our clients want to be able to call their own .NET libraries from their scripts. However, their libraries make heavy use of the implicit casts, so that they can (for example) have a method that takes an instance of C1, but pass it a C2 and rely on C1's op_Implicit(C2) to handle the conversion. This works fine for them when using other .NET languages, but of course doesn't work in IronPython. I must admit that I don't really know what IP could do with this kind of code; if I understand correctly, op_Implicit(x) in (say) C# is dispatched based on the type of the variable x rather then the type of the object to which it is a reference, and of course variable type in that sense is not a meaningful concept in a dynamic language. What should IronPython do? Is this a case where people are going to have to write more code if they want to use a dynamic language? Regards, Giles -- Giles Thomas giles.thomas at resolversystems.com +44 (0) 20 7253 6372 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 bourduam at msu.edu Thu Jul 5 21:49:57 2007 From: bourduam at msu.edu (Matthew S Bourdua) Date: Thu, 05 Jul 2007 15:49:57 -0400 Subject: [IronPython] import subprocess Message-ID: Hello, I have a question about the "subprocess" module. I am unable to "import subprocess" in my scripts. Will IronPython will support this in the future, or, perhaps is it intentionally not supported? (Or perhaps I am doing something stupid, and it should work?) I recently began using IronPython because I had both Python scripts and .Net classes that I needed to use together. So far I have been pretty pleased with how well everything is working. My biggest problem has been that the os.system() call does not work in IronPython. I notice that this was raised as an issue in Sep '06 (http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=2982). While hunting around for an alternative, I found the following text in the library reference (http://docs.python.org/lib/module-subprocess.html): "The subprocess module ... intends to replace several other, older modules and functions, such as: os.system os.spawn* os.popen* popen2.* commands.*" For this reason, I thought that perhaps "os.system" was going to become deprecated in favor of "subprocess", and that might explain why this issue has not been addressed. However, I am unable to "import subprocess" in IronPython. When I do so, an exception is raised because, "No module named fcntl". Digging into this a bit, I notice the following variable defined within subprocess.py (this is from ActivePython 2.5): mswindows = (sys.platform == "win32") And then many conditional statements of the form: if mswindows: ...#Windows specific code else ...#Non-windows code, presumably IronPython fails this check because sys.platform = 'cli', and thus is lead into using modules that are (I would guess) meant for Unix-based systems. Further, this behavior seems to be known - I noticed that this seemed to be accounted for in (what appears to be) the automatic test-suite code located here: http://www.codeplex.com/IronPython/SourceControl/FileView.aspx?itemId=296023 &changeSetId=21805 What's strange to me is that I couldn't find a single reference to using subprocess in IronPython anywhere. So perhaps this issue is widely understood by everybody but me (I'm relatively new to Python), or simply not an issue for anybody but me? Anyway, I was hoping somebody on this mailing list might have some insight to share. Thanks, Matt From Eric.Wyler at bentley.com Thu Jul 5 22:09:12 2007 From: Eric.Wyler at bentley.com (Eric.Wyler at bentley.com) Date: Thu, 5 Jul 2007 16:09:12 -0400 Subject: [IronPython] import subprocess In-Reply-To: References: Message-ID: Matt, I had the same problem and ended up solving it by using System.Diagnostics.Process instead of subprocess. As far as I know, subprocess doesn't work under IronPython. I don't remember all of the reasons as to why it doesn't work, but, for example, os.pipe doesn't exist under IronPython like in CPython. Unfortunately, it's a bit of extra work if you're using subprocess to capture stdout, stdin, etc. Here's a snippet of some code I used for this. It's not very straightforward, unfortunately, because I wanted to combine the stdout/stderr streams. Also, the only way to run a command like you would type it on the command line is to run it through cmd.exe. You can search around for it, getting return values can be a real pain as well. I didn't test this code, just tried to copy and paste the important parts from what I have, so I may have forgotten something. class Process : def __init__( self ): self.stdoutstderr = System.IO.StringWriter() self.cmdLine = "rd /s /q ." def Run( self ): processStartInfo = System.Diagnostics.ProcessStartInfo( "cmd", "/c " + self.cmdLine ) processStartInfo.UseShellExecute = False processStartInfo.RedirectStandardInput = True processStartInfo.RedirectStandardOutput = True processStartInfo.RedirectStandardError = True processStartInfo.CreateNoWindow = True processStartInfo.EnvironmentVariables.Clear() for envVariable in os.environ.keys() : processStartInfo.EnvironmentVariables.Add( envVariable, os.environ[ envVariable ] ) processToRun = System.Diagnostics.Process() processToRun.StartInfo = processStartInfo processToRun.OutputDataReceived += self.__WriteStdoutData processToRun.ErrorDataReceived += self.__WriteStderrData processToRun.Start() processToRun.BeginOutputReadLine() processToRun.BeginErrorReadLine() processToRun.WaitForExit() stdoutstderrReader = System.IO.StringReader( self.stdoutstderr.ToString() ) return ( processToRun.StandardInput, stdoutstderrReader ) def __WriteStdoutData ( self, sendingProcess, stdoutData ) : if stdoutData.Data != None: self.stdoutstderr.Write( stdoutData.Data + '\n' ) def __WriteStderrData ( self, sendingProcess, stderrData ) : if stderrData.Data != None: self.stdoutstderr.Write( stderrData.Data + '\n' ) Hopefully that helps. Eric -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Matthew S Bourdua Sent: Thursday, July 05, 2007 3:50 PM To: users at lists.ironpython.com Subject: [IronPython] import subprocess Hello, I have a question about the "subprocess" module. I am unable to "import subprocess" in my scripts. Will IronPython will support this in the future, or, perhaps is it intentionally not supported? (Or perhaps I am doing something stupid, and it should work?) I recently began using IronPython because I had both Python scripts and .Net classes that I needed to use together. So far I have been pretty pleased with how well everything is working. My biggest problem has been that the os.system() call does not work in IronPython. I notice that this was raised as an issue in Sep '06 (http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=2982). While hunting around for an alternative, I found the following text in the library reference (http://docs.python.org/lib/module-subprocess.html): "The subprocess module ... intends to replace several other, older modules and functions, such as: os.system os.spawn* os.popen* popen2.* commands.*" For this reason, I thought that perhaps "os.system" was going to become deprecated in favor of "subprocess", and that might explain why this issue has not been addressed. However, I am unable to "import subprocess" in IronPython. When I do so, an exception is raised because, "No module named fcntl". Digging into this a bit, I notice the following variable defined within subprocess.py (this is from ActivePython 2.5): mswindows = (sys.platform == "win32") And then many conditional statements of the form: if mswindows: ...#Windows specific code else ...#Non-windows code, presumably IronPython fails this check because sys.platform = 'cli', and thus is lead into using modules that are (I would guess) meant for Unix-based systems. Further, this behavior seems to be known - I noticed that this seemed to be accounted for in (what appears to be) the automatic test-suite code located here: http://www.codeplex.com/IronPython/SourceControl/FileView.aspx?itemId=29 6023 &changeSetId=21805 What's strange to me is that I couldn't find a single reference to using subprocess in IronPython anywhere. So perhaps this issue is widely understood by everybody but me (I'm relatively new to Python), or simply not an issue for anybody but me? Anyway, I was hoping somebody on this mailing list might have some insight to share. Thanks, Matt _______________________________________________ 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 gameweld at gmail.com Fri Jul 6 21:43:26 2007 From: gameweld at gmail.com (Chris Parnin) Date: Fri, 6 Jul 2007 15:43:26 -0400 Subject: [IronPython] Hosting IronPython 2.X in .NET app Message-ID: <5f040ba90707061243h5f68955fn37facf86b0355bdb@mail.gmail.com> I've seen several examples of how to embed IronPython 1.X in .NET. (e.g. IronTextBox) However, the architecture has changed greatly with 2.X. Does anyone have a good example or pointers on hosting an interactive IronPython session in a .NET app? Thanks, Chris Parnin From dinov at exchange.microsoft.com Sat Jul 7 01:55:09 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Fri, 6 Jul 2007 16:55:09 -0700 Subject: [IronPython] Future handling of op_Implicit In-Reply-To: <468D116A.20701@resolversystems.com> References: <468D116A.20701@resolversystems.com> Message-ID: <7AD436E4270DD54A94238001769C2227B490A468D5@DF-GRTDANE-MSG.exchange.corp.microsoft.com> I believe we're going to get better at this in the future. For starters there are currently some code paths which are missing the checks for the implicit conversions - for example if you define an implicit conversion to string we won't respect it all (in either v1.x or v2.x right now). This is because we have a fast path which isn't checking for the implicit conversion. Additionally it would be fairly easy for us to expose this out via some other mechanism for when we're not doing the right thing. For example we could either leave the op_Implicit methods on the type which defines them or maybe we could move them onto the type which we want to do the conversion from (e.g. add a "ToFoo" onto Bar when Foo defines an implicit operator for conversion from Foo to Bar). I believe w/ the 1st option we can get into trouble w/ overloads that only differ by return types but the 2nd option may be less problematic. But obviously we've got to do a better job of enabling this basic CLS consumption scenario w/o forcing you to use C#. We've also run into this internally recently as a fundamental DLR concept. That's how we discovered the issues w/ string conversions :). If you haven't already vote on bug #11278 (http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=11278) please do and we'll look at doing this sooner rather than later. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Giles Thomas Sent: Thursday, July 05, 2007 8:43 AM To: Discussion of IronPython Subject: [IronPython] Future handling of op_Implicit Hi, I guess we're going to have to use C# to work around the lack of op_Implicit support in the short term, but I'm interested in knowing about the IP team's plans for handling conversion operators going forward. Here's our situation; we have a highly-scriptable application, and our clients want to be able to call their own .NET libraries from their scripts. However, their libraries make heavy use of the implicit casts, so that they can (for example) have a method that takes an instance of C1, but pass it a C2 and rely on C1's op_Implicit(C2) to handle the conversion. This works fine for them when using other .NET languages, but of course doesn't work in IronPython. I must admit that I don't really know what IP could do with this kind of code; if I understand correctly, op_Implicit(x) in (say) C# is dispatched based on the type of the variable x rather then the type of the object to which it is a reference, and of course variable type in that sense is not a meaningful concept in a dynamic language. What should IronPython do? Is this a case where people are going to have to write more code if they want to use a dynamic language? Regards, Giles -- Giles Thomas giles.thomas at resolversystems.com +44 (0) 20 7253 6372 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 joesox at gmail.com Sat Jul 7 04:29:41 2007 From: joesox at gmail.com (JoeSox) Date: Fri, 6 Jul 2007 19:29:41 -0700 Subject: [IronPython] Hosting IronPython 2.X in .NET app In-Reply-To: <5f040ba90707061243h5f68955fn37facf86b0355bdb@mail.gmail.com> References: <5f040ba90707061243h5f68955fn37facf86b0355bdb@mail.gmail.com> Message-ID: <785694cd0707061929k69cb9a77nb1fbf02f7b400424@mail.gmail.com> On 7/6/07, Chris Parnin wrote: > I've seen several examples of how to embed IronPython 1.X in .NET. > (e.g. IronTextBox) However, the architecture has changed greatly with > 2.X. Does anyone have a good example or pointers on hosting an > interactive IronPython session in a .NET app? One of the reasons why I haven't updated IronTextBox is that IronPython 2 is in Alpha. I decided to wait until it was Beta. On top of that, Python is set for a major version upgrade soon, so I don't know how this will effect IronPython's development. I am wondering if others are thinking the same? -- Later, Joe From dan.eloff at gmail.com Sun Jul 8 08:21:19 2007 From: dan.eloff at gmail.com (Dan Eloff) Date: Sun, 8 Jul 2007 01:21:19 -0500 Subject: [IronPython] How to remove auto correct feature in visual studio? Message-ID: <4817b6fc0707072321i6e913866scddf73836b1d84c6@mail.gmail.com> The auto correct feature in Visual Studio is driving me crazy. It's fixed 0 mistakes and created a million. If I type a variable name or even a python keyword it automatically "fixes" it when i hit space and changes it to the closest matching name in the namespace. For example the keyword "in" becomes the function "input". I had a look around the options and I didn't spot anything that looks like it would fit. Surely there is some way to disable that or prune it back? It's really annoying. Thanks! -Daniel Eloff From stefan.dobrev at gmail.com Sun Jul 8 12:40:52 2007 From: stefan.dobrev at gmail.com (Stefan Dobrev) Date: Sun, 8 Jul 2007 13:40:52 +0300 Subject: [IronPython] How to remove auto correct feature in visual studio? In-Reply-To: <4817b6fc0707072321i6e913866scddf73836b1d84c6@mail.gmail.com> References: <4817b6fc0707072321i6e913866scddf73836b1d84c6@mail.gmail.com> Message-ID: <928de89c0707080340x772579f4tc0c9cf9a2683e5e4@mail.gmail.com> You can go to Tools -> Options -> Text Editor -> IronPython Language and uncheck Auto list members. The if you want to use the IntelliSense you have to use Ctrl+Space to toggle it. Hope this helps, Stefan Dobrev 2007/7/8, Dan Eloff : > > The auto correct feature in Visual Studio is driving me crazy. It's > fixed 0 mistakes and created a million. If I type a variable name or > even a python keyword it automatically "fixes" it when i hit space and > changes it to the closest matching name in the namespace. For example > the keyword "in" becomes the function "input". I had a look around the > options and I didn't spot anything that looks like it would fit. > Surely there is some way to disable that or prune it back? It's really > annoying. > > Thanks! > -Daniel Eloff > _______________________________________________ > 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 Sun Jul 8 21:57:03 2007 From: dan.eloff at gmail.com (Dan Eloff) Date: Sun, 8 Jul 2007 14:57:03 -0500 Subject: [IronPython] How to remove auto correct feature in visual studio? In-Reply-To: <928de89c0707080340x772579f4tc0c9cf9a2683e5e4@mail.gmail.com> References: <4817b6fc0707072321i6e913866scddf73836b1d84c6@mail.gmail.com> <928de89c0707080340x772579f4tc0c9cf9a2683e5e4@mail.gmail.com> Message-ID: <4817b6fc0707081257m3f5666c8q355ad6e291eca9e1@mail.gmail.com> On 7/8/07, Stefan Dobrev wrote: > > You can go to Tools -> Options -> Text Editor -> IronPython Language and > uncheck Auto list members. The if you want to use the IntelliSense you have > to use Ctrl+Space to toggle it. > Thanks, you saved me much aggravation :) -Dan From dan.eloff at gmail.com Sun Jul 8 22:04:25 2007 From: dan.eloff at gmail.com (Dan Eloff) Date: Sun, 8 Jul 2007 15:04:25 -0500 Subject: [IronPython] PictureBox causes trouble in Orcas Message-ID: <4817b6fc0707081304q6b358235kca2c5802ad1fc43d@mail.gmail.com> Has anybody else noticed that if you drag a PictureBox onto a from in the form designer (in Orcas) and try to change any of the Image, ErrorImage, or InitialImage properties it causes and error "value cannot be null Parameter Name: docData." I'm thinking that's a problem with the integration sample and not with IronPython. Just wondering if it's only happening to me. Thanks, -Dan From dan.eloff at gmail.com Mon Jul 9 19:32:43 2007 From: dan.eloff at gmail.com (Dan Eloff) Date: Mon, 9 Jul 2007 12:32:43 -0500 Subject: [IronPython] Can't import System? Message-ID: <4817b6fc0707091032x6d0a7e87y2f6f95434d3b8165@mail.gmail.com> I created a winforms project in IronPython, compiled it and it worked great. Then I made some changes and now it says it can't import any of the .NET assemblies. FileNotFoundError: "Could not load file or assembly 'System.Data' or one of its dependencies. The system cannot find the file specified." It happens for System, System.Data, System.Drawing, System.Windows.Forms, and System.XML. Does anybody have any ideas why this might be happening? Thanks, -Dan From dinov at exchange.microsoft.com Tue Jul 10 00:34:54 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 9 Jul 2007 15:34:54 -0700 Subject: [IronPython] Can't import System? In-Reply-To: <4817b6fc0707091032x6d0a7e87y2f6f95434d3b8165@mail.gmail.com> References: <4817b6fc0707091032x6d0a7e87y2f6f95434d3b8165@mail.gmail.com> Message-ID: <7AD436E4270DD54A94238001769C2227B490A46AEB@DF-GRTDANE-MSG.exchange.corp.microsoft.com> I haven't heard of this one before... Are you calling clr.AddReference or one of the other clr.AddReference* methods? There's some clr methods which correspond to CLR methods which won't load partial assembly names. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff Sent: Monday, July 09, 2007 10:33 AM To: IronPython Mailing List Subject: [IronPython] Can't import System? I created a winforms project in IronPython, compiled it and it worked great. Then I made some changes and now it says it can't import any of the .NET assemblies. FileNotFoundError: "Could not load file or assembly 'System.Data' or one of its dependencies. The system cannot find the file specified." It happens for System, System.Data, System.Drawing, System.Windows.Forms, and System.XML. Does anybody have any ideas why this might be happening? 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 Tue Jul 10 02:27:35 2007 From: dan.eloff at gmail.com (Dan Eloff) Date: Mon, 9 Jul 2007 19:27:35 -0500 Subject: [IronPython] Can't import System? In-Reply-To: <7AD436E4270DD54A94238001769C2227B490A46AEB@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <4817b6fc0707091032x6d0a7e87y2f6f95434d3b8165@mail.gmail.com> <7AD436E4270DD54A94238001769C2227B490A46AEB@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <4817b6fc0707091727q4e88e51dldecf7fb5cea6e17f@mail.gmail.com> On 7/9/07, Dino Viehland wrote: > I haven't heard of this one before... Are you calling clr.AddReference or one of the other clr.AddReference* methods? There's some clr methods which correspond to CLR methods which won't load partial assembly names. Actually I checked and I wasn't calling clr.AddReference at all. The form designer must've clobbered it. I've got to keep an eye on that thing. Adding the clr.AddReference for the appropriate assemblies solved the problem. Thanks! -Dan > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff > Sent: Monday, July 09, 2007 10:33 AM > To: IronPython Mailing List > Subject: [IronPython] Can't import System? > > I created a winforms project in IronPython, compiled it and it worked > great. Then I made some changes and now it says it can't import any of > the .NET assemblies. FileNotFoundError: "Could not load file or > assembly 'System.Data' or one of its dependencies. The system cannot > find the file specified." > > It happens for System, System.Data, System.Drawing, > System.Windows.Forms, and System.XML. > > Does anybody have any ideas why this might be happening? > > 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 xmlhacker at gmail.com Tue Jul 10 21:17:10 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Tue, 10 Jul 2007 13:17:10 -0600 Subject: [IronPython] Hosting IronPython 2.X in .NET app In-Reply-To: <785694cd0707061929k69cb9a77nb1fbf02f7b400424@mail.gmail.com> References: <5f040ba90707061243h5f68955fn37facf86b0355bdb@mail.gmail.com> <785694cd0707061929k69cb9a77nb1fbf02f7b400424@mail.gmail.com> Message-ID: On 7/6/07, JoeSox wrote: > > > One of the reasons why I haven't updated IronTextBox is that > IronPython 2 is in Alpha. I decided to wait until it was Beta. On > top of that, Python is set for a major version upgrade soon, so I > don't know how this will effect IronPython's development. I am > wondering if others are thinking the same? I don't remember if it was a post to this list, or a blog entry, or a white paper overview, or etc., but if not mistaken there is a considerable amount of focus being placed on making IP 2.0 Python 2.5 compliant as well as at least some effort at adding some of the Python 3000 features. Can someone at MSFT verify? -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Tue Jul 10 21:31:10 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 10 Jul 2007 12:31:10 -0700 Subject: [IronPython] Hosting IronPython 2.X in .NET app In-Reply-To: References: <5f040ba90707061243h5f68955fn37facf86b0355bdb@mail.gmail.com> <785694cd0707061929k69cb9a77nb1fbf02f7b400424@mail.gmail.com> Message-ID: <7AD436E4270DD54A94238001769C2227B490A46C5F@DF-GRTDANE-MSG.exchange.corp.microsoft.com> That?s our goal but unfortunately there isn?t really much new in there yet (from 1.1 w/ -X:Python25). We have changed the default to having the v2.5 features enabled now and no longer have a mode which runs as 2.4. Major things we know we still have to do include yield expressions (sorry, there?s probably a technical term for them) and switching to new-style classes for exceptions. There?s also a lot of random new functions added we don?t yet have. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of M. David Peterson Sent: Tuesday, July 10, 2007 12:17 PM To: Discussion of IronPython Subject: Re: [IronPython] Hosting IronPython 2.X in .NET app On 7/6/07, JoeSox > wrote: One of the reasons why I haven't updated IronTextBox is that IronPython 2 is in Alpha. I decided to wait until it was Beta. On top of that, Python is set for a major version upgrade soon, so I don't know how this will effect IronPython's development. I am wondering if others are thinking the same? I don't remember if it was a post to this list, or a blog entry, or a white paper overview, or etc., but if not mistaken there is a considerable amount of focus being placed on making IP 2.0 Python 2.5 compliant as well as at least some effort at adding some of the Python 3000 features. Can someone at MSFT verify? -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From curt at hagenlocher.org Tue Jul 10 21:33:46 2007 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Tue, 10 Jul 2007 12:33:46 -0700 Subject: [IronPython] Hosting IronPython 2.X in .NET app In-Reply-To: <7AD436E4270DD54A94238001769C2227B490A46C5F@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <5f040ba90707061243h5f68955fn37facf86b0355bdb@mail.gmail.com> <785694cd0707061929k69cb9a77nb1fbf02f7b400424@mail.gmail.com> <7AD436E4270DD54A94238001769C2227B490A46C5F@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: On 7/10/07, Dino Viehland wrote: > > Major things we know we still have to do include yield expressions > (sorry, there's probably a technical term for them) > Closures :P. -- Curt Hagenlocher curt at hagenlocher.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From xmlhacker at gmail.com Tue Jul 10 21:42:53 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Tue, 10 Jul 2007 13:42:53 -0600 Subject: [IronPython] Hosting IronPython 2.X in .NET app In-Reply-To: References: <5f040ba90707061243h5f68955fn37facf86b0355bdb@mail.gmail.com> <785694cd0707061929k69cb9a77nb1fbf02f7b400424@mail.gmail.com> <7AD436E4270DD54A94238001769C2227B490A46C5F@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: On 7/10/07, Curt Hagenlocher wrote: > > On 7/10/07, Dino Viehland wrote: > > > > Major things we know we still have to do include yield expressions > > (sorry, there's probably a technical term for them) > > > Closures :P. > Are closures planned for Python 3000? -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From curt at hagenlocher.org Tue Jul 10 21:47:05 2007 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Tue, 10 Jul 2007 12:47:05 -0700 Subject: [IronPython] Hosting IronPython 2.X in .NET app In-Reply-To: References: <5f040ba90707061243h5f68955fn37facf86b0355bdb@mail.gmail.com> <785694cd0707061929k69cb9a77nb1fbf02f7b400424@mail.gmail.com> <7AD436E4270DD54A94238001769C2227B490A46C5F@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: On 7/10/07, Curt Hagenlocher wrote: > > On 7/10/07, Dino Viehland wrote: > > > > Major things we know we still have to do include yield expressions > > (sorry, there's probably a technical term for them) > > > Closures :P. > Doh! I'm so retarded that I misspelled "generators" :(. Apparently I've been reading too much about Ruby lately... -- Curt Hagenlocher curt at hagenlocher.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From xmlhacker at gmail.com Tue Jul 10 21:47:07 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Tue, 10 Jul 2007 13:47:07 -0600 Subject: [IronPython] Hosting IronPython 2.X in .NET app In-Reply-To: References: <5f040ba90707061243h5f68955fn37facf86b0355bdb@mail.gmail.com> <785694cd0707061929k69cb9a77nb1fbf02f7b400424@mail.gmail.com> <7AD436E4270DD54A94238001769C2227B490A46C5F@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: On 7/10/07, M. David Peterson wrote: > > On 7/10/07, Curt Hagenlocher wrote: > > > > On 7/10/07, Dino Viehland < dinov at exchange.microsoft.com> wrote: > > > > > > Major things we know we still have to do include yield expressions > > > (sorry, there's probably a technical term for them) > > > > > Closures :P. > > > > > Are closures planned for Python 3000? > via a link from Sylvain > http://www.artima.com/weblogs/viewpost.jsp?thread=208549 < I don't see any mention of closures for Python 3000. -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From xmlhacker at gmail.com Tue Jul 10 21:47:43 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Tue, 10 Jul 2007 13:47:43 -0600 Subject: [IronPython] Hosting IronPython 2.X in .NET app In-Reply-To: <7AD436E4270DD54A94238001769C2227B490A46C5F@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <5f040ba90707061243h5f68955fn37facf86b0355bdb@mail.gmail.com> <785694cd0707061929k69cb9a77nb1fbf02f7b400424@mail.gmail.com> <7AD436E4270DD54A94238001769C2227B490A46C5F@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: Thanks for this, Dino! On 7/10/07, Dino Viehland wrote: > > That's our goal but unfortunately there isn't really much new in there > yet (from 1.1 w/ -X:Python25). We have changed the default to having the > v2.5 features enabled now and no longer have a mode which runs as 2.4. > > > > Major things we know we still have to do include yield expressions (sorry, > there's probably a technical term for them) and switching to new-style > classes for exceptions. There's also a lot of random new functions added we > don't yet have. > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython .com] > *On Behalf Of *M. David Peterson > *Sent:* Tuesday, July 10, 2007 12:17 PM > *To:* Discussion of IronPython > *Subject:* Re: [IronPython] Hosting IronPython 2.X in .NET app > > > > On 7/6/07, *JoeSox* wrote: > > > One of the reasons why I haven't updated IronTextBox is that > IronPython 2 is in Alpha. I decided to wait until it was Beta. On > top of that, Python is set for a major version upgrade soon, so I > don't know how this will effect IronPython's development. I am > wondering if others are thinking the same? > > > > I don't remember if it was a post to this list, or a blog entry, or a > white paper overview, or etc., but if not mistaken there is a considerable > amount of focus being placed on making IP 2.0 Python 2.5 compliant as well > as at least some effort at adding some of the Python 3000 features. > > > > Can someone at MSFT verify? > > > -- > /M:D > > M. David Peterson > http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 > > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com > /listinfo.cgi/users-ironpython.com > > -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From xmlhacker at gmail.com Tue Jul 10 21:51:18 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Tue, 10 Jul 2007 13:51:18 -0600 Subject: [IronPython] Hosting IronPython 2.X in .NET app In-Reply-To: References: <5f040ba90707061243h5f68955fn37facf86b0355bdb@mail.gmail.com> <785694cd0707061929k69cb9a77nb1fbf02f7b400424@mail.gmail.com> <7AD436E4270DD54A94238001769C2227B490A46C5F@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: On 7/10/07, Curt Hagenlocher wrote: > > > > Doh! I'm so retarded that I misspelled "generators" :(. > Hey, I'm all for getting support for both! :D > Apparently I've been reading too much about Ruby lately... > Haven't we all, Curt. Haven't we all.. ;-) -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From sh at defuze.org Tue Jul 10 21:53:32 2007 From: sh at defuze.org (Sylvain Hellegouarch) Date: Tue, 10 Jul 2007 20:53:32 +0100 Subject: [IronPython] Hosting IronPython 2.X in .NET app In-Reply-To: References: <5f040ba90707061243h5f68955fn37facf86b0355bdb@mail.gmail.com> <785694cd0707061929k69cb9a77nb1fbf02f7b400424@mail.gmail.com> <7AD436E4270DD54A94238001769C2227B490A46C5F@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <4693E3BC.9000804@defuze.org> Curt Hagenlocher a ?crit : > On 7/10/07, *Curt Hagenlocher* > wrote: > > On 7/10/07, *Dino Viehland* < dinov at exchange.microsoft.com > > wrote: > > Major things we know we still have to do include yield > expressions (sorry, there's probably a technical term for them) > > Closures :P. > > > Doh! I'm so retarded that I misspelled "generators" :(. > > Apparently I've been reading too much about Ruby lately... Not to worry :) However the question stands, will Python support closures (or does it already via lambda expressions?) (/me is lame at language theory) - Sylvain From t-jlee at microsoft.com Tue Jul 10 21:59:24 2007 From: t-jlee at microsoft.com (Jacob Lee) Date: Tue, 10 Jul 2007 12:59:24 -0700 Subject: [IronPython] Hosting IronPython 2.X in .NET app In-Reply-To: <4693E3BC.9000804@defuze.org> References: <5f040ba90707061243h5f68955fn37facf86b0355bdb@mail.gmail.com> <785694cd0707061929k69cb9a77nb1fbf02f7b400424@mail.gmail.com> <7AD436E4270DD54A94238001769C2227B490A46C5F@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <4693E3BC.9000804@defuze.org> Message-ID: <8941DB94DBBD2B4D8B1B5047577FF98E2DB922D6A8@NA-EXMSG-C110.redmond.corp.microsoft.com> > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Sylvain Hellegouarch > Sent: Tuesday, July 10, 2007 12:54 PM > To: Discussion of IronPython > Subject: Re: [IronPython] Hosting IronPython 2.X in .NET app > > Curt Hagenlocher a ?crit : > > On 7/10/07, *Curt Hagenlocher* > > wrote: > > > > On 7/10/07, *Dino Viehland* < dinov at exchange.microsoft.com > > > wrote: > > > > Major things we know we still have to do include yield > > expressions (sorry, there's probably a technical term for > them) > > > > Closures :P. > > > > > > Doh! I'm so retarded that I misspelled "generators" :(. > > > > Apparently I've been reading too much about Ruby lately... > > > Not to worry :) > However the question stands, will Python support closures (or does it > already via lambda expressions?) > > (/me is lame at language theory) > > - Sylvain Closures have existed in Python since version 2.1 or so: def f(): x = 5 return lambda: x closure = f() print closure() # prints 5 Here, the anonymous inner function returned by f is able to refer to variables defined in outer scopes. As for the Python 3000 question -- The one current limitation is that you cannot rebind names defined in outer scopes. That is, the following code does not work as expected: def f(): x = 5 def g(): x = 7 # x is local to g here You could use the "global" statement to indicate that x is a global despite it being assigned to inside the function, but there was no equivalent way to indicate that x refers to a variable in an outer, but non-global, scope. Python 3000 will introduce the "nonlocal" statement that works like the global statement to fill this gap. As usual, the best source is the relevant PEP: http://www.python.org/dev/peps/pep-3104/ Hope this helps. -- Jacob Lee SDE Intern, Dynamic Language Runtime From sh at defuze.org Tue Jul 10 22:02:54 2007 From: sh at defuze.org (Sylvain Hellegouarch) Date: Tue, 10 Jul 2007 21:02:54 +0100 Subject: [IronPython] Hosting IronPython 2.X in .NET app In-Reply-To: <8941DB94DBBD2B4D8B1B5047577FF98E2DB922D6A8@NA-EXMSG-C110.redmond.corp.microsoft.com> References: <5f040ba90707061243h5f68955fn37facf86b0355bdb@mail.gmail.com> <785694cd0707061929k69cb9a77nb1fbf02f7b400424@mail.gmail.com> <7AD436E4270DD54A94238001769C2227B490A46C5F@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <4693E3BC.9000804@defuze.org> <8941DB94DBBD2B4D8B1B5047577FF98E2DB922D6A8@NA-EXMSG-C110.redmond.corp.microsoft.com> Message-ID: <4693E5EE.2030906@defuze.org> Jacob Lee a ?crit : >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users- >> bounces at lists.ironpython.com] On Behalf Of Sylvain Hellegouarch >> Sent: Tuesday, July 10, 2007 12:54 PM >> To: Discussion of IronPython >> Subject: Re: [IronPython] Hosting IronPython 2.X in .NET app >> >> Curt Hagenlocher a ?crit : >> >>> On 7/10/07, *Curt Hagenlocher* >> > wrote: >>> >>> On 7/10/07, *Dino Viehland* < dinov at exchange.microsoft.com >>> > wrote: >>> >>> Major things we know we still have to do include yield >>> expressions (sorry, there's probably a technical term for >>> >> them) >> >>> Closures :P. >>> >>> >>> Doh! I'm so retarded that I misspelled "generators" :(. >>> >>> Apparently I've been reading too much about Ruby lately... >>> >> Not to worry :) >> However the question stands, will Python support closures (or does it >> already via lambda expressions?) >> >> (/me is lame at language theory) >> >> - Sylvain >> > > Closures have existed in Python since version 2.1 or so: > def f(): > x = 5 > return lambda: x > closure = f() > print closure() # prints 5 > > Here, the anonymous inner function returned by f is able to refer to variables defined in outer scopes. > > As for the Python 3000 question -- > The one current limitation is that you cannot rebind names defined in outer scopes. That is, the following code does not work as expected: > > def f(): > x = 5 > def g(): > x = 7 # x is local to g here > > You could use the "global" statement to indicate that x is a global despite it being assigned to inside the function, but there was no equivalent way to indicate that x refers to a variable in an outer, but non-global, scope. Python 3000 will introduce the "nonlocal" statement that works like the global statement to fill this gap. As usual, the best source is the relevant PEP: http://www.python.org/dev/peps/pep-3104/ > > Hope this helps. > Many thanks Jacob. I will admit that I don't often use lambdas in my own code and therefore when asked a straight question aboud them I dodged :) That's what I thought of course Thanks again. - Sylvain From xmlhacker at gmail.com Tue Jul 10 22:06:01 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Tue, 10 Jul 2007 14:06:01 -0600 Subject: [IronPython] Hosting IronPython 2.X in .NET app In-Reply-To: <4693E3BC.9000804@defuze.org> References: <5f040ba90707061243h5f68955fn37facf86b0355bdb@mail.gmail.com> <785694cd0707061929k69cb9a77nb1fbf02f7b400424@mail.gmail.com> <7AD436E4270DD54A94238001769C2227B490A46C5F@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <4693E3BC.9000804@defuze.org> Message-ID: On 7/10/07, Sylvain Hellegouarch wrote: > > > Not to worry :) > However the question stands, will Python support closures (or does it > already via lambda expressions?) Depends on your interpretation of what a closure is. One interpretation is that with closures you can, for example, have a series of lambda expressions, evaluate up to a certain point, add a marker, store it, and then continue where you left off at a later date. As per our conversation in IM, this would certainly be one way to move towards a stackless and thread-free Python diet. ;-) Also, since we're on the subject, one *true test* of Python language interoperability would be to get Kamaelia ( http://kamaelia.org ) to work properly via IronPython. Kamaelia list (Cc'd): Has anyone attempted to get Kamaelia working with IronPython? If I am understanding things correctly, until support for generators are implemented then this would not be possible. Is this understanding correct? To the IronPython team: Having the ability to run Kamaelia (a brainchild of Michael Sparks of BBC Research) via IronPython would be an absolute dream come true. *AMAZING* potential existing bridging together Kamaelia and .NET, in my own opinion. -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From xmlhacker at gmail.com Tue Jul 10 22:15:07 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Tue, 10 Jul 2007 14:15:07 -0600 Subject: [IronPython] Hosting IronPython 2.X in .NET app In-Reply-To: <8941DB94DBBD2B4D8B1B5047577FF98E2DB922D6A8@NA-EXMSG-C110.redmond.corp.microsoft.com> References: <5f040ba90707061243h5f68955fn37facf86b0355bdb@mail.gmail.com> <785694cd0707061929k69cb9a77nb1fbf02f7b400424@mail.gmail.com> <7AD436E4270DD54A94238001769C2227B490A46C5F@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <4693E3BC.9000804@defuze.org> <8941DB94DBBD2B4D8B1B5047577FF98E2DB922D6A8@NA-EXMSG-C110.redmond.corp.microsoft.com> Message-ID: On 7/10/07, Jacob Lee wrote: > > > Closures have existed in Python since version 2.1 or so: > def f(): > x = 5 > return lambda: x > closure = f() > print closure() # prints 5 > > Here, the anonymous inner function returned by f is able to refer to > variables defined in outer scopes. Oh, nice! This is did not know. So then are closures available now in IP? As for the Python 3000 question -- > The one current limitation is that you cannot rebind names defined in > outer scopes. To me that's a feature, not a limitation. ;-) That is, the following code does not work as expected: > > def f(): > x = 5 > def g(): > x = 7 # x is local to g here > > You could use the "global" statement to indicate that x is a global > despite it being assigned to inside the function, but there was no > equivalent way to indicate that x refers to a variable in an outer, but > non-global, scope. Python 3000 will introduce the "nonlocal" statement that > works like the global statement to fill this gap. As usual, the best source > is the relevant PEP: http://www.python.org/dev/peps/pep-3104/ > > Hope this helps. It does. Thanks! -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Tue Jul 10 22:25:54 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 10 Jul 2007 13:25:54 -0700 Subject: [IronPython] Hosting IronPython 2.X in .NET app In-Reply-To: References: <5f040ba90707061243h5f68955fn37facf86b0355bdb@mail.gmail.com> <785694cd0707061929k69cb9a77nb1fbf02f7b400424@mail.gmail.com> <7AD436E4270DD54A94238001769C2227B490A46C5F@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <4693E3BC.9000804@defuze.org> Message-ID: <7AD436E4270DD54A94238001769C2227B490A46C72@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Does Kamaelia use the new syntax as supported via PEP-342 (http://www.python.org/dev/peps/pep-0342/). That?s the particular piece that we don?t support and is new to 2.5 ? we do support generators when you use yield as a statement instead of as an expression (in other words, we don?t support the send method on the generator ? only next). It?s hard to tell as 1.5.1 was released shortly after Python 2.5 and I don?t see any statements about which version of Python is required. Looking at all the various things it supports I would be shocked if there wasn?t some use of the C-based extension API (which would prevent, at least some portions, from working). From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of M. David Peterson Sent: Tuesday, July 10, 2007 1:06 PM To: Discussion of IronPython Cc: kamaelia-list at lists.sourceforge.net Subject: Re: [IronPython] Hosting IronPython 2.X in .NET app On 7/10/07, Sylvain Hellegouarch > wrote: Not to worry :) However the question stands, will Python support closures (or does it already via lambda expressions?) Depends on your interpretation of what a closure is. One interpretation is that w ith closures you can, for example, have a series of lambda expressions, evaluate up to a certain point, add a marker, store it, and then continue where you left off at a later date. As per our conversation in IM, this would certainly be one way to move towards a stackless and thread-free Python diet. ;-) Also, since we're on the subject, one *true test* of Python language interoperability would be to get Kamaelia ( http://kamaelia.org ) to work properly via IronPython. Kamaelia list (Cc'd): Has anyone attempted to get Kamaelia working with IronPython? If I am understanding things correctly, until support for generators are implemented then this would not be possible. Is this understanding correct? To the IronPython team: Having the ability to run Kamaelia (a brainchild of Michael Sparks of BBC Research) via IronPython would be an absolute dream come true. *AMAZING* potential existing bridging together Kamaelia and .NET, in my own opinion. -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From sh at defuze.org Tue Jul 10 22:37:15 2007 From: sh at defuze.org (Sylvain Hellegouarch) Date: Tue, 10 Jul 2007 21:37:15 +0100 Subject: [IronPython] Hosting IronPython 2.X in .NET app In-Reply-To: <7AD436E4270DD54A94238001769C2227B490A46C72@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <5f040ba90707061243h5f68955fn37facf86b0355bdb@mail.gmail.com> <785694cd0707061929k69cb9a77nb1fbf02f7b400424@mail.gmail.com> <7AD436E4270DD54A94238001769C2227B490A46C5F@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <4693E3BC.9000804@defuze.org> <7AD436E4270DD54A94238001769C2227B490A46C72@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <4693EDFB.9080001@defuze.org> Dino Viehland a ?crit : > > Does Kamaelia use the new syntax as supported via PEP-342 > (http://www.python.org/dev/peps/pep-0342/). That?s the particular > piece that we don?t support and is new to 2.5 ? we do support > generators when you use yield as a statement instead of as an > expression (in other words, we don?t support the send method on the > generator ? only next). It?s hard to tell as 1.5.1 was released > shortly after Python 2.5 and I don?t see any statements about which > version of Python is required. > > > > Looking at all the various things it supports I would be shocked if > there wasn?t some use of the C-based extension API (which would > prevent, at least some portions, from working). > I can understand your feeling but the core of the library is actually pure Python and very small. It's only all its extra features that do use C libraries. The core of Kamaelia is Python. I'm trying to use it with IP2A2 but I get a huge mono traceback currently (mono from svn compiled IP2) so well... not getting really far at the moment :) - Sylvain From xmlhacker at gmail.com Tue Jul 10 23:12:46 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Tue, 10 Jul 2007 15:12:46 -0600 Subject: [IronPython] [Kamaelia-list] Hosting IronPython 2.X in .NET app In-Reply-To: <7AD436E4270DD54A94238001769C2227B490A46C72@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <5f040ba90707061243h5f68955fn37facf86b0355bdb@mail.gmail.com> <785694cd0707061929k69cb9a77nb1fbf02f7b400424@mail.gmail.com> <7AD436E4270DD54A94238001769C2227B490A46C5F@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <4693E3BC.9000804@defuze.org> <7AD436E4270DD54A94238001769C2227B490A46C72@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: On 7/10/07, Dino Viehland wrote: > > Does Kamaelia use the new syntax as supported via PEP-342 ( > http://www.python.org/dev/peps/pep-0342/). That's the particular piece > that we don't support and is new to 2.5 ? we do support generators when > you use yield as a statement instead of as an expression (in other words, we > don't support the send method on the generator ? only next). It's hard to > tell as 1.5.1 was released shortly after Python 2.5 and I don't see any > statements about which version of Python is required. > I believe that Kamaelia is compliant with Python 2.4 forward. > > Looking at all the various things it supports I would be shocked if there > wasn't some use of the C-based extension API (which would prevent, at least > some portions, from working). > I should have clarified. Axon is the underlying concurrency framework, and if not mistaken, is written in pure Python. I believe Kamaelia (which sits on top of Axon) in and of itself is written in pure Python, but the plugins are heavily built upon the C-based extension API. I'll dig deeper and find out for sure. I'll also attempt to get Axon running via IP and report back the result. Thanks for your help, Dino! -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From xmlhacker at gmail.com Tue Jul 10 23:13:57 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Tue, 10 Jul 2007 15:13:57 -0600 Subject: [IronPython] Hosting IronPython 2.X in .NET app In-Reply-To: <4693EDFB.9080001@defuze.org> References: <5f040ba90707061243h5f68955fn37facf86b0355bdb@mail.gmail.com> <785694cd0707061929k69cb9a77nb1fbf02f7b400424@mail.gmail.com> <7AD436E4270DD54A94238001769C2227B490A46C5F@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <4693E3BC.9000804@defuze.org> <7AD436E4270DD54A94238001769C2227B490A46C72@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <4693EDFB.9080001@defuze.org> Message-ID: On 7/10/07, Sylvain Hellegouarch wrote: > > > I can understand your feeling but the core of the library is actually > pure Python and very small. It's only all its extra features that do use > C libraries. The core of Kamaelia is Python. Didn't see your response before my last response. Thanks for the clarification! I'm trying to use it with IP2A2 but I get a huge mono traceback > currently (mono from svn compiled IP2) so well... not getting really far > at the moment :) I'll try it on Windows and see if the result is any different. -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From xmlhacker at gmail.com Wed Jul 11 00:11:27 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Tue, 10 Jul 2007 16:11:27 -0600 Subject: [IronPython] [Kamaelia-list] Hosting IronPython 2.X in .NET app In-Reply-To: <200707102237.50026.ms@cerenity.org> References: <5f040ba90707061243h5f68955fn37facf86b0355bdb@mail.gmail.com> <7AD436E4270DD54A94238001769C2227B490A46C72@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <200707102237.50026.ms@cerenity.org> Message-ID: Hi Michael, I've added all of the necessary module dependencies as well as Axon 1.5.1into the SVN repository @ http://extf.googlecode.com/svn/vendor/IPCE-r6/Lib/ < This includes various standard lib modules such as sets that I pulled from Python 2.3.6. I just checked, and IPY2 Alpha 2 wont run via Mono as is (requires a couple of patches from Seo to build properly), so I will need to quickly compile a fresh set of binaries for you to test with. In the mean time, on Windows, here's what I am currently looking at from within an ipy.exe session (using a checked-out Lib directory from above) IronPython console: IronPython 2.0A2 (2.0.10627.00) on .NET 2.0.50727.1318 > Copyright (c) Microsoft Corporation. All rights reserved. > >>> import sys > >>> sys.path.append('.\Lib') > >>> import Axon > Traceback (most recent call last): > File , line 0, in ##11 > File , line 0, in _stub_##2 > File .\Lib\Axon\__init__.py, line 32, in Initialize > File , line 0, in _stub_##145 > File C:\Documents and Settings\M. David\My > Documents\Projects\Lib\Axon\Scheduler.py, line 67, in __init__ > File , line 0, in _stub_##52 > File C:\Documents and Settings\M. David\My > Documents\Projects\Lib\Axon\Microprocess.py, line 229, in __init__ > File , line 0, in _stub_##52 > File C:\Documents and Settings\M. David\My > Documents\Projects\Lib\Axon\CoordinatingAssistantTracker.py, line 45, in ge > tcat > File , line 0, in _stub_##103 > File , line 0, in _stub_##329 > TypeError: unsupported operand type for Not: > 'coordinatingassistanttracker' > I'll compile the binaries for use on GNU/Linux/Mono, add them to the repository, and send you the link when complete. On 7/10/07, Michael Sparks wrote: > > On Tuesday 10 July 2007 21:25, Dino Viehland wrote: > > Does Kamaelia use the new syntax as supported via PEP-342 > > Kamaelia uses the simpler version of generators which rather than the new > functionality in PEP342. Specifically Kamaelia uses the version of python > generators that has been part of the language since python 2.2.2 - > specifically PEP 255 generators: > > cf http://www.python.org/dev/peps/pep-0255/ > > Personally I'd be surprised if Kamaelia didn't work on IronPython, but > I've > simply not tried it myself. If someone tells me the dependencies under > Linux, > I'd be more than happy to test it :) > > > Michael. > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Kamaelia-list mailing list > Kamaelia-list at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/kamaelia-list > -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From xmlhacker at gmail.com Wed Jul 11 00:38:55 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Tue, 10 Jul 2007 16:38:55 -0600 Subject: [IronPython] [Kamaelia-list] Hosting IronPython 2.X in .NET app In-Reply-To: References: <5f040ba90707061243h5f68955fn37facf86b0355bdb@mail.gmail.com> <7AD436E4270DD54A94238001769C2227B490A46C72@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <200707102237.50026.ms@cerenity.org> Message-ID: On 7/10/07, M. David Peterson wrote: > > > I'll compile the binaries for use on GNU/Linux/Mono, add them to the > repository, and send you the link when complete. Ran into some strange compilation errors so am rebuilding Mono from SVN to see if this fixes them. Will take a bit longer than I thought before this is ready. -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From xmlhacker at gmail.com Wed Jul 11 00:48:15 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Tue, 10 Jul 2007 16:48:15 -0600 Subject: [IronPython] [Kamaelia-list] Hosting IronPython 2.X in .NET app In-Reply-To: References: <5f040ba90707061243h5f68955fn37facf86b0355bdb@mail.gmail.com> <7AD436E4270DD54A94238001769C2227B490A46C72@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <200707102237.50026.ms@cerenity.org> Message-ID: It just occurred to me that you could just as easily use IronPython Community Edition r6 (based on IP 1.1) as the IP2.0 features shouldn't be required to test for compatibility. With the above in mind, svn co http://extf.googlecode.com/svn/vendor/IPCE-r6/ cd IPCE-r6 mono ipy.exe -X:TabCompletion -X:ColorfulConsole results in the following, IronPython 1.1 (1.1) on .NET 2.0.50727.42 > Copyright (c) Microsoft Corporation. All rights reserved. > >>> import Axon > >>> > Which I believe is a good sign ;-) I'll add Kamaelia to the same repository folder now and see where that leaves things. On 7/10/07, M. David Peterson wrote: > > On 7/10/07, M. David Peterson > > wrote: > > > > > > I'll compile the binaries for use on GNU/Linux/Mono, add them to the > > repository, and send you the link when complete. > > > Ran into some strange compilation errors so am rebuilding Mono from SVN to > see if this fixes them. Will take a bit longer than I thought before this > is ready. > > -- > /M:D > > M. David Peterson > http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | > http://dev.aol.com/blog/3155 > -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From xmlhacker at gmail.com Wed Jul 11 00:54:48 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Tue, 10 Jul 2007 16:54:48 -0600 Subject: [IronPython] [Kamaelia-list] Hosting IronPython 2.X in .NET app In-Reply-To: References: <5f040ba90707061243h5f68955fn37facf86b0355bdb@mail.gmail.com> <7AD436E4270DD54A94238001769C2227B490A46C72@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <200707102237.50026.ms@cerenity.org> Message-ID: On 7/10/07, M. David Peterson wrote: > > > I'll add Kamaelia to the same repository folder now and see where that > leaves things. Done and, IronPython 1.1 (1.1) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import Kamaelia >>> This is exciting to see! Any tips on where to start playing to test for low level compatibility with both Axon and Kamaelia? -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From ken.manheimer at gmail.com Wed Jul 11 01:08:50 2007 From: ken.manheimer at gmail.com (Ken Manheimer) Date: Tue, 10 Jul 2007 19:08:50 -0400 Subject: [IronPython] Hosting IronPython 2.X in .NET app In-Reply-To: References: <5f040ba90707061243h5f68955fn37facf86b0355bdb@mail.gmail.com> <785694cd0707061929k69cb9a77nb1fbf02f7b400424@mail.gmail.com> <7AD436E4270DD54A94238001769C2227B490A46C5F@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <4693E3BC.9000804@defuze.org> Message-ID: <2cd46e7f0707101608p31aa8facs56c05d2372bccfcc@mail.gmail.com> On 7/10/07, M. David Peterson wrote: > > > On 7/10/07, Sylvain Hellegouarch wrote: > > > > > > Not to worry :) > > However the question stands, will Python support closures (or does it > > already via lambda expressions?) > > > Depends on your interpretation of what a closure is. One interpretation > is that w ith closures you can, for example, have a series of lambda > expressions, evaluate up to a certain point, add a marker, store it, and > then continue where you left off at a later date. > just to clarify, it sounds like you may be mistaking terminology here. the elementary structures by which computations can be stored for later continuation are called just that - continuations. closures, on the other hand, are an organization of program state that can be associated with an object - typically to implement static scoping, as was done for python functions and methods around, someone said, python 2.1. i seem to recall that ruby manifests blocks as first class objects, and associates closures with them, as well. (continuations are interesting, but mostly in the abstract - they're not generally of interest for direct use by programmers. they're the mother of all control flow structures - all the others can be expressed and built using them, but they're very low-level - you would hardly ever want to program with them directly. stackless python uses (used?) them as a key means of building the other flow control structures without using the machine (c, in that case) stack, and they enable economies for massive parallelism that most of us don't need (and couldn't handle without major attention). generators provide the means to express much of what programmers practically want in this vein, and the recent refinements to enable use of generators as coroutines (pep 342) covers most of the rest. how these structures map to parallelism are up to the language implementation. guido has been actively disinterested in incorporating continuations to the python definition, for various reasons, and i don't expect that to change.) i couldn't resist this clarification, and hope i haven't mistaken what you were saying (or, what i'm saying:-). -- ken http://myriadicity.net As per our conversation in IM, this would certainly be one way to move > towards a stackless and thread-free Python diet. ;-) > > Also, since we're on the subject, one *true test* of Python language > interoperability would be to get Kamaelia ( http://kamaelia.org ) to work > properly via IronPython. > Kamaelia list (Cc'd): Has anyone attempted to get Kamaelia working with > IronPython? If I am understanding things correctly, until support for > generators are implemented then this would not be possible. Is this > understanding correct? > > To the IronPython team: Having the ability to run Kamaelia (a brainchild > of Michael Sparks of BBC Research) via IronPython would be an absolute dream > come true. *AMAZING* potential existing bridging together Kamaelia and > .NET, in my own opinion. > > -- > /M:D > > M. David Peterson > http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | > http://dev.aol.com/blog/3155 > > _______________________________________________ > 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 xmlhacker at gmail.com Wed Jul 11 01:25:06 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Tue, 10 Jul 2007 17:25:06 -0600 Subject: [IronPython] [Kamaelia-list] Hosting IronPython 2.X in .NET app In-Reply-To: <2cd46e7f0707101608p31aa8facs56c05d2372bccfcc@mail.gmail.com> References: <5f040ba90707061243h5f68955fn37facf86b0355bdb@mail.gmail.com> <785694cd0707061929k69cb9a77nb1fbf02f7b400424@mail.gmail.com> <7AD436E4270DD54A94238001769C2227B490A46C5F@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <4693E3BC.9000804@defuze.org> <2cd46e7f0707101608p31aa8facs56c05d2372bccfcc@mail.gmail.com> Message-ID: On 7/10/07, Ken Manheimer wrote: > > > the elementary structures by which computations can be stored for later > continuation are called just that - continuations. closures, on the other > hand, are an organization of program state that can be associated with an > object - typically to implement static scoping, as was done for python > functions and methods around, someone said, python 2.1. i seem to recall > that ruby manifests blocks as first class objects, and associates closures > with them, as well. > Ugg! Hey Curt, we're now twins! ;-) Yep, I most definitely confused things here. Thanks for the correction! (continuations are interesting, but mostly in the abstract - they're not > generally of interest for direct use by programmers. they're the mother of > all control flow structures - all the others can be expressed and built > using them, but they're very low-level - you would hardly ever want to > program with them directly. stackless python uses (used?) them as a key > means of building the other flow control structures without using the > machine (c, in that case) stack, and they enable economies for massive > parallelism that most of us don't need (and couldn't handle without major > attention). generators provide the means to express much of what > programmers practically want in this vein, and the recent refinements to > enable use of generators as coroutines (pep 342) > covers most of the rest. how these structures map to parallelism are up to > the language implementation. guido has been actively disinterested in > incorporating continuations to the python definition, for various reasons, > and i don't expect that to change.) > Yep. this all makes sense. i couldn't resist this clarification, and hope i haven't mistaken what you > were saying (or, what i'm saying:-). > Nope, you are right on the money. I said closures, but meant continuations. Thanks for correcting me! -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Wed Jul 11 01:34:24 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 10 Jul 2007 16:34:24 -0700 Subject: [IronPython] [Kamaelia-list] Hosting IronPython 2.X in .NET app In-Reply-To: References: <5f040ba90707061243h5f68955fn37facf86b0355bdb@mail.gmail.com> <7AD436E4270DD54A94238001769C2227B490A46C72@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <200707102237.50026.ms@cerenity.org> Message-ID: <7AD436E4270DD54A94238001769C2227B490A46D26@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Very cool! And I guess this means we have a bug relating to not that we need to figure out in v2.0 ?. From: M. David Peterson [mailto:xmlhacker at gmail.com] Sent: Tuesday, July 10, 2007 3:55 PM To: ms at cerenity.org Cc: kamaelia-list at lists.sourceforge.net; Dino Viehland; Discussion of IronPython Subject: Re: [Kamaelia-list] [IronPython] Hosting IronPython 2.X in .NET app On 7/10/07, M. David Peterson > wrote: I'll add Kamaelia to the same repository folder now and see where that leaves things. Done and, IronPython 1.1 (1.1) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import Kamaelia >>> This is exciting to see! Any tips on where to start playing to test for low level compatibility with both Axon and Kamaelia? -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From xmlhacker at gmail.com Wed Jul 11 02:42:26 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Tue, 10 Jul 2007 18:42:26 -0600 Subject: [IronPython] Kamaelia and IronPython (was: Hosting IronPython 2.X in .NET app) Message-ID: On 7/10/07, Dino Viehland wrote: > > Very cool! > Yup :) And I guess this means we have a bug relating to not that we need to figure > out in v2.0 J. > Yup :D But none-the-less, the fact that this works thus far on 1.1 (and at some point in the future on 2.0) opens up some exciting possibilities in regards to gaining the concurrency benefits that the underlying Axon library provides while at the same time the ability to build some Kamaelia components for IronPython that take full advantage of all of the underlying feature set. Off the top of my head, extending the IronTunes sample (@ http://www.codeplex.com/IronPython/Wiki/View.aspx?title=Samples&referringTitle=Home) to incorporate P2P audio streaming ( e.g. personal radio stations that you could then access from another web-enabled device) would be a fun project. And integrating MonoTorrent into the mix (which is now *EXTREMELY* fast and reliable (see: http://monotorrent.com/) should present some interesting opportunities to mimic some of the C-based extensions that wouldn't work via IP. Michael: Have any project ideas for extending Kamaelia into the .NET realm? What about tutorials for folks wanting to get their feet wet with Kamaelia? To everyone else, there's a Kamaelia Cookbook[1] and a recently added Ideas page[2]. From my own experience, Kamaelia is both fun and exciting to work with once you realize how much power is at your fingertips. [1] http://kamaelia.sourceforge.net/Cookbook [2] http://kamaelia.sourceforge.net/Developers/Ideas -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From sh at defuze.org Wed Jul 11 09:16:12 2007 From: sh at defuze.org (Sylvain Hellegouarch) Date: Wed, 11 Jul 2007 08:16:12 +0100 Subject: [IronPython] Hosting IronPython 2.X in .NET app In-Reply-To: <2cd46e7f0707101608p31aa8facs56c05d2372bccfcc@mail.gmail.com> References: <5f040ba90707061243h5f68955fn37facf86b0355bdb@mail.gmail.com> <785694cd0707061929k69cb9a77nb1fbf02f7b400424@mail.gmail.com> <7AD436E4270DD54A94238001769C2227B490A46C5F@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <4693E3BC.9000804@defuze.org> <2cd46e7f0707101608p31aa8facs56c05d2372bccfcc@mail.gmail.com> Message-ID: <469483BC.9080103@defuze.org> Ken Manheimer a ?crit : > On 7/10/07, *M. David Peterson* > wrote: > > > On 7/10/07, *Sylvain Hellegouarch* < sh at defuze.org > > wrote: > > > Not to worry :) > However the question stands, will Python support closures (or > does it > already via lambda expressions?) > > > Depends on your interpretation of what a closure is. One > interpretation is that w ith closures you can, for example, have a > series of lambda expressions, evaluate up to a certain point, add > a marker, store it, and then continue where you left off at a > later date. > > > just to clarify, it sounds like you may be mistaking terminology here. > > the elementary structures by which computations can be stored for > later continuation are called just that - continuations. closures, on > the other hand, are an organization of program state that can be > associated with an object - typically to implement static scoping, as > was done for python functions and methods around, someone said, python > 2.1. i seem to recall that ruby manifests blocks as first class > objects, and associates closures with them, as well. > > (continuations are interesting, but mostly in the abstract - they're > not generally of interest for direct use by programmers. they're the > mother of all control flow structures - all the others can be > expressed and built using them, but they're very low-level - you would > hardly ever want to program with them directly. stackless python uses > (used?) them as a key means of building the other flow control > structures without using the machine (c, in that case) stack, and they > enable economies for massive parallelism that most of us don't need > (and couldn't handle without major attention). generators provide the > means to express much of what programmers practically want in this > vein, and the recent refinements to enable use of generators as > coroutines (pep 342 ) covers > most of the rest. how these structures map to parallelism are up to > the language implementation. guido has been actively disinterested in > incorporating continuations to the python definition, for various > reasons, and i don't expect that to change.) > > i couldn't resist this clarification, and hope i haven't mistaken what > you were saying (or, what i'm saying:-). > > -- Thanks Ken as well for this explanation. This is one of those confusing subject for me and you helped a lot here :) Side note, talking about stackless, Arnar Birgisson just released yesterday a stackless version of the CherryPy HTTP server: http://code.google.com/p/stacklessexamples/wiki/StacklessWSGI Interesting days that is :) - Sylvain From xmlhacker at gmail.com Wed Jul 11 10:34:14 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Wed, 11 Jul 2007 02:34:14 -0600 Subject: [IronPython] Kamaelia and IronPython (was: Hosting IronPython 2.X in .NET app) In-Reply-To: <200707110918.21948.ms@cerenity.org> References: <200707110918.21948.ms@cerenity.org> Message-ID: On 7/11/07, Michael Sparks wrote: > > On Wednesday 11 July 2007 01:42, M. David Peterson wrote: > > P2P audio streaming > > A *very* simplistic P2P streaming core written in an evening (last friday > evening specifically) using Kamaelia can be found here: (really needs > buffering, detection of broken connections, multiple sources, but does > work) > > > http://kamaelia.svn.sourceforge.net/viewvc/kamaelia/trunk/Sketches/MPS/LUGRadio/SimpleSwarm.py?view=markup > > http://kamaelia.svn.sourceforge.net/viewvc/kamaelia/trunk/Sketches/MPS/LUGRadio/SimpleSwarmRadioSource.py?view=markup Oh, this is cool! It was written for my presentation at LUG Radio Live this past weekend in > Wolverhampton (UK). Gives an idea of the compactness of code you can get > if > you allow concurrency to be naturally handled in the system by thinking of > them as communicating components. It's a powerful analogy, for sure! Right inline with the Smalltalk way of thinking about programming, something I truly appreciate. Come to think of it, the combination of Vista Smalltalk/DLR[1] + IronPython + Kamaelia + Silverlight (once Silverlight gains support for sockets) == my mouth drooling with the combination of possibilities. :D Peter (Cc'd): Have you had a chance to look @ Kamaelia[2]? [1]: http://vistascript.net/ [2]: http://kamaelia.org/ The first file (220 lines) is a generic peer. The second file (170 lines) is > a > source peer - specifically it captures BBC Radio 1 off broadcast from DVB > digital TV broadcasts and then restransmits it. (Its an example source - > someone actually intent on using this would have to replace that source > with > a source they have a license to redistribute) Am playing with this now. In the mean time, one problem I ran into that requires the yet to be implemented nested yield statements in IP 2.0, IronPython 1.1 (1.1) on .NET 2.0.50727.42 > Copyright (c) Microsoft Corporation. All rights reserved. > >>> from Kamaelia.Chassis.Pipeline import Pipeline > >>> from Kamaelia.Protocol.HTTP.HTTPClient import * > Traceback (most recent call last): > File HTTPClient, line unknown, in Initialize > SyntaxError: yield in more than one try blocks > (/Users/mdavid/Projects/extf.googlecode.com/vendor/IPCE-r6/Lib/Kamaelia/Internet/TCPClient.py, > line 222) > >>> > Beyond the above issue, things seem to be playing nicely which is really great! I'll run through the provided sample now and let you know if I run into any issues. Thanks, Michael! -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From xmlhacker at gmail.com Wed Jul 11 10:44:03 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Wed, 11 Jul 2007 02:44:03 -0600 Subject: [IronPython] Kamaelia and IronPython (was: Hosting IronPython 2.X in .NET app) In-Reply-To: References: <200707110918.21948.ms@cerenity.org> Message-ID: On 7/11/07, M. David Peterson wrote: > > > It's a powerful analogy, for sure! Right inline with the Smalltalk way of > thinking about programming, something I truly appreciate. Come to think of > it, the combination of Vista Smalltalk/DLR[1] + IronPython + Kamaelia + > Silverlight (once Silverlight gains support for sockets) == my mouth > drooling with the combination of possibilities. :D > BTW, Michael: Just in case you were unaware, I should point out the fact that there is now an OSS version of Silverlight developed by the good folks behind the the Mono-Project. See [1,2,3,4] for more detail. [1] http://tirania.org/blog/archive/2007/Jun-21.html [2] http://www.mono-project.com/Moonlight [3] http://www.mono-project.com/MoonlightShots [4] http://www.youtube.com/watch?v=qRSO7p0HAIw -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From xmlhacker at gmail.com Wed Jul 11 11:25:31 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Wed, 11 Jul 2007 03:25:31 -0600 Subject: [IronPython] Kamaelia and IronPython (was: Hosting IronPython 2.X in .NET app) In-Reply-To: References: <200707110918.21948.ms@cerenity.org> Message-ID: On 7/11/07, M. David Peterson wrote: > > > Am playing with this now. In the mean time, one problem I ran into that > requires the yet to be implemented nested yield statements in IP 2.0, > > IronPython 1.1 (1.1) on .NET 2.0.50727.42 > > Copyright (c) Microsoft Corporation. All rights reserved. > > >>> from Kamaelia.Chassis.Pipeline import Pipeline > > >>> from Kamaelia.Protocol.HTTP.HTTPClient import * > > Traceback (most recent call last): > > File HTTPClient, line unknown, in Initialize > > SyntaxError: yield in more than one try blocks > > (/Users/mdavid/Projects/extf.googlecode.com/vendor/IPCE-r6/Lib/Kamaelia/Internet/TCPClient.py, > > line 222) > > >>> > > So I ran into the same issue, m-david-petersons-computer:~/Projects/extf.googlecode.com/vendor/IPCE-r6 > mdavid$ mono ipy.exe SimpleSwarm.py > Traceback (most recent call last): > File SimpleSwarm, line unknown, in Initialize > SyntaxError: yield in more than one try blocks > (/Users/mdavid/Projects/extf.googlecode.com/vendor/IPCE-r6/Lib/Kamaelia/Internet/TCPClient.py, > line 222) > I also ran into an issue in which Sylvain so kindly helped me track down, from Kamaelia.File.UnixProcess import UnixProcess > ... > Pipeline( > SubscribeTo("RADIO"), > UnixProcess("mplayer -"), > ).run() > But this is a platform specific issue rather than an issue with IP directly. So at this stage, and for the time being, it looks like any type of TCP communications won't work. Hopefully that will change soon enough :D -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From stefan.dobrev at gmail.com Wed Jul 11 11:40:38 2007 From: stefan.dobrev at gmail.com (Stefan Dobrev) Date: Wed, 11 Jul 2007 12:40:38 +0300 Subject: [IronPython] IronPython Logo / Icon Message-ID: <928de89c0707110240s7c72150ave4707004a37c3ced@mail.gmail.com> Hi Guys, I had embedded IronPython 2.0 (DLR) in my WPF app. I have also created a WPF based console similar to the DLRConsole sample shipped with Silverlight 1.1 SDK. While I also creating a button to toggle the console window I wanted to put an IronPython (or DLR) image in button content. After searching the web I did not find any logo nighters for IP, nor for the DLR. The only thing that I came across is thisimage from the asp.net site. It only looks iron-ish, but nothing python like in it :) So my point is why does someone create a logo for IronPython (or even we can host an open competition for this :) P.S. Something like the Silverlight logo will be cool :) Regards, Stefan Dobrev -------------- next part -------------- An HTML attachment was scrubbed... URL: From gh.xiao at gmail.com Wed Jul 11 12:37:19 2007 From: gh.xiao at gmail.com (Guohui Xiao) Date: Wed, 11 Jul 2007 18:37:19 +0800 Subject: [IronPython] IronPython Logo / Icon In-Reply-To: <928de89c0707110240s7c72150ave4707004a37c3ced@mail.gmail.com> References: <928de89c0707110240s7c72150ave4707004a37c3ced@mail.gmail.com> Message-ID: <236b92bd0707110337l62be815aja567635730a25232@mail.gmail.com> good idea! On 7/11/07, Stefan Dobrev wrote: > > Hi Guys, > > I had embedded IronPython 2.0 (DLR) in my WPF app. I have also created a > WPF based console similar to the DLRConsole sample shipped with Silverlight > 1.1 SDK. While I also creating a button to toggle the console window I > wanted to put an IronPython (or DLR) image in button content. After > searching the web I did not find any logo nighters for IP, nor for the DLR. > The only thing that I came across is thisimage from the > asp.net site. It only looks iron-ish, but nothing python like in it :) So > my point is why does someone create a logo for IronPython (or even we can > host an open competition for this :) > > P.S. Something like the Silverlight logo will be cool :) > > Regards, > Stefan Dobrev > > > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -- Xiao Guohui Department of Information Science Peking University Beijing, 100871 CHINA -------------- next part -------------- An HTML attachment was scrubbed... URL: From storm.openmail at gmail.com Wed Jul 11 16:44:32 2007 From: storm.openmail at gmail.com (Martin) Date: Wed, 11 Jul 2007 16:44:32 +0200 Subject: [IronPython] "TypeError: Microsoft.Scripting.DynamicType is not callable" bug(?) Message-ID: Hi, *Background:* We have a number of Python scripts that we use for updating and setting up the devices my company make. We do this through calls to a number of COM classes via win32com.client.Dispatch(). We are interested in being able to call these Python scripts from various .NET GUI applications written in C# so naturally I started looking into IronPython. My goal is to make our CPython code as executable in IronPython as humanly possible so since win32com is not available through IronPython I wrote a simple C# interop wrapper handling the interops for the specific COM classes we need to call when setting up our devices: namespace win32com { public class client { public static object Dispatch(string comName) { } } } The annoying thing is that this "hack" works like a charm except in one type of case. *Problem:* Some of our COM classes return Item collections that are indexable by both specific names (string indexing) and normal int indexes - example in CPython: result=win32com.client.Dispatch("COMClass")("ItemName") and/or result=win32com.client.Dispatch("COMClass")(0) This works like a charm in CPython (and the interop version of our C# code for that matter) but it does NOT work in IronPython. In IronPython 1.1 I get this error message "TypeError: object is not callable" In IronPython 2.0 alpha 3 I get this error message: "TypeError: Microsoft.Scripting.DynamicType is not callable". I can access the properties of the object such as item count however I cannot index into the result object by calling result.get_Item("ItemName"). It gives the following error message TypeError: multiple overloads of get_Item could match (String) get_Item(Object) get_Item(Object) nor can I index into the result object by calling result.get_Item(0) which gives a similar error except the problematic match is Int32. So apparently IronPython cannot identify the type of the index objects when more are present? *Question* ** Anyone have any comments that can help me here? Have I missed some subtle issues with COM interop? Is this a known bug and if so when do you think it will be fixed? (I know I can get around the problem by writing specific IronPython code + changing the handling of the COM class in my C# wrapper but I REALLY don't want to nor should I have to if the goal is to make IronPython as clean as possible port of CPython.) PS. Great initiative and great work otherwise in the port BR Martin Storm M?ller -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Wed Jul 11 18:17:18 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 11 Jul 2007 09:17:18 -0700 Subject: [IronPython] "TypeError: Microsoft.Scripting.DynamicType is not callable" bug(?) In-Reply-To: References: Message-ID: <7AD436E4270DD54A94238001769C2227B490A46DD8@DF-GRTDANE-MSG.exchange.corp.microsoft.com> I could be asking the obvious but do square brackets work for you? I would expect: result=win32com.client.Dispatch("COMClass")["ItemName"] result=win32com.client.Dispatch("COMClass")[0] to work or possibly: result=win32com.client.Dispatch("COMClass").Item[0] Another possibility is selecting the overloads on get_Item. I don't know why we'd think there'd be two object versions but bound methods will have an "Overloads" property (after importing clr or another .NET namespace) which might help you (I'm not sure it will, but it's worth a shot). Finally I would suggest that you could also look into making a PIA (Primary Interop Assembly) for your COM objects if you have a TLB instead of writing your own dispatch code. A tool ships w/ the .NET framework called tlbimp so if you have a TLB for your COM objects you can use that to generate an assembly. Add a reference to that assembly and you might find that you have a better COM experience. Unfortunately that only helps if you have a TLB available. Hopefully one of those will help. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Martin Sent: Wednesday, July 11, 2007 7:45 AM To: users at lists.ironpython.com Subject: [IronPython] "TypeError: Microsoft.Scripting.DynamicType is not callable" bug(?) Hi, Background: We have a number of Python scripts that we use for updating and setting up the devices my company make. We do this through calls to a number of COM classes via win32com.client.Dispatch(). We are interested in being able to call these Python scripts from various .NET GUI applications written in C# so naturally I started looking into IronPython. My goal is to make our CPython code as executable in IronPython as humanly possible so since win32com is not available through IronPython I wrote a simple C# interop wrapper handling the interops for the specific COM classes we need to call when setting up our devices: namespace win32com { public class client { public static object Dispatch(string comName) { } } } The annoying thing is that this "hack" works like a charm except in one type of case. Problem: Some of our COM classes return Item collections that are indexable by both specific names (string indexing) and normal int indexes - example in CPython: result=win32com.client.Dispatch("COMClass")("ItemName") and/or result=win32com.client.Dispatch("COMClass")(0) This works like a charm in CPython (and the interop version of our C# code for that matter) but it does NOT work in IronPython. In IronPython 1.1 I get this error message "TypeError: object is not callable" In IronPython 2.0 alpha 3 I get this error message: "TypeError: Microsoft.Scripting.DynamicType is not callable". I can access the properties of the object such as item count however I cannot index into the result object by calling result.get_Item("ItemName"). It gives the following error message TypeError: multiple overloads of get_Item could match (String) get_Item(Object) get_Item(Object) nor can I index into the result object by calling result.get_Item(0) which gives a similar error except the problematic match is Int32. So apparently IronPython cannot identify the type of the index objects when more are present? Question Anyone have any comments that can help me here? Have I missed some subtle issues with COM interop? Is this a known bug and if so when do you think it will be fixed? (I know I can get around the problem by writing specific IronPython code + changing the handling of the COM class in my C# wrapper but I REALLY don't want to nor should I have to if the goal is to make IronPython as clean as possible port of CPython.) PS. Great initiative and great work otherwise in the port BR Martin Storm M?ller -------------- next part -------------- An HTML attachment was scrubbed... URL: From luis.capra at gmail.com Wed Jul 11 20:31:35 2007 From: luis.capra at gmail.com (Luis Capra) Date: Wed, 11 Jul 2007 15:31:35 -0300 Subject: [IronPython] What happends with AddAssembly ? Message-ID: <5aafd6b70707111131t49fe5123u6fb228c087311237@mail.gmail.com> PythonEngine had a method called AddAssembly in 2.0 A1, in 2.0 A2 doesnt exist. How can i import an assembly right now? Thnx. -------------- next part -------------- An HTML attachment was scrubbed... URL: From kfarmer at thuban.org Thu Jul 12 01:37:21 2007 From: kfarmer at thuban.org (Keith J. Farmer) Date: Wed, 11 Jul 2007 16:37:21 -0700 Subject: [IronPython] IronPython Logo / Icon In-Reply-To: <236b92bd0707110337l62be815aja567635730a25232@mail.gmail.com> References: <928de89c0707110240s7c72150ave4707004a37c3ced@mail.gmail.com> <236b92bd0707110337l62be815aja567635730a25232@mail.gmail.com> Message-ID: I nominate a grey-colored snake in the shape of the Visual Studio infinity logo. J From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Guohui Xiao Sent: Wednesday, July 11, 2007 3:37 AM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Logo / Icon good idea! On 7/11/07, Stefan Dobrev wrote: Hi Guys, I had embedded IronPython 2.0 (DLR) in my WPF app. I have also created a WPF based console similar to the DLRConsole sample shipped with Silverlight 1.1 SDK. While I also creating a button to toggle the console window I wanted to put an IronPython (or DLR) image in button content. After searching the web I did not find any logo nighters for IP, nor for the DLR. The only thing that I came across is this image from the asp.net site. It only looks iron-ish, but nothing python like in it :) So my point is why does someone create a logo for IronPython (or even we can host an open competition for this :) P.S. Something like the Silverlight logo will be cool :) Regards, Stefan Dobrev _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- Xiao Guohui Department of Information Science Peking University Beijing, 100871 CHINA -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Thu Jul 12 02:15:39 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 11 Jul 2007 17:15:39 -0700 Subject: [IronPython] What happends with AddAssembly ? In-Reply-To: <5aafd6b70707111131t49fe5123u6fb228c087311237@mail.gmail.com> References: <5aafd6b70707111131t49fe5123u6fb228c087311237@mail.gmail.com> Message-ID: <7AD436E4270DD54A94238001769C2227B797455653@DF-GRTDANE-MSG.exchange.corp.microsoft.com> You can call ClrModule.GetInstance().AddReference(). The tentative thought is that we'll share this between languages so that you only need to do it once and all languages pick it up. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Luis Capra Sent: Wednesday, July 11, 2007 11:32 AM To: users at lists.ironpython.com Subject: [IronPython] What happends with AddAssembly ? PythonEngine had a method called AddAssembly in 2.0 A1, in 2.0 A2 doesnt exist. How can i import an assembly right now? Thnx. -------------- next part -------------- An HTML attachment was scrubbed... URL: From luis.capra at gmail.com Thu Jul 12 05:11:24 2007 From: luis.capra at gmail.com (Luis Capra (gmail)) Date: Wed, 11 Jul 2007 22:11:24 -0500 Subject: [IronPython] What happends with AddAssembly ? In-Reply-To: <7AD436E4270DD54A94238001769C2227B797455653@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <5aafd6b70707111131t49fe5123u6fb228c087311237@mail.gmail.com> <7AD436E4270DD54A94238001769C2227B797455653@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <46959be9.0308360a.0661.ffffd6b5@mx.google.com> Oks. Thank you very much! Luis From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Wednesday, July 11, 2007 7:16 PM To: Discussion of IronPython Subject: Re: [IronPython] What happends with AddAssembly ? You can call ClrModule.GetInstance().AddReference(). The tentative thought is that we'll share this between languages so that you only need to do it once and all languages pick it up. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Luis Capra Sent: Wednesday, July 11, 2007 11:32 AM To: users at lists.ironpython.com Subject: [IronPython] What happends with AddAssembly ? PythonEngine had a method called AddAssembly in 2.0 A1, in 2.0 A2 doesnt exist. How can i import an assembly right now? Thnx. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sanxiyn at gmail.com Thu Jul 12 05:21:42 2007 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Thu, 12 Jul 2007 12:21:42 +0900 Subject: [IronPython] Getting attribute of new-style bound methods overriding built-in types Message-ID: <5b0248170707112021x7188684eqefb36d77bb4b748b@mail.gmail.com> That was mouthful. This is for 1.1. (Running the following code on 2.0a2/Mono dies inside System.Reflection.Emit. Ugh.) class C(object): def __str__(self): return 'C' obj = C() getattr(obj.__str__, 'attribute', None) Result: TypeError: Cannot cast from source type to destination type. This is InvalidCastException. IronPython/Runtime/calls/Function.cs has this comment on line 906: public sealed partial class Method (snip) { //??? can I type this to Function private object func; Apparently you can't... The error is thrown when you cast func to PythonFunction, I think. -- Seo Sanghyeon From sanxiyn at gmail.com Thu Jul 12 05:27:46 2007 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Thu, 12 Jul 2007 12:27:46 +0900 Subject: [IronPython] Zero-length regex split Message-ID: <5b0248170707112027l7f55c895re3b47ea59a6a9e13@mail.gmail.com> This sucks. I'm not sure which sucks more: that such code exists, or that it breaks on IronPython in hard-to-find manner. import re print re.split(':*', 'a:b::c') Quick workaround is to replace the pattern ':*' with ':+'. This may not be always possible. -- Seo Sanghyeon From amm at selektro.dk Thu Jul 12 10:02:59 2007 From: amm at selektro.dk (Anders M. Mikkelsen) Date: Thu, 12 Jul 2007 10:02:59 +0200 Subject: [IronPython] Problem with super Message-ID: <000c01c7c45b$0ffaa120$1600a8c0@PC52> Hi I have some problems getting 'super' working with IronPython. Running the following simple script: class A: def Foo(self): pass class B(A): def Foo(self): super(B, self).Foo() B().Foo() yields: TypeError: expected type, got classobj Any ideas? /anders -------------- next part -------------- An HTML attachment was scrubbed... URL: From storm.openmail at gmail.com Thu Jul 12 11:11:54 2007 From: storm.openmail at gmail.com (Martin) Date: Thu, 12 Jul 2007 11:11:54 +0200 Subject: [IronPython] "TypeError: Microsoft.Scripting.DynamicType is not callable" bug(?) In-Reply-To: <7AD436E4270DD54A94238001769C2227B490A46DD8@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <7AD436E4270DD54A94238001769C2227B490A46DD8@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: You are asking the obvious... or rather it *should* have been obvious. But unfortunately it wasn't... Yes, result=win32com.client.Dispatch("COMClass")["ItemName"] works. As for your final suggestion (which is excellent). We do have a TLB and I have already fooled around with a tlbimp generated interop dll. However it doesn't help in respect to making it possible to run our CPython scripts in IronPython. Something that is not simple to accomplish when COM interop rears it's ugly head. Thank you very much for the quick reply - even though it made me want to bang my head into the table ;-) BR Martin On 7/11/07, Dino Viehland wrote: > > I could be asking the obvious but do square brackets work for you? > > > > I would expect: > > > > result=win32com.client.Dispatch("COMClass")["ItemName"] > > result=win32com.client.Dispatch("COMClass")[0] > > > > to work or possibly: > > > > result=win32com.client.Dispatch("COMClass").Item[0] > > > > Another possibility is selecting the overloads on get_Item. I don't know > why we'd think there'd be two object versions but bound methods will have an > "Overloads" property (after importing clr or another .NET namespace) which > might help you (I'm not sure it will, but it's worth a shot). > > > > Finally I would suggest that you could also look into making a PIA > (Primary Interop Assembly) for your COM objects if you have a TLB instead of > writing your own dispatch code. A tool ships w/ the .NET framework called > tlbimp so if you have a TLB for your COM objects you can use that to > generate an assembly. Add a reference to that assembly and you might find > that you have a better COM experience. Unfortunately that only helps if you > have a TLB available. > > > > Hopefully one of those will help. > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Martin > *Sent:* Wednesday, July 11, 2007 7:45 AM > *To:* users at lists.ironpython.com > *Subject:* [IronPython] "TypeError: Microsoft.Scripting.DynamicType is not > callable" bug(?) > > > > Hi, > > > > *Background:* > > We have a number of Python scripts that we use for updating and setting up > the devices my company make. We do this through calls to a number of COM > classes via win32com.client.Dispatch(). > > > > We are interested in being able to call these Python scripts from various > .NET GUI applications written in C# so naturally I started looking into > IronPython. > > > > My goal is to make our CPython code as executable in IronPython as humanly > possible so since win32com is not available through IronPython I wrote a > simple C# interop wrapper handling the interops for the specific COM classes > we need to call when setting up our devices: > > > > namespace win32com > { > public class client > { > > public static object Dispatch(string comName) > > { > > > > } > > } > } > > > The annoying thing is that this "hack" works like a charm except in one > type of case. > > > > *Problem:* > > Some of our COM classes return Item collections that are indexable by both > specific names (string indexing) and normal int indexes > > - example in CPython: result=win32com.client.Dispatch("COMClass")("ItemName") and/or > result=win32com.client.Dispatch("COMClass")(0) > > > > This works like a charm in CPython (and the interop version of our C# code > for that matter) but it does NOT work in IronPython. > > In IronPython 1.1 I get this error message "TypeError: object is not > callable" > > In IronPython 2.0 alpha 3 I get this error message: "TypeError: > Microsoft.Scripting.DynamicType is not callable". > > > > I can access the properties of the object such as item count however I > cannot index into the result object by calling result.get_Item("ItemName"). > It gives the following error message > > > > TypeError: multiple overloads of get_Item could match (String) > get_Item(Object) > get_Item(Object) > > > > nor can I index into the result object by calling result.get_Item(0) which > gives a similar error except the problematic match is Int32. > > > > So apparently IronPython cannot identify the type of the index objects > when more are present? > > > > *Question* > > > > Anyone have any comments that can help me here? Have I missed some subtle > issues with COM interop? Is this a known bug and if so when do you think it > will be fixed? > > > > (I know I can get around the problem by writing specific IronPython code + > changing the handling of the COM class in my C# wrapper but I REALLY don't > want to nor should I have to if the goal is to make IronPython as clean as > possible port of CPython.) > > > > PS. > > Great initiative and great work otherwise in the port > > > > BR > > Martin Storm M?ller > > > > _______________________________________________ > 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 christian.muirhead at resolversystems.com Thu Jul 12 12:35:33 2007 From: christian.muirhead at resolversystems.com (Christian Muirhead) Date: Thu, 12 Jul 2007 11:35:33 +0100 Subject: [IronPython] Problem with super In-Reply-To: <000c01c7c45b$0ffaa120$1600a8c0@PC52> References: <000c01c7c45b$0ffaa120$1600a8c0@PC52> Message-ID: <469603F5.4050107@resolversystems.com> Anders M. Mikkelsen wrote: > I have some problems getting 'super' working with IronPython. > Running the following simple script: > > class A: > def Foo(self): > pass > > class B(A): > def Foo(self): > super(B, self).Foo() > > B().Foo() > yields: > > TypeError: expected type, got classobj > > Any ideas? Super only works for new-style classes - if you change class A to inherit from object super will work correctly. Classes with no superclass list are created as old-style classes, which have slightly different semantics. In general, all new classes you create should inherit from object, or some other built-in type, so that super, property and __metaclasss__ will work correctly for them. Old-style classes are only really kept for backwards compatibility, and I think they're going away at some version in the future - at which point "class A:" will define a normal new-style class. Cheers, Christian -- Christian Muirhead Resolver Systems christian.muirhead at resolversystems.com Office address: 17a Clerkenwell Road, London EC1M 5RD, UK Registered address: 843 Finchley Road, London NW11 8NA, UK Resolver Systems Limited is registered in England and Wales as company number 5467329. VAT No. GB 893 5643 79 From mclinton at procard.com Thu Jul 12 16:32:04 2007 From: mclinton at procard.com (Matt Clinton) Date: Thu, 12 Jul 2007 08:32:04 -0600 Subject: [IronPython] Kamaelia and IronPython (was: Hosting IronPython 2.Xin .NET app) In-Reply-To: References: Message-ID: <046C79B13A2D204A9FFB87C2EA406CA70239725D@glesexcc03.procard.local> Howdy all, Any thoughts on Kamaelia and ETL? If I understand the concept enough, click-together code-components that act on a data-stream (with flexible concurrency) could be just the thing: replace "video frame" with "data record", and it seems one ends up with high-performance throughput with Pythonic controls. Sweet. Pointers? Problems? -- Matt -------------- next part -------------- An HTML attachment was scrubbed... URL: From mclinton at procard.com Thu Jul 12 18:15:33 2007 From: mclinton at procard.com (Matt Clinton) Date: Thu, 12 Jul 2007 10:15:33 -0600 Subject: [IronPython] Kamaelia ETL - was ([Kamaelia-list] Kamaelia and IronPython) In-Reply-To: <200707121647.02241.ms@cerenity.org> References: <046C79B13A2D204A9FFB87C2EA406CA70239725D@glesexcc03.procard.local> <200707121647.02241.ms@cerenity.org> Message-ID: <046C79B13A2D204A9FFB87C2EA406CA702397312@glesexcc03.procard.local> Michael Sparks said: >>Googling for that acronym, do you mean in ETL in a data processing >>context, ala http://en.wikipedia.org/wiki/Extract,_transform,_load ? Exactly - filling a DB from various sources, QAing the values, etc. >>>... >>I don't see any reason why Kamaelia couldn't be used in that way - >>indeed it sounds like a natural fit. Lovely. Thank you - it seemed so: I wanted to hear if anyone else had thought of it (and where those thoughts went). My current context is through-put for encryption of financial data: avoiding cleartext data-at-rest, with a minimal speed impact while an order of a million records are processed daily. Calling the encryption module as part of a stream seems to be an elegant approach, rather than as a distinct step otherwise. Parallelism is good (fast). The rest of the solution architecture and the team's lack of Python familiarity will likely prevent using Kamaelia directly now (but I'll try), but that's what was in my head prompting the question. I often end up implementing value-add data analysis, and the performance (speed) of doing full pieces discretely often ends up making what could otherwise be a feed into a daily-load batch process. Your techniques could make changing that elegant - there'd be a lot of retooling to change existing products over on the front end, but this would be a sweet way for the back end of news-service style data-slinging to be designed for new products. Thanks! -- Matt From xmlhacker at gmail.com Thu Jul 12 21:01:10 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Thu, 12 Jul 2007 13:01:10 -0600 Subject: [IronPython] [Kamaelia-list] Kamaelia and IronPython (was: Hosting IronPython 2.X in .NET app) In-Reply-To: <200707112303.34240.ms@cerenity.org> References: <200707112303.34240.ms@cerenity.org> Message-ID: On 7/11/07, Michael Sparks wrote: > > On Wednesday 11 July 2007 10:25, M. David Peterson wrote: > > > > File HTTPClient, line unknown, in Initialize > > > > SyntaxError: yield in more than one try blocks > > This is a bug in the IronPython implementation of python's generators - > this > has been legal in python since python 2.2.2. I'm guessing it's a known bug > by > the sounds of things. Yep, I believe so. IronPython team: Are there any known concerns that might keep this from making into the final IP2.0 release? The reason incidentally we focus on compatibility with python 2.2.2 is > because > that also happens to be the version of python ported to Nokia mobile > phones, > and we'd like to retain the option of running Kamaelia on such platforms. > (Having done so in the past and found we can do some fun things as a > result! :) Which leads me to wonder how much of an impact Silverlight/DLR in the mobile device space might have? The notion of decentralized concurrent inbox/outbox operations taking place over, for example, a Kamaelia-based mesh network sounds WAY TOO COOL not to get excited about. Michael: FYI > The Dynamic Language Runtime is what IronPython 2.0 as well as IronRuby, a new JScript.NET implementation, as well as a new language referred to as Dynamic VB are built upon. If not mistaken, once Kamaelia can be run successfully on IronPython 2.0, then all of Kamaelia would be accessible via this same base of languages as well as other DLR-based projects such as Vista Smalltalk/DLR The nice thing about the above code is that it looks pretty linear, but has > the cross platform scalabilty benefits of state machine approach. (which > is > *why* we use generators rather than threads) Nice! I wasn't aware of this until now, but it makes complete sense! -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From xmlhacker at gmail.com Thu Jul 12 21:09:50 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Thu, 12 Jul 2007 13:09:50 -0600 Subject: [IronPython] [Kamaelia-list] Kamaelia and IronPython (was: Hosting IronPython 2.Xin .NET app) In-Reply-To: <200707121647.02241.ms@cerenity.org> References: <046C79B13A2D204A9FFB87C2EA406CA70239725D@glesexcc03.procard.local> <200707121647.02241.ms@cerenity.org> Message-ID: On 7/12/07, Michael Sparks wrote: > > On Thursday 12 July 2007 15:32, Matt Clinton wrote: > > Howdy all, > > > > Any thoughts on Kamaelia and ETL? > > Assuming the ETL page above describes the ETL you're referring to, I don't > see > any reason why Kamaelia couldn't be used in that way - indeed it sounds > like a > natural fit. We haven't written any components that would immediately help > regarding talking to databases, but then we haven't had a need/usecase > which > made doing so worthwhile so far. Writing components to do that however > should > be fairly simple. Hmmm... ETL, Kamaelia and LINQ-based data queries and iterators? That sounds yummy :D Now we just need to to encourage the right_folks at MSFT to build integrated (P)LINQ support into IronPython ;-) :D -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From sh at defuze.org Thu Jul 12 21:23:52 2007 From: sh at defuze.org (Sylvain Hellegouarch) Date: Thu, 12 Jul 2007 20:23:52 +0100 Subject: [IronPython] [Kamaelia-list] Kamaelia and IronPython (was: Hosting IronPython 2.Xin .NET app) In-Reply-To: References: <046C79B13A2D204A9FFB87C2EA406CA70239725D@glesexcc03.procard.local> <200707121647.02241.ms@cerenity.org> Message-ID: <46967FC8.1090007@defuze.org> > > Now we just need to to encourage the right_folks at MSFT to build > integrated (P)LINQ support into IronPython ;-) :D > > That would certainly be a greater incentive to attract a bigger community around IP. - Sylvain From xmlhacker at gmail.com Thu Jul 12 22:25:11 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Thu, 12 Jul 2007 14:25:11 -0600 Subject: [IronPython] [Kamaelia-list] Kamaelia and IronPython (was: Hosting IronPython 2.Xin .NET app) In-Reply-To: <46967FC8.1090007@defuze.org> References: <046C79B13A2D204A9FFB87C2EA406CA70239725D@glesexcc03.procard.local> <200707121647.02241.ms@cerenity.org> <46967FC8.1090007@defuze.org> Message-ID: On 7/12/07, Sylvain Hellegouarch wrote: > > > > > > Now we just need to to encourage the right_folks at MSFT to build > > integrated (P)LINQ support into IronPython ;-) :D > > > > > > That would certainly be a greater incentive to attract a bigger > community around IP. +1 -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From dan.eloff at gmail.com Thu Jul 12 22:48:07 2007 From: dan.eloff at gmail.com (Dan Eloff) Date: Thu, 12 Jul 2007 15:48:07 -0500 Subject: [IronPython] IronPython Logo / Icon In-Reply-To: References: <928de89c0707110240s7c72150ave4707004a37c3ced@mail.gmail.com> <236b92bd0707110337l62be815aja567635730a25232@mail.gmail.com> Message-ID: <4817b6fc0707121348v642b5473k929bb2958b704886@mail.gmail.com> Clever, I like that idea. On 7/11/07, Keith J. Farmer wrote: > > > > > I nominate a grey-colored snake in the shape of the Visual Studio infinity > logo. J > > > > > From: users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] On Behalf Of > Guohui Xiao > Sent: Wednesday, July 11, 2007 3:37 AM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython Logo / Icon > > > > > good idea! > > > On 7/11/07, Stefan Dobrev wrote: > > Hi Guys, > > I had embedded IronPython 2.0 (DLR) in my WPF app. I have also created a > WPF based console similar to the DLRConsole sample shipped with Silverlight > 1.1 SDK. While I also creating a button to toggle the console window I > wanted to put an IronPython (or DLR) image in button content. After > searching the web I did not find any logo nighters for IP, nor for the DLR. > The only thing that I came across is this image from the asp.net site. It > only looks iron-ish, but nothing python like in it :) So my point is why > does someone create a logo for IronPython (or even we can host an open > competition for this :) > > P.S. Something like the Silverlight logo will be cool :) > > Regards, > Stefan Dobrev > > > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > -- > Xiao Guohui > Department of Information Science > Peking University > Beijing, 100871 > CHINA > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > From mclinton at procard.com Fri Jul 13 00:51:15 2007 From: mclinton at procard.com (Matt Clinton) Date: Thu, 12 Jul 2007 16:51:15 -0600 Subject: [IronPython] integrating IronPython as a VS Extension with Team Suite Trial? In-Reply-To: <4817b6fc0707121348v642b5473k929bb2958b704886@mail.gmail.com> References: <928de89c0707110240s7c72150ave4707004a37c3ced@mail.gmail.com><236b92bd0707110337l62be815aja567635730a25232@mail.gmail.com> <4817b6fc0707121348v642b5473k929bb2958b704886@mail.gmail.com> Message-ID: <046C79B13A2D204A9FFB87C2EA406CA702397587@glesexcc03.procard.local> Folks, I'm using: [ Microsoft Visual Studio 2005 Version 8.0.50727.762 (SP.050727-7600) Microsoft .NET Framework Version 2.0.50727 Installed Edition: Enterprise Microsoft Visual Basic 2005 77718-204-0000007-41996 Microsoft Visual Basic 2005 Microsoft Visual C# 2005 77718-204-0000007-41996 Microsoft Visual C# 2005 Microsoft Visual C++ 2005 77718-204-0000007-41996 Microsoft Visual C++ 2005 Microsoft Visual J# 2005 77718-204-0000007-41996 Microsoft Visual J# 2005 Microsoft Visual Studio Tools for Office 77718-204-0000007-41996 Microsoft Visual Studio Tools for the Microsoft Office System Microsoft Visual Web Developer 2005 77718-204-0000007-41996 Microsoft Visual Web Developer 2005 Microsoft Web Application Projects 2005 77718-204-0000007-41996 Microsoft Web Application Projects 2005 Version 8.0.50727.762 Visual Studio 2005 Team Edition for Architects 77718-204-0000007-41996 Microsoft Visual Studio 2005 Team Edition for Software Architects Visual Studio 2005 Team Edition for Developers 77718-204-0000007-41996 Microsoft Visual Studio 2005 Team Edition for Software Developers Visual Studio 2005 Team Edition for Testers 77718-204-0000007-41996 Microsoft Visual Studio 2005 Team Edition for Software Testers Crystal Reports AAC60-G0CSA4B-V7000AY Crystal Reports for Visual Studio 2005 Microsoft Visual Studio 2005 Team Edition for Software Developers - ENU Service Pack 1 (KB926601) This service pack is for Microsoft Visual Studio 2005 Team Edition for Software Developers - ENU. If you later install a more recent service pack, this service pack will be uninstalled automatically. For more information, visit http://support.microsoft.com/kb/926601 SQL Server Analysis Services Microsoft SQL Server Analysis Services Designer Version 9.00.3042.00 SQL Server Integration Services Microsoft SQL Server Integration Services Designer Version 9.00.3042.00 SQL Server Reporting Services Microsoft SQL Server Reporting Services Designers Version 9.00.3042.00 Visual Studio Package Load Analyzer 1.0 A utility that analyzes package load failures in Visual Studio 2005.) ] with the 180-day trial version of Team Suite. I'd like to use IronPython as an integrated language (contextual textcolor, etc.) - "Extension". The only how-to I've seen for that said "run the Sample build in the SDK". When I do that, I get a new instance of Visual Studio that has IronPython, but no longer has access to the Team Studio for Testers components. When I close them all and re-launch, I don't have IronPython as an Extension. Would someone please point me to an instruction set, so I can add IP as an Extension without losing access to the Trial Team Suite for Testers? (I'm trying to use Load tools to show IP performance to some of the other developers). Thanks, -- Matt From dan.eloff at gmail.com Fri Jul 13 04:09:40 2007 From: dan.eloff at gmail.com (Dan Eloff) Date: Thu, 12 Jul 2007 21:09:40 -0500 Subject: [IronPython] integrating IronPython as a VS Extension with Team Suite Trial? In-Reply-To: <046C79B13A2D204A9FFB87C2EA406CA702397587@glesexcc03.procard.local> References: <928de89c0707110240s7c72150ave4707004a37c3ced@mail.gmail.com> <236b92bd0707110337l62be815aja567635730a25232@mail.gmail.com> <4817b6fc0707121348v642b5473k929bb2958b704886@mail.gmail.com> <046C79B13A2D204A9FFB87C2EA406CA702397587@glesexcc03.procard.local> Message-ID: <4817b6fc0707121909i1e11b326pc23ad3986454f349@mail.gmail.com> Well you can get IronPython back by launching Visual Studio with the experimental hive (check shortcuts under the SDK install.) Not sure about the testers components, hopefully someone else here can help with that. -Dan From tesco.chainstore.massacre at gmail.com Fri Jul 13 06:36:56 2007 From: tesco.chainstore.massacre at gmail.com (googen) Date: Thu, 12 Jul 2007 21:36:56 -0700 (PDT) Subject: [IronPython] PythonEngine no constructors defined Message-ID: <11571182.post@talk.nabble.com> Hello, I am trying to run a python script via a VC# project, purely to create an exe for my application. But I am having a problem building every example I have found. It does not help that I have no idea about C#. Any help would be greatly appreciated, as I would love to have an exe to pass to my friends with my application, and a google on this shows nothing. The code I tryed last is using System; using System.Collections; using System.Collections.Generic; using System.IO; using IronPython.Hosting; using IronPython.Runtime; namespace Payper { class Class1 { static IronPython.Hosting.PythonEngine Py; [STAThread] static void Main(String[] rawArgs) { Py = new PythonEngine(); Py.AddToPath(Environment.CurrentDirectory); Py.ExecuteFile("Payper.py"); } } } When I try to build this, or any other example I have followed I get the following error... The type 'IronPython.Hosting.PythonEngine' has no constructors defined So what am i missing?, or does anybody know another way of creating an exe from ironpython? Thanks in advance googen. -- View this message in context: http://www.nabble.com/PythonEngine-no-constructors-defined-tf4071594.html#a11571182 Sent from the IronPython mailing list archive at Nabble.com. From sh at defuze.org Fri Jul 13 09:03:20 2007 From: sh at defuze.org (Sylvain Hellegouarch) Date: Fri, 13 Jul 2007 08:03:20 +0100 Subject: [IronPython] PythonEngine no constructors defined In-Reply-To: <11571182.post@talk.nabble.com> References: <11571182.post@talk.nabble.com> Message-ID: <469723B8.9060500@defuze.org> If you are using IP2 you should go with: PythonEngine _engine = PythonEngine.CurrentEngine; - Sylvain googen a ?crit : > Hello, I am trying to run a python script via a VC# project, purely to create > an exe for my application. But I am having a problem > building every example I have found. It does not help that I have no idea > about C#. Any help would be greatly appreciated, as I would love to > have an exe to pass to my friends with my application, and a google on this > shows nothing. The code I tryed last is > > using System; > using System.Collections; > using System.Collections.Generic; > using System.IO; > using IronPython.Hosting; > using IronPython.Runtime; > > namespace Payper > { > class Class1 > { > static IronPython.Hosting.PythonEngine Py; > > [STAThread] > static void Main(String[] rawArgs) > { > Py = new PythonEngine(); > Py.AddToPath(Environment.CurrentDirectory); > Py.ExecuteFile("Payper.py"); > } > } > } > > When I try to build this, or any other example I have followed I get the > following error... > > The type 'IronPython.Hosting.PythonEngine' has no constructors defined > > So what am i missing?, or does anybody know another way of creating an exe > from ironpython? > > Thanks in advance > > googen. > From tesco.chainstore.massacre at gmail.com Fri Jul 13 09:52:03 2007 From: tesco.chainstore.massacre at gmail.com (googen) Date: Fri, 13 Jul 2007 00:52:03 -0700 (PDT) Subject: [IronPython] PythonEngine no constructors defined In-Reply-To: <469723B8.9060500@defuze.org> References: <11571182.post@talk.nabble.com> <469723B8.9060500@defuze.org> Message-ID: <11574922.post@talk.nabble.com> Thanks very much, worked brilliantly :) Sylvain Hellegouarch wrote: > > If you are using IP2 you should go with: > > PythonEngine _engine = PythonEngine.CurrentEngine; > > - Sylvain > > googen a ?crit : >> Hello, I am trying to run a python script via a VC# project, purely to >> create >> an exe for my application. But I am having a problem >> building every example I have found. It does not help that I have no idea >> about C#. Any help would be greatly appreciated, as I would love to >> have an exe to pass to my friends with my application, and a google on >> this >> shows nothing. The code I tryed last is >> >> using System; >> using System.Collections; >> using System.Collections.Generic; >> using System.IO; >> using IronPython.Hosting; >> using IronPython.Runtime; >> >> namespace Payper >> { >> class Class1 >> { >> static IronPython.Hosting.PythonEngine Py; >> >> [STAThread] >> static void Main(String[] rawArgs) >> { >> Py = new PythonEngine(); >> Py.AddToPath(Environment.CurrentDirectory); >> Py.ExecuteFile("Payper.py"); >> } >> } >> } >> >> When I try to build this, or any other example I have followed I get the >> following error... >> >> The type 'IronPython.Hosting.PythonEngine' has no constructors defined >> >> So what am i missing?, or does anybody know another way of creating an >> exe >> from ironpython? >> >> Thanks in advance >> >> googen. >> > > _______________________________________________ > 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/PythonEngine-no-constructors-defined-tf4071594.html#a11574922 Sent from the IronPython mailing list archive at Nabble.com. From mclinton at procard.com Fri Jul 13 18:31:08 2007 From: mclinton at procard.com (Matt Clinton) Date: Fri, 13 Jul 2007 10:31:08 -0600 Subject: [IronPython] integrating IronPython as a VS Extension with TeamSuite Trial? In-Reply-To: <4817b6fc0707121909i1e11b326pc23ad3986454f349@mail.gmail.com> References: <928de89c0707110240s7c72150ave4707004a37c3ced@mail.gmail.com><236b92bd0707110337l62be815aja567635730a25232@mail.gmail.com><4817b6fc0707121348v642b5473k929bb2958b704886@mail.gmail.com><046C79B13A2D204A9FFB87C2EA406CA702397587@glesexcc03.procard.local> <4817b6fc0707121909i1e11b326pc23ad3986454f349@mail.gmail.com> Message-ID: <046C79B13A2D204A9FFB87C2EA406CA7023976A8@glesexcc03.procard.local> Thanks Dan. Yep - IP is live in the experimental hive. Can anyone please suggest where to start to understand why the Team Studio tools in that hive have only the Developer set, not Tester (nor Architect, etc.)? Again, those are from the trial edition, if that's relevant. Alternately, can IP Extentions be added to the main hive instead? Trying to Evangelize my shop, -- Matt >>>: Well you can get IronPython back by launching Visual Studio with the experimental hive (check shortcuts under the SDK install.) Not sure about the testers components, hopefully someone else here can help with that. -Dan From dinov at exchange.microsoft.com Fri Jul 13 21:21:38 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Fri, 13 Jul 2007 12:21:38 -0700 Subject: [IronPython] Problem with super In-Reply-To: <000c01c7c45b$0ffaa120$1600a8c0@PC52> References: <000c01c7c45b$0ffaa120$1600a8c0@PC52> Message-ID: <7AD436E4270DD54A94238001769C2227B797455943@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Super works w/ new-style classes so if you change it to: class A(object): def Foo(self): pass class B(A): def Foo(self): super(B, self).Foo() B().Foo() It'll work. CPython behaves the same way: Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> class A: ... def Foo(self): ... pass ... >>> class B(A): ... def Foo(self): ... super(B, self).Foo() ... >>> B().Foo() Traceback (most recent call last): File "", line 1, in File "", line 3, in Foo TypeError: super() argument 1 must be type, not classobj >>> From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Anders M. Mikkelsen Sent: Thursday, July 12, 2007 1:03 AM To: Discussion of IronPython Subject: [IronPython] Problem with super Hi I have some problems getting 'super' working with IronPython. Running the following simple script: class A: def Foo(self): pass class B(A): def Foo(self): super(B, self).Foo() B().Foo() yields: TypeError: expected type, got classobj Any ideas? /anders -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Fri Jul 13 23:07:47 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Fri, 13 Jul 2007 14:07:47 -0700 Subject: [IronPython] Problem with super In-Reply-To: <7AD436E4270DD54A94238001769C2227B797455943@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <000c01c7c45b$0ffaa120$1600a8c0@PC52> <7AD436E4270DD54A94238001769C2227B797455943@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <7AD436E4270DD54A94238001769C2227B797455985@DF-GRTDANE-MSG.exchange.corp.microsoft.com> If anyone is curious why I responded after this was already answered - we were having some network problems. Please ignore :). From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Friday, July 13, 2007 12:22 PM To: Discussion of IronPython Subject: Re: [IronPython] Problem with super Super works w/ new-style classes so if you change it to: class A(object): def Foo(self): pass class B(A): def Foo(self): super(B, self).Foo() B().Foo() It'll work. CPython behaves the same way: Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> class A: ... def Foo(self): ... pass ... >>> class B(A): ... def Foo(self): ... super(B, self).Foo() ... >>> B().Foo() Traceback (most recent call last): File "", line 1, in File "", line 3, in Foo TypeError: super() argument 1 must be type, not classobj >>> From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Anders M. Mikkelsen Sent: Thursday, July 12, 2007 1:03 AM To: Discussion of IronPython Subject: [IronPython] Problem with super Hi I have some problems getting 'super' working with IronPython. Running the following simple script: class A: def Foo(self): pass class B(A): def Foo(self): super(B, self).Foo() B().Foo() yields: TypeError: expected type, got classobj Any ideas? /anders -------------- next part -------------- An HTML attachment was scrubbed... URL: From idmkid at yahoo.com Sat Jul 14 17:59:47 2007 From: idmkid at yahoo.com (David Seruyange) Date: Sat, 14 Jul 2007 08:59:47 -0700 (PDT) Subject: [IronPython] dir and urllib (utter newbie questions) Message-ID: <820261.579.qm@web30812.mail.mud.yahoo.com> I'm very new to Python and had a few questions. Does dir() only work from the ipy interpreter? If I attempt the following: >>> from System import * >>> dir() It sucesssfully prints everything available but when I try the two lines of code from a script and run: ipy test.py Nothing prints. One more question: does urllib come with Iron Python? I'm aware that I can use .NET classes such as System.Net.WebClient but I guess I was trying to be pythonic. Thanks much, David ____________________________________________________________________________________ Pinpoint customers who are looking for what you sell. http://searchmarketing.yahoo.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From curt at hagenlocher.org Sat Jul 14 18:09:44 2007 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Sat, 14 Jul 2007 09:09:44 -0700 Subject: [IronPython] dir and urllib (utter newbie questions) In-Reply-To: <820261.579.qm@web30812.mail.mud.yahoo.com> References: <820261.579.qm@web30812.mail.mud.yahoo.com> Message-ID: On 7/14/07, David Seruyange wrote: > > I'm very new to Python and had a few questions. Does dir() only work from > the ipy interpreter? If I attempt the following: > > >>> from System import * > >>> dir() > > It sucesssfully prints everything available but when I try the two lines > of code from a script and run: > > ipy test.py > > Nothing prints. > That's because dir() doesn't print anything. It merely returns a list of values that the interpreter prints. When you run it from the file, there isn't a command line interpreter printing the results of any expressions. If you said "print dir()" instead of just "dir()", your program would do what you expect. One more question: does urllib come with Iron Python? > None of the standard Python library comes with IronPython, but the intent for IronPython is that it should support the standard Python library, so you could just download CPython and try to use it. Alternatively, check out http://fepy.sourceforge.net/ as a one-stop-shop. -- Curt Hagenlocher curt at hagenlocher.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From tesco.chainstore.massacre at gmail.com Sat Jul 14 21:39:34 2007 From: tesco.chainstore.massacre at gmail.com (googen) Date: Sat, 14 Jul 2007 12:39:34 -0700 (PDT) Subject: [IronPython] PythonEngine no constructors defined In-Reply-To: <11574922.post@talk.nabble.com> References: <11571182.post@talk.nabble.com> <469723B8.9060500@defuze.org> <11574922.post@talk.nabble.com> Message-ID: <11596644.post@talk.nabble.com> When i say it worked brilliantly, what i meant was it compiled lol. the executable runs, but does obviously not run my python file. I really could do with a link to a recent article on this method, is there any? i have googled with no luck. googen wrote: > > Thanks very much, worked brilliantly :) > > > > Sylvain Hellegouarch wrote: >> >> If you are using IP2 you should go with: >> >> PythonEngine _engine = PythonEngine.CurrentEngine; >> >> - Sylvain >> >> googen a ?crit : >>> Hello, I am trying to run a python script via a VC# project, purely to >>> create >>> an exe for my application. But I am having a problem >>> building every example I have found. It does not help that I have no >>> idea >>> about C#. Any help would be greatly appreciated, as I would love to >>> have an exe to pass to my friends with my application, and a google on >>> this >>> shows nothing. The code I tryed last is >>> >>> using System; >>> using System.Collections; >>> using System.Collections.Generic; >>> using System.IO; >>> using IronPython.Hosting; >>> using IronPython.Runtime; >>> >>> namespace Payper >>> { >>> class Class1 >>> { >>> static IronPython.Hosting.PythonEngine Py; >>> >>> [STAThread] >>> static void Main(String[] rawArgs) >>> { >>> Py = new PythonEngine(); >>> Py.AddToPath(Environment.CurrentDirectory); >>> Py.ExecuteFile("Payper.py"); >>> } >>> } >>> } >>> >>> When I try to build this, or any other example I have followed I get the >>> following error... >>> >>> The type 'IronPython.Hosting.PythonEngine' has no constructors defined >>> >>> So what am i missing?, or does anybody know another way of creating an >>> exe >>> from ironpython? >>> >>> Thanks in advance >>> >>> googen. >>> >> >> _______________________________________________ >> 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/PythonEngine-no-constructors-defined-tf4071594.html#a11596644 Sent from the IronPython mailing list archive at Nabble.com. From fuzzyman at voidspace.org.uk Sun Jul 15 11:24:03 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sun, 15 Jul 2007 10:24:03 +0100 Subject: [IronPython] Hosting IronPython 2.X in .NET app In-Reply-To: <785694cd0707061929k69cb9a77nb1fbf02f7b400424@mail.gmail.com> References: <5f040ba90707061243h5f68955fn37facf86b0355bdb@mail.gmail.com> <785694cd0707061929k69cb9a77nb1fbf02f7b400424@mail.gmail.com> Message-ID: <4699E7B3.8060508@voidspace.org.uk> JoeSox wrote: > On 7/6/07, Chris Parnin wrote: > >> I've seen several examples of how to embed IronPython 1.X in .NET. >> (e.g. IronTextBox) However, the architecture has changed greatly with >> 2.X. Does anyone have a good example or pointers on hosting an >> interactive IronPython session in a .NET app? >> > > One of the reasons why I haven't updated IronTextBox is that > IronPython 2 is in Alpha. I decided to wait until it was Beta. I am eagerly awaiting both the next release of IronPython 2 and a version of IronTextBox that supports it. :-) > On > top of that, Python is set for a major version upgrade soon, so I > don't know how this will effect IronPython's development. I am > wondering if others are thinking the same? > If you mean Python 3... I wouldn't worry about it. Python 3 won't be in Beta until next year, and probably the middle of next year. It won't be the 'standard' version of Python for at least a couple of years and possibly more... Michael Foord http://www.voidspace.org.uk/ironpython/index.shtml From xmlhacker at gmail.com Sun Jul 15 20:28:11 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Sun, 15 Jul 2007 12:28:11 -0600 Subject: [IronPython] Compatibility of cPython Pickled Objects w/ IronPython Message-ID: As per the subject line, is there any reason why passing pickled objects between cPython and IronPython wouldn't just work? Of course I could just try and find out, but I hesitate to jump into unchartered territory as (and I assume I am not alone in this) I have a tendency to become infatuated with forcing things into submission when they don't "just work", eating away an entire dev day or two in the process. Anyone care to help a brother save a couple dev days and a few strands of hair? :D Thanks in advance! -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Sun Jul 15 20:33:05 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sun, 15 Jul 2007 19:33:05 +0100 Subject: [IronPython] Compatibility of cPython Pickled Objects w/ IronPython In-Reply-To: References: Message-ID: <469A6861.7040006@voidspace.org.uk> M. David Peterson wrote: > As per the subject line, is there any reason why passing pickled > objects between cPython and IronPython wouldn't just work? Of course I > could just try and find out, but I hesitate to jump into unchartered > territory as (and I assume I am not alone in this) I have a tendency > to become infatuated with forcing things into submission when they > don't "just work", eating away an entire dev day or two in the process. > > Anyone care to help a brother save a couple dev days and a few strands > of hair? :D > > Thanks in advance! I haven't tried it, but they *should* be compatible. Pickle uses its own stack based language to write out objects - so for pure Python it should work fine. As pickle is a pure Python module which works (I'm pretty sure I tried it back in the past !?!) with IronPython, the semantics should be unchanged. Michael Foord http://www.voidspace.org.uk/ironpython/index.shtml > > -- > /M:D > > M. David Peterson > http://mdavid.name | > http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 > ------------------------------------------------------------------------ > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From xmlhacker at gmail.com Sun Jul 15 20:44:17 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Sun, 15 Jul 2007 12:44:17 -0600 Subject: [IronPython] Compatibility of cPython Pickled Objects w/ IronPython In-Reply-To: <469A6861.7040006@voidspace.org.uk> References: <469A6861.7040006@voidspace.org.uk> Message-ID: Thanks for the lightning fast response, Michael! On 7/15/07, Michael Foord wrote: > > I haven't tried it, but they *should* be compatible. Pickle uses its own > stack based language to write out objects - so for pure Python it should > work fine. Okay, cool. I'll give it a try. As pickle is a pure Python module which works (I'm pretty sure I tried > it back in the past !?!) with IronPython, the semantics should be > unchanged. Right on. I'll let you know what I discover. Just to give you some background, Sylvain and I are looking at using memcached and pickled Python objects as a form of InterProcess Communication between cPython and .NET via IronPython. If that works as it should, we then plan to look into adding Axon/Kamaelia to the mix to handle the concurrency aspect of passing around data objects between disparate systems. For the curious, I will update this thread once the first part is working properly. Thanks for your help! -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy.tao at freeborders.com.cn Mon Jul 16 09:37:41 2007 From: andy.tao at freeborders.com.cn (=?gb2312?B?zNXX5rrp?=) Date: Mon, 16 Jul 2007 15:37:41 +0800 Subject: [IronPython] Bug report Message-ID: <000001c7c77c$3155d7d0$3069a8c0@china.freeborders> Hi Dino, I met a IronPython bug, does this bug has been reported? IronPython 1.1 (1.1) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import sys >>> sys.path.append("c:\\bin") >>> sys.path ['D:\\Python\\IronPython', 'D:\\Python\\IronPython\\Lib', 'c:\\bin'] >>> sys.path.append("c:\windows") >>> sys.path ['D:\\Python\\IronPython', 'D:\\Python\\IronPython\\Lib', 'c:\\bin', 'c:\\windows'] >>> sys.path.append("c:\windows\bin") >>> sys.path ['D:\\Python\\IronPython', 'D:\\Python\\IronPython\\Lib', 'c:\\bin', 'c:\\windows', 'c:\\windows\x08in'] >>> Andy.Tao -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.dahlbacka at gmail.com Mon Jul 16 09:57:08 2007 From: simon.dahlbacka at gmail.com (Simon Dahlbacka) Date: Mon, 16 Jul 2007 10:57:08 +0300 Subject: [IronPython] Bug report In-Reply-To: <000001c7c77c$3155d7d0$3069a8c0@china.freeborders> References: <000001c7c77c$3155d7d0$3069a8c0@china.freeborders> Message-ID: <57124720707160057y5fb134fkfdfb6fba95b5a244@mail.gmail.com> That's not a bug.. backslash is an escape character and \b happens to be the escape sequence for the bell character. You either need to escape the backslashes (with another backslash) or use raw strings e.g. "c:\\windows\\bin" r"c:\windows\bin" /Simon ps. who is adding a bin folder under c:\windows, that doesn't sound like the greatest idea.. ? ..or was it just a "random" name for demo purposes? On 7/16/07, ??? wrote: > > Hi Dino, I met a IronPython bug, does this bug has been reported? > > IronPython 1.1 (1.1) on .NET 2.0.50727.42 Copyright (c) Microsoft > Corporation. All rights reserved. > >>> import sys > >>> sys.path.append("c:\\bin") > >>> sys.path > ['D:\\Python\\IronPython', 'D:\\Python\\IronPython\\Lib', 'c:\\bin'] > >>> sys.path.append("c:\windows") > >>> sys.path > ['D:\\Python\\IronPython', 'D:\\Python\\IronPython\\Lib', 'c:\\bin', > 'c:\\windows'] > >>> sys.path.append("c:\windows\bin") > >>> sys.path > ['D:\\Python\\IronPython', 'D:\\Python\\IronPython\\Lib', 'c:\\bin', > 'c:\\windows', 'c:\\windows\x08in'] > >>> > > > Andy.Tao > > _______________________________________________ > 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 simon.dahlbacka at gmail.com Mon Jul 16 12:42:16 2007 From: simon.dahlbacka at gmail.com (Simon Dahlbacka) Date: Mon, 16 Jul 2007 13:42:16 +0300 Subject: [IronPython] Bug report In-Reply-To: <000301c7c787$bfcb1ba0$3069a8c0@china.freeborders> References: <000001c7c77c$3155d7d0$3069a8c0@china.freeborders> <57124720707160057y5fb134fkfdfb6fba95b5a244@mail.gmail.com> <000301c7c787$bfcb1ba0$3069a8c0@china.freeborders> Message-ID: <57124720707160342q43ea4482l1f75ca31a88f3a0f@mail.gmail.com> On 7/16/07, ??? wrote: > > Yes, it just a demo path, not a real path, :-) > > But when I use capital character, it work well, please see follow example: > yes of course, since \B isn't a recognized escape sequence (nor is \w)... (case sensitivity you know...) /S IronPython 1.1 (1.1) on .NET 2.0.50727.42 > Copyright (c) Microsoft Corporation. All rights reserved. > >>> import sys > >>> sys.path.append("c:\\bin") > >>> sys.path > ['D:\\Python\\IronPython', 'D:\\Python\\IronPython\\Lib', 'c:\\bin'] > >>> sys.path.append("c:\windows") > >>> sys.path > ['D:\\Python\\IronPython', 'D:\\Python\\IronPython\\Lib', 'c:\\bin', > 'c:\\windows'] > >>> sys.path.append("c:\windows\bin") > >>> sys.path > ['D:\\Python\\IronPython', 'D:\\Python\\IronPython\\Lib', 'c:\\bin', > 'c:\\windows', 'c:\\windows\x08in'] > >>> sys.path.append("c:\windows\Bin") > >>> sys.path > ['D:\\Python\\IronPython', 'D:\\Python\\IronPython\\Lib', 'c:\\bin', > 'c:\\windows', 'c:\\windows\x08in', 'c:\\windows\\Bin'] > >>> > > ------------------------------ > *From:* Simon Dahlbacka [mailto:simon.dahlbacka at gmail.com] > *Sent:* Monday, July 16, 2007 15:57 > *To:* andy.tao at freeborders.com.cn; Discussion of IronPython > *Subject:* Re: [IronPython] Bug report > > That's not a bug.. > > backslash is an escape character and \b happens to be the escape sequence > for the bell character. > You either need to escape the backslashes (with another backslash) or use > raw strings > > e.g. > "c:\\windows\\bin" > r"c:\windows\bin" > > /Simon > > ps. who is adding a bin folder under c:\windows, that doesn't sound like > the greatest idea.. ? ..or was it just a "random" name for demo purposes? > > > On 7/16/07, ??? wrote: > > > > Hi Dino, I met a IronPython bug, does this bug has been reported? > > > > IronPython 1.1 (1.1) on .NET 2.0.50727.42 Copyright (c) Microsoft > > Corporation. All rights reserved. > > >>> import sys > > >>> sys.path.append("c:\\bin") > > >>> sys.path > > ['D:\\Python\\IronPython', 'D:\\Python\\IronPython\\Lib', 'c:\\bin'] > > >>> sys.path.append("c:\windows") > > >>> sys.path > > ['D:\\Python\\IronPython', 'D:\\Python\\IronPython\\Lib', 'c:\\bin', > > 'c:\\windows'] > > >>> sys.path.append("c:\windows\bin") > > >>> sys.path > > ['D:\\Python\\IronPython', 'D:\\Python\\IronPython\\Lib', 'c:\\bin', > > 'c:\\windows', 'c:\\windows\x08in'] > > >>> > > > > > > Andy.Tao > > > > _______________________________________________ > > 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 arman at twinsun.com Tue Jul 17 00:03:29 2007 From: arman at twinsun.com (Arman Bostani) Date: Mon, 16 Jul 2007 15:03:29 -0700 Subject: [IronPython] IronPython 2.0A2 performance problems Message-ID: <469BEB31.6090100@twinsun.com> The following code runs about 13 times slower with version 2.0A2 than 1.1! -arman import System d = System.Collections.SortedList() t = System.DateTime.Now for k in xrange(100000): d[k] = k print 'SortedList time', (System.DateTime.Now - t).Ticks/100000 From jon at jcosby.com Tue Jul 17 05:40:37 2007 From: jon at jcosby.com (Jon Cosby) Date: Mon, 16 Jul 2007 20:40:37 -0700 Subject: [IronPython] Perl to Python Message-ID: <469C3A35.7020009@jcosby.com> Has anyone ever converted Perl code to Python or CSharp? Not knowing Perl is it even worth the undertaking? Jon Cosby From joe at notcharles.ca Tue Jul 17 06:08:21 2007 From: joe at notcharles.ca (Joe Mason) Date: Tue, 17 Jul 2007 00:08:21 -0400 Subject: [IronPython] Perl to Python In-Reply-To: <469C3A35.7020009@jcosby.com> References: <469C3A35.7020009@jcosby.com> Message-ID: Depends entirely on the complexity of the Perl code. For simple scripts that I've had to make changes to, I've definitely found it easier to run through it once to convert the entire thing to Python, because the mental space you're in when converting code is very different from the one you're in when thinking about how to design it. If I have to stop at every step to puzzle out how to do something in Perl, it really slows me down, but figuring out what a bit of Perl code means and how it should be expressed in Python isn't so bad. On 7/16/07, Jon Cosby wrote: > > Has anyone ever converted Perl code to Python or CSharp? Not knowing > Perl is it even worth the undertaking? > > > Jon Cosby > _______________________________________________ > 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 iaincartwright at kromestudios.com Tue Jul 17 07:45:17 2007 From: iaincartwright at kromestudios.com (Iain Cartwright) Date: Tue, 17 Jul 2007 15:45:17 +1000 Subject: [IronPython] how do i get the ScriptModule for __main__ Message-ID: <469C576D.9000103@kromestudios.com> I have built a C# class library based on RichTextBox as a drop-in ironpython (2.0A2) console for windows forms apps. I would like to access the __main__ module from my C# code via an IScriptModule but i cannot find a way to do this. I have a ScriptModule that represents the host applications object model created thus: _pyEngine.CreateModule("ObjectModel", appObjectModel, ModuleOptions.PublishModule); I tried to retrieve __main__ through the PythonEngine.DefaultModuleContext and through: ScriptDomainManager.CurrentManager.TryGetScriptModule("__main__", out _moduleMain); but no luck. I'm sure I'm missing something obvious - any ideas? Thanks iain -- _____________________________________ iain cartwright Technical Director Krome Studios Melbourne Phone: +61 3 9867 0753 Fax: +61 3 9867 0800 This message and its attachments may contain legally privileged or confidential information. This message is intended for the use of the individual or entity to which it is addressed. If you are not the addressee indicated in this message, or the employee or agent responsible for delivering the message to the intended recipient, you may not copy or deliver this message or its attachments to anyone. Rather, you should permanently delete this message and its attachments and kindly notify the sender by reply e-mail. Any content of this message and its attachments, which does not relate to the official business of the sending company must be taken not to have been sent or endorsed by the sending company or any of its related entities. No warranty is made that the e-mail or attachment(s) are free from computer virus or other defect. From realn2s at googlemail.com Tue Jul 17 11:09:48 2007 From: realn2s at googlemail.com (C L) Date: Tue, 17 Jul 2007 11:09:48 +0200 Subject: [IronPython] IronPython Start-up Time Message-ID: <81bb01120707170209ga1788b7g5d2be4a628065b22@mail.gmail.com> Hello, playing around a bit with IronPython I noticed that the start-up time is quite long Something around ~12s for the initial launch and around ~3,5s for each following launch executing ---- import sys sys.exit(0) ---- with IronPython-2.0A2\ipy.exe (on a Core Duo 2Ghz 2GB) I am not complaining, just curious. Is this simply because loading the CLR/DLR takes so much time? And what is with the 3.5s for successive start-ups? For comparison CPython needs ~2s for the initial and ~0.2s for successive start-ups. Regards, Claudius Btw I used the simple C++ program ---- // Compile with // cl /Feuxtime.exe /EHsc uxtime.cpp // // uxtime.exe "PATH_TO_IronPython\ipy.exe simplyExit.py" // #include #include #include int main( int argc, char**argv) { int c_start = clock(); system( argv[1]); int c_end = clock(); printf("%d\n", ((double)(c_end - c_start)) / CLOCKS_PER_SEC ); } ---- -------------- next part -------------- An HTML attachment was scrubbed... URL: From stefan.dobrev at gmail.com Tue Jul 17 11:16:35 2007 From: stefan.dobrev at gmail.com (Stefan Dobrev) Date: Tue, 17 Jul 2007 12:16:35 +0300 Subject: [IronPython] how do i get the ScriptModule for __main__ In-Reply-To: <469C576D.9000103@kromestudios.com> References: <469C576D.9000103@kromestudios.com> Message-ID: <928de89c0707170216y414d968cqbf085d8cac8f1cd0@mail.gmail.com> You have to create the current main module with: ScriptDomainManager.CurrentManager.CreateModule( "__main__" ); Hope this helps, Stefan Dobrev 2007/7/17, Iain Cartwright : > > I have built a C# class library based on RichTextBox as a drop-in > ironpython (2.0A2) console for windows forms apps. > > I would like to access the __main__ module from my C# code via an > IScriptModule but i cannot find a way to do this. > > I have a ScriptModule that represents the host applications object model > created thus: > > _pyEngine.CreateModule("ObjectModel", appObjectModel, > ModuleOptions.PublishModule); > > I tried to retrieve __main__ through the > PythonEngine.DefaultModuleContext and through: > > ScriptDomainManager.CurrentManager.TryGetScriptModule("__main__", out > _moduleMain); > > but no luck. I'm sure I'm missing something obvious - any ideas? > > Thanks > > iain > > -- > _____________________________________ > iain cartwright > Technical Director > Krome Studios Melbourne > Phone: +61 3 9867 0753 > Fax: +61 3 9867 0800 > > > > > This message and its attachments may contain legally privileged or > confidential information. This message is intended for the use of the > individual or entity to which it is addressed. If you are not the addressee > indicated in this message, or the employee or agent responsible for > delivering the message to the intended recipient, you may not copy or > deliver this message or its attachments to anyone. Rather, you should > permanently delete this message and its attachments and kindly notify the > sender by reply e-mail. Any content of this message and its attachments, > which does not relate to the official business of the sending company must > be taken not to have been sent or endorsed by the sending company or any of > its related entities. No warranty is made that the e-mail or attachment(s) > are free from computer virus or other defect. > > _______________________________________________ > 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 Tue Jul 17 18:08:35 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 17 Jul 2007 09:08:35 -0700 Subject: [IronPython] Zero-length regex split In-Reply-To: <5b0248170707112027l7f55c895re3b47ea59a6a9e13@mail.gmail.com> References: <5b0248170707112027l7f55c895re3b47ea59a6a9e13@mail.gmail.com> Message-ID: <7AD436E4270DD54A94238001769C2227B797455CB3@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Thanks for the report Seo. I've filed bug #11759 (http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=11759). Could you vote on this? Given that there's no real work around I'd like to make sure this one stays on our radar. Thanks! -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Sanghyeon Seo Sent: Wednesday, July 11, 2007 8:28 PM To: Discussion of IronPython Subject: [IronPython] Zero-length regex split This sucks. I'm not sure which sucks more: that such code exists, or that it breaks on IronPython in hard-to-find manner. import re print re.split(':*', 'a:b::c') Quick workaround is to replace the pattern ':*' with ':+'. This may not be always possible. -- Seo Sanghyeon _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Tue Jul 17 18:11:12 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 17 Jul 2007 09:11:12 -0700 Subject: [IronPython] Getting attribute of new-style bound methods overriding built-in types In-Reply-To: <5b0248170707112021x7188684eqefb36d77bb4b748b@mail.gmail.com> References: <5b0248170707112021x7188684eqefb36d77bb4b748b@mail.gmail.com> Message-ID: <7AD436E4270DD54A94238001769C2227B797455CB4@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Thanks for the report Seo. I've opened bug #11760 (http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=11760). Strangely in v2.0 on Windows this works for me but I think it's because you choose __str__ and we end up finding it in Method instead of hitting the class. This one is actually fairly easy to fix (we just need to go to Ops.GetAttr instead of doing the direct cast to PythonFunction). That makes it a great candidate for including in a future v1.x release as well as v2.0. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Sanghyeon Seo Sent: Wednesday, July 11, 2007 8:22 PM To: Discussion of IronPython Subject: [IronPython] Getting attribute of new-style bound methods overriding built-in types That was mouthful. This is for 1.1. (Running the following code on 2.0a2/Mono dies inside System.Reflection.Emit. Ugh.) class C(object): def __str__(self): return 'C' obj = C() getattr(obj.__str__, 'attribute', None) Result: TypeError: Cannot cast from source type to destination type. This is InvalidCastException. IronPython/Runtime/calls/Function.cs has this comment on line 906: public sealed partial class Method (snip) { //??? can I type this to Function private object func; Apparently you can't... The error is thrown when you cast func to PythonFunction, I think. -- Seo Sanghyeon _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Tue Jul 17 18:21:18 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 17 Jul 2007 09:21:18 -0700 Subject: [IronPython] IronPython Start-up Time In-Reply-To: <81bb01120707170209ga1788b7g5d2be4a628065b22@mail.gmail.com> References: <81bb01120707170209ga1788b7g5d2be4a628065b22@mail.gmail.com> Message-ID: <7AD436E4270DD54A94238001769C2227B797455CBA@DF-GRTDANE-MSG.exchange.corp.microsoft.com> It's a great time to bring this up because I'm currently investigating various start-up time issues and trying to improve our startup time. I'll give you a breakdown of what I've discovered so far: Various reflection that we do over types: This includes over modules (SystemState, built-ins, re, etc...) Over types for creating "DynamicType"s: object, string, PythonFile, etc... - these are the types we need to startup and display the logo. JITing methods: Not on hello world, but on a more complex scenario, I know we JIT 2500 methods on startup on the desktop CLR (this is loading the Python version of the chess API shown at MIX - but not actually running it). Obviously that's going to take some time too. W/o an ngen's mscorlib we'll JIT something like 4000 methods. There's also some little things here and there but my numbers show JITing is representing around 70% of our startup time. Being as fast as CPython might be tough but we certainly want to do better than where we are. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of C L Sent: Tuesday, July 17, 2007 2:10 AM To: users at lists.ironpython.com Subject: [IronPython] IronPython Start-up Time Hello, playing around a bit with IronPython I noticed that the start-up time is quite long Something around ~12s for the initial launch and around ~3,5s for each following launch executing ---- import sys sys.exit(0) ---- with IronPython-2.0A2\ipy.exe (on a Core Duo 2Ghz 2GB) I am not complaining, just curious. Is this simply because loading the CLR/DLR takes so much time? And what is with the 3.5s for successive start-ups? For comparison CPython needs ~2s for the initial and ~0.2s for successive start-ups. Regards, Claudius Btw I used the simple C++ program ---- // Compile with // cl /Feuxtime.exe /EHsc uxtime.cpp // // uxtime.exe "PATH_TO_IronPython\ipy.exe simplyExit.py" // #include #include #include int main( int argc, char**argv) { int c_start = clock(); system( argv[1]); int c_end = clock(); printf("%d\n", ((double)(c_end - c_start)) / CLOCKS_PER_SEC ); } ---- -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Tue Jul 17 18:25:25 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 17 Jul 2007 09:25:25 -0700 Subject: [IronPython] [Kamaelia-list] Kamaelia and IronPython (was: Hosting IronPython 2.X in .NET app) In-Reply-To: References: <200707112303.34240.ms@cerenity.org> Message-ID: <7AD436E4270DD54A94238001769C2227B797455CBE@DF-GRTDANE-MSG.exchange.corp.microsoft.com> I know both Martin and I have wanted to fix this bug in the past and just haven?t gotten the time to do it yet and haven?t seen anyone w/ a pressing need for it. The bug for this (3410, http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=3410) currently only has 1 vote so if we get votes for it then it will rise to the top of our priorities. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of M. David Peterson Sent: Thursday, July 12, 2007 12:01 PM To: ms at cerenity.org Cc: kamaelia-list at lists.sourceforge.net; Discussion of IronPython; Peter Fisk Subject: Re: [IronPython] [Kamaelia-list] Kamaelia and IronPython (was: Hosting IronPython 2.X in .NET app) On 7/11/07, Michael Sparks > wrote: On Wednesday 11 July 2007 10:25, M. David Peterson wrote: > > > File HTTPClient, line unknown, in Initialize > > > SyntaxError: yield in more than one try blocks This is a bug in the IronPython implementation of python's generators - this has been legal in python since python 2.2.2. I'm guessing it's a known bug by the sounds of things. Yep, I believe so. IronPython team: Are there any known concerns that might keep this from making into the final IP2.0 release? The reason incidentally we focus on compatibility with python 2.2.2 is because that also happens to be the version of python ported to Nokia mobile phones, and we'd like to retain the option of running Kamaelia on such platforms. (Having done so in the past and found we can do some fun things as a result! :) Which leads me to wonder how much of an impact Silverlight/DLR in the mobile device space might have? The notion of decentralized concurrent inbox/outbox operations taking place over, for example, a Kamaelia-based mesh network sounds WAY TOO COOL not to get excited about. Michael: FYI > The Dynamic Language Runtime is what IronPython 2.0 as well as IronRuby, a new JScript.NET implementation, as well as a new language referred to as Dynamic VB are built upon. If not mistaken, once Kamaelia can be run successfully on IronPython 2.0, then all of Kamaelia would be accessible via this same base of languages as well as other DLR-based projects such as Vista Smalltalk/DLR The nice thing about the above code is that it looks pretty linear, but has the cross platform scalabilty benefits of state machine approach. (which is *why* we use generators rather than threads) Nice! I wasn't aware of this until now, but it makes complete sense! -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Tue Jul 17 18:40:05 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 17 Jul 2007 09:40:05 -0700 Subject: [IronPython] IronPython 2.0A2 performance problems In-Reply-To: <469BEB31.6090100@twinsun.com> References: <469BEB31.6090100@twinsun.com> Message-ID: <7AD436E4270DD54A94238001769C2227B797455CC2@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Performance is a rather interesting area in IronPython currently. We are effectively changing the way we dispatch to methods internally from the old method (which was largely based around using interfaces for calling methods. Our built-in functions would be 1st class objects which were ICallable* and they would hold onto a cached generated delegate which would do fast dispatch to the .NET method). The brave new world is all based around DynamicSite's which are caching this information at the call site and doing fast(er) dispatch from the call site. In between alpha 1 and alpha 2 we completely ripped out the cached site inside of the callable objects for built-in functions and we were able to get most of the calls going through the DynamicSite mechanism instead. Unfortunately there are still some cases where we don't go through that code path and when that happens performance degrades very significantly. The problem here is w/ the indexer is not being optimized. To put this into concrete terms we have "Action"s (name will probably change) one of which is the DoOperationAction. DoOperationAction has various operation types which include GetItem/SetItem. In Alpha 2 we have no optimized code paths for GetItem/SetItem and so this goes really, really slow. If you run (on a debug build) w/ -X:TrackPerformance option you'll see a summary of results such as: ---- Performance Summary ---- Total DictInvoke = 101086 Total ReflectedTypes = 63 Total OverAllocate = 4 Total Compiler = 25 Total field = 199 (time = ~0.0003597938507 secs) Total calls = 100014 (calltime = ~0.514495569297 secs) Total Properties = 2 Total Known Times: 0.5148553631477 The costly part here is the calls - DictInvoke also has some costs but nothing compared to the calls. The good news is I've been working on improving our indexing time so on the next release this will be fixed. On my machine these numbers look like: ---- Performance Summary ---- Total DictInvoke = 1070 Total ReflectedTypes = 63 Total OverAllocate = 4 Total Compiler = 26 Total field = 195 (time = ~0.0003525618135 secs) Total calls = 12 (calltime = ~6.1730826E-05 secs) Total Properties = 2 And the execution time is 1/10th of what it is in Alpha 2. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Arman Bostani Sent: Monday, July 16, 2007 3:03 PM To: users at lists.ironpython.com Subject: [IronPython] IronPython 2.0A2 performance problems The following code runs about 13 times slower with version 2.0A2 than 1.1! -arman import System d = System.Collections.SortedList() t = System.DateTime.Now for k in xrange(100000): d[k] = k print 'SortedList time', (System.DateTime.Now - t).Ticks/100000 _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From xmlhacker at gmail.com Tue Jul 17 18:42:30 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Tue, 17 Jul 2007 10:42:30 -0600 Subject: [IronPython] [Kamaelia-list] Kamaelia and IronPython (was: Hosting IronPython 2.X in .NET app) In-Reply-To: <7AD436E4270DD54A94238001769C2227B797455CBE@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <200707112303.34240.ms@cerenity.org> <7AD436E4270DD54A94238001769C2227B797455CBE@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: On 7/17/07, Dino Viehland wrote: > The bug for this (3410, > http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=3410) > currently only has 1 vote so if we get votes for it then it will rise to the > top of our priorities. > It now has 2 :D Everyone else in the community: *PLEASE* oh *PLEASE* take a second and vote for this bug. The very thought of being able to gain access to Axon/Kamaelia via IronPython is enough for me to turn to bribery if the need arises, so lets just cut to the chase, What's it gonna take to get you to click the above link, if necessary sign into Codeplex, and then click the "Vote" button? ;-) :D -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From xmlhacker at gmail.com Wed Jul 18 12:09:24 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Wed, 18 Jul 2007 04:09:24 -0600 Subject: [IronPython] [Kamaelia-list] Kamaelia and IronPython (was: Hosting IronPython 2.X in .NET app) In-Reply-To: References: <200707112303.34240.ms@cerenity.org> <7AD436E4270DD54A94238001769C2227B797455CBE@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: On 7/17/07, M. David Peterson wrote: > > > It now has 2 :D > make that *10*, second only to importing pre-compiled modules on the "request" list. http://www.codeplex.com/IronPython/WorkItem/AdvancedList.aspx > What's it gonna take to get you to click the above link, if necessary sign > into Codeplex, and then click the "Vote" button? ;-) :D > That was cheaper than I thought. :) Thanks, everyone! :D -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From xmlhacker at gmail.com Wed Jul 18 15:09:08 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Wed, 18 Jul 2007 07:09:08 -0600 Subject: [IronPython] [Kamaelia-list] Kamaelia and IronPython (was: Hosting IronPython 2.X in .NET app) In-Reply-To: References: <200707112303.34240.ms@cerenity.org> <7AD436E4270DD54A94238001769C2227B797455CBE@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: On 7/18/07, M. David Peterson wrote: > > On 7/17/07, M. David Peterson > > wrote: > > > > > > It now has 2 :D > > > > make that *10*, second only to importing pre-compiled modules on the > "request" list. > http://www.codeplex.com/IronPython/WorkItem/AdvancedList.aspx > Did I say 10? I meant *12*! 5 more votes and "Implement import of pre-compiled modules" gets its a$$ kicked to the curb! (wait, thats a good thing, right? ;-) Well, regardless: Come on folks! 5 more votes and the only thing standing between us and support for nested yield statements is, umm, the time between now + the time that some PM at MSFT asks for a status report on the most active bugs + the 30 seconds before the report is delivered to quickly fix the top three bugs + the next release that follows the report being delivered to the now satisfied MSFT PM that is now convinced "this community thing is *REALLY* working!" That shouldn't be very long, should it? ;-) (Dear IronPython team: I kid, I kid. I worked on campus for enough years to understand how hard you guys work and how much is expected of you. Keep up the great work! And smile. A lot! :D) -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Thu Jul 19 01:43:24 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 18 Jul 2007 16:43:24 -0700 Subject: [IronPython] [Kamaelia-list] Kamaelia and IronPython (was: Hosting IronPython 2.X in .NET app) In-Reply-To: References: <200707112303.34240.ms@cerenity.org> <7AD436E4270DD54A94238001769C2227B797455CBE@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <7AD436E4270DD54A94238001769C2227B797456015@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Awesome, this will have to be fixed soon. I don?t know that any of our PMs are tracking the list, it?s more like ?time to fix bugs, let?s look at the list!? ?. To make this even better we?ve been running into some of our own issues w/ this which provide us w/ additional motivation to fix this. I?m betting it won?t make it into the next release (Alpha 3?), but hopefully the release after that. Thanks everyone who voted for this. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of M. David Peterson Sent: Wednesday, July 18, 2007 6:09 AM To: Discussion of IronPython Cc: kamaelia-list at lists.sourceforge.net; Peter Fisk; ms at cerenity.org Subject: Re: [IronPython] [Kamaelia-list] Kamaelia and IronPython (was: Hosting IronPython 2.X in .NET app) On 7/18/07, M. David Peterson > wrote: On 7/17/07, M. David Peterson < xmlhacker at gmail.com> wrote: It now has 2 :D make that *10*, second only to importing pre-compiled modules on the "request" list. http://www.codeplex.com/IronPython/WorkItem/AdvancedList.aspx Did I say 10? I meant *12*! 5 more votes and " Implement import of pre-compiled modules" gets its a$$ kicked to the curb! (wait, thats a good thing, right? ;-) Well, regardless: Come on folks! 5 more votes and the only thing standing between us and support for nested yield statements is, umm, the time between now + the time that some PM at MSFT asks for a status report on the most active bugs + the 30 seconds before the report is delivered to quickly fix the top three bugs + the next release that follows the report being delivered to the now satisfied MSFT PM that is now convinced "this community thing is *REALLY* working!" That shouldn't be very long, should it? ;-) (Dear IronPython team: I kid, I kid. I worked on campus for enough years to understand how hard you guys work and how much is expected of you. Keep up the great work! And smile. A lot! :D) -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Thu Jul 19 01:44:31 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 19 Jul 2007 00:44:31 +0100 Subject: [IronPython] Silverlight - Adding References to Assemblies Message-ID: <469EA5DF.8090206@voidspace.org.uk> Hello all, I'm trying to create a Silverlight project that references assemblies I've created from IronPython code. I can get the HTML / Javascript / XAML / IronPython combination working ok - but I can't reference assemblies that I've compiled. I'm using Orcas Beta 1 and have created a Silverlight project. When I use the normal "import clr; clr.AddReference " incantation, it fails to add the reference. Anyone got any clues? I can see the dll being fetched from my localhost server, but I still get an error message. When I use 'clr.LoadAssemblyByName' instead of 'AddReference' I get a more descriptive error, complaining that a dependency cannot be found (the only references my assembly has or needs are System and System.Windows.Browser): Could not load file or assembly 'ScriptableObjects, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. Source File: test.py Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'ScriptableObjects, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. Michael Foord http://www.voidspace.org.uk/ironpython/index.shtml From realn2s at googlemail.com Thu Jul 19 02:00:57 2007 From: realn2s at googlemail.com (C L) Date: Thu, 19 Jul 2007 02:00:57 +0200 Subject: [IronPython] IronPython objects as DataSource for DataGridView Message-ID: <81bb01120707181700r4c46021ete8b8dbcd249f8837@mail.gmail.com> Hello, I try to use a DataGridView with a collection of IronPython objects. The intention is to use the DataSource property of the DataGridView and let the columns be automatically defined. Something like: ---- class MyDataObject : def __init__(self, a, b, c): # ... pass f = Form( Name="Test") dataGrid = DataGridView() data = [ MyDataObject( 11, 12, 13 ) ] # or #data = [ [11, 12, 13 ] ] dataGrid.DataSource = data f.Controls.Add(dataGrid) Application.Run(f) ---- This gives an exception (see below) And I can't figure out which methods the objects or the container need to provide to get the column names. Do I have to "implement" IListSource for the container? Any help appreciated Regards, Claudius The exception I get is: >From System.MissingMemberException: 'instance' object has no attribute 'Get' at IronPython.Runtime.Operations.PythonOps.GetBoundAttr(CodeContext context, Object o, SymbolId name) at IronPython.Runtime.Operations.CustomTypeDescHelpers.SuperDynamicObjectPropertyDescriptor.GetValue(Object component) at System.Windows.Forms.DataGridView.DataGridViewDataConnection.GetValue(Int32 boundColumnIndex, Int32 columnIndex, Int32 rowIndex) >From System.MissingMemberException: 'instance' object has no attribute 'Set' at IronPython.Runtime.Operations.PythonOps.GetBoundAttr(CodeContext context, Object o, SymbolId name) at IronPython.Runtime.Operations.CustomTypeDescHelpers.SuperDynamicObjectPropertyDescriptor.GetValue(Object component) at System.Windows.Forms.DataGridView.DataGridViewDataConnection.GetValue(Int32 boundColumnIndex, Int32 columnIndex, Int32 rowIndex) >From System.MissingMemberException: 'instance' object has no attribute 'Address' at IronPython.Runtime.Operations.PythonOps.GetBoundAttr(CodeContext context, Object o, SymbolId name) at IronPython.Runtime.Operations.CustomTypeDescHelpers.SuperDynamicObjectPropertyDescriptor.GetValue(Object component) at System.Windows.Forms.DataGridView.DataGridViewDataConnection.GetValue(Int32 boundColumnIndex, Int32 columnIndex, Int32 rowIndex) -------------- next part -------------- An HTML attachment was scrubbed... URL: From jomes at microsoft.com Thu Jul 19 02:13:21 2007 From: jomes at microsoft.com (John Messerly) Date: Wed, 18 Jul 2007 17:13:21 -0700 Subject: [IronPython] Silverlight - Adding References to Assemblies In-Reply-To: <469EA5DF.8090206@voidspace.org.uk> References: <469EA5DF.8090206@voidspace.org.uk> Message-ID: <918705E903F4714CB713D89AB5F1857D6E6406A57B@NA-EXMSG-C116.redmond.corp.microsoft.com> Hi Michael, What does the call to clr.AddReference look like? We currently have a limitation in Silverlight, that we require a fully qualified assembly name, e.g.: clr.AddReference("MyAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null") (We do some magic to map short names to full names for platform assemblies, but not for downloaded assemblies.) The only other thing I can think of is maybe your DLL is somehow getting compiled against the wrong mscorlib/System binaries. Are the references in the C# project pointing at the Silverlight DLLs? - John -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Wednesday, July 18, 2007 4:45 PM To: Discussion of IronPython Subject: [IronPython] Silverlight - Adding References to Assemblies Hello all, I'm trying to create a Silverlight project that references assemblies I've created from IronPython code. I can get the HTML / Javascript / XAML / IronPython combination working ok - but I can't reference assemblies that I've compiled. I'm using Orcas Beta 1 and have created a Silverlight project. When I use the normal "import clr; clr.AddReference " incantation, it fails to add the reference. Anyone got any clues? I can see the dll being fetched from my localhost server, but I still get an error message. When I use 'clr.LoadAssemblyByName' instead of 'AddReference' I get a more descriptive error, complaining that a dependency cannot be found (the only references my assembly has or needs are System and System.Windows.Browser): Could not load file or assembly 'ScriptableObjects, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. Source File: test.py Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'ScriptableObjects, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. Michael Foord http://www.voidspace.org.uk/ironpython/index.shtml _______________________________________________ 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 19 02:16:22 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 19 Jul 2007 01:16:22 +0100 Subject: [IronPython] Silverlight - Adding References to Assemblies In-Reply-To: <918705E903F4714CB713D89AB5F1857D6E6406A57B@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <469EA5DF.8090206@voidspace.org.uk> <918705E903F4714CB713D89AB5F1857D6E6406A57B@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <469EAD56.20607@voidspace.org.uk> John Messerly wrote: > Hi Michael, > > What does the call to clr.AddReference look like? We currently have a limitation in Silverlight, that we require a fully qualified assembly name, e.g.: > > clr.AddReference("MyAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null") > Ah.... It might be worth mentioning that on this page: http://silverlight.net/QuickStarts/Other/ProgramDlr.aspx Which provides the example: Use the clr.AddReference function to load assemblies, and make their contents available for import. clr.AddReference("MyAssembly") But thanks. :-) Michael Foord > (We do some magic to map short names to full names for platform assemblies, but not for downloaded assemblies.) > > The only other thing I can think of is maybe your DLL is somehow getting compiled against the wrong mscorlib/System binaries. Are the references in the C# project pointing at the Silverlight DLLs? > > - John > > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Wednesday, July 18, 2007 4:45 PM > To: Discussion of IronPython > Subject: [IronPython] Silverlight - Adding References to Assemblies > > Hello all, > > I'm trying to create a Silverlight project that references assemblies > I've created from IronPython code. > > I can get the HTML / Javascript / XAML / IronPython combination working > ok - but I can't reference assemblies that I've compiled. > > I'm using Orcas Beta 1 and have created a Silverlight project. > > When I use the normal "import clr; clr.AddReference " incantation, it > fails to add the reference. > > Anyone got any clues? I can see the dll being fetched from my localhost > server, but I still get an error message. > > When I use 'clr.LoadAssemblyByName' instead of 'AddReference' I get a > more descriptive error, complaining that a dependency cannot be found > (the only references my assembly has or needs are System and > System.Windows.Browser): > > Could not load file or assembly 'ScriptableObjects, Culture=neutral, > PublicKeyToken=null' or one of its dependencies. The system cannot find > the file specified. > Source File: test.py > > Exception Details: System.IO.FileNotFoundException: Could not load file > or assembly 'ScriptableObjects, Culture=neutral, PublicKeyToken=null' or > one of its dependencies. The system cannot find the file specified. > > > Michael Foord > http://www.voidspace.org.uk/ironpython/index.shtml > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.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 jomes at microsoft.com Thu Jul 19 02:22:37 2007 From: jomes at microsoft.com (John Messerly) Date: Wed, 18 Jul 2007 17:22:37 -0700 Subject: [IronPython] Silverlight - Adding References to Assemblies In-Reply-To: <469EAD56.20607@voidspace.org.uk> References: <469EA5DF.8090206@voidspace.org.uk> <918705E903F4714CB713D89AB5F1857D6E6406A57B@NA-EXMSG-C116.redmond.corp.microsoft.com> <469EAD56.20607@voidspace.org.uk> Message-ID: <918705E903F4714CB713D89AB5F1857D6E6406A584@NA-EXMSG-C116.redmond.corp.microsoft.com> Good catch. I'll see if we can get that text updated. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Wednesday, July 18, 2007 5:16 PM To: Discussion of IronPython Subject: Re: [IronPython] Silverlight - Adding References to Assemblies John Messerly wrote: > Hi Michael, > > What does the call to clr.AddReference look like? We currently have a limitation in Silverlight, that we require a fully qualified assembly name, e.g.: > > clr.AddReference("MyAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null") > Ah.... It might be worth mentioning that on this page: http://silverlight.net/QuickStarts/Other/ProgramDlr.aspx Which provides the example: Use the clr.AddReference function to load assemblies, and make their contents available for import. clr.AddReference("MyAssembly") But thanks. :-) Michael Foord > (We do some magic to map short names to full names for platform assemblies, but not for downloaded assemblies.) > > The only other thing I can think of is maybe your DLL is somehow getting compiled against the wrong mscorlib/System binaries. Are the references in the C# project pointing at the Silverlight DLLs? > > - John > > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Wednesday, July 18, 2007 4:45 PM > To: Discussion of IronPython > Subject: [IronPython] Silverlight - Adding References to Assemblies > > Hello all, > > I'm trying to create a Silverlight project that references assemblies > I've created from IronPython code. > > I can get the HTML / Javascript / XAML / IronPython combination working > ok - but I can't reference assemblies that I've compiled. > > I'm using Orcas Beta 1 and have created a Silverlight project. > > When I use the normal "import clr; clr.AddReference " incantation, it > fails to add the reference. > > Anyone got any clues? I can see the dll being fetched from my localhost > server, but I still get an error message. > > When I use 'clr.LoadAssemblyByName' instead of 'AddReference' I get a > more descriptive error, complaining that a dependency cannot be found > (the only references my assembly has or needs are System and > System.Windows.Browser): > > Could not load file or assembly 'ScriptableObjects, Culture=neutral, > PublicKeyToken=null' or one of its dependencies. The system cannot find > the file specified. > Source File: test.py > > Exception Details: System.IO.FileNotFoundException: Could not load file > or assembly 'ScriptableObjects, Culture=neutral, PublicKeyToken=null' or > one of its dependencies. The system cannot find the file specified. > > > Michael Foord > http://www.voidspace.org.uk/ironpython/index.shtml > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.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 Thu Jul 19 02:26:38 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 19 Jul 2007 01:26:38 +0100 Subject: [IronPython] Silverlight - Adding References to Assemblies In-Reply-To: <918705E903F4714CB713D89AB5F1857D6E6406A584@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <469EA5DF.8090206@voidspace.org.uk> <918705E903F4714CB713D89AB5F1857D6E6406A57B@NA-EXMSG-C116.redmond.corp.microsoft.com> <469EAD56.20607@voidspace.org.uk> <918705E903F4714CB713D89AB5F1857D6E6406A584@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <469EAFBE.4030605@voidspace.org.uk> John Messerly wrote: > Good catch. I'll see if we can get that text updated. > Well - it caught me. ;-) Actually, now I'm getting a different problem. Restarting both browsers doesn't help. Unless you have any insight I will try restarting my machine. System.IO.FileLoadException: Could not load file or assembly 'ScriptableObjects, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The requested assembly version conflicts with what is already bound in the app domain or specified in the manifest. (Exception from HRESULT: 0x80131053). (Definitely referencing the right System assemblies - I did change the assembly name and even the version whilst trying to get this to work - so a restart might be needed.) Thanks Michael Foord > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Wednesday, July 18, 2007 5:16 PM > To: Discussion of IronPython > Subject: Re: [IronPython] Silverlight - Adding References to Assemblies > > John Messerly wrote: > >> Hi Michael, >> >> What does the call to clr.AddReference look like? We currently have a limitation in Silverlight, that we require a fully qualified assembly name, e.g.: >> >> clr.AddReference("MyAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null") >> >> > Ah.... > > It might be worth mentioning that on this page: > > http://silverlight.net/QuickStarts/Other/ProgramDlr.aspx > > Which provides the example: > > Use the clr.AddReference function to load assemblies, and make their > contents available for import. > > clr.AddReference("MyAssembly") > > But thanks. :-) > > Michael Foord > > > > > > >> (We do some magic to map short names to full names for platform assemblies, but not for downloaded assemblies.) >> >> The only other thing I can think of is maybe your DLL is somehow getting compiled against the wrong mscorlib/System binaries. Are the references in the C# project pointing at the Silverlight DLLs? >> >> - John >> >> >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord >> Sent: Wednesday, July 18, 2007 4:45 PM >> To: Discussion of IronPython >> Subject: [IronPython] Silverlight - Adding References to Assemblies >> >> Hello all, >> >> I'm trying to create a Silverlight project that references assemblies >> I've created from IronPython code. >> >> I can get the HTML / Javascript / XAML / IronPython combination working >> ok - but I can't reference assemblies that I've compiled. >> >> I'm using Orcas Beta 1 and have created a Silverlight project. >> >> When I use the normal "import clr; clr.AddReference " incantation, it >> fails to add the reference. >> >> Anyone got any clues? I can see the dll being fetched from my localhost >> server, but I still get an error message. >> >> When I use 'clr.LoadAssemblyByName' instead of 'AddReference' I get a >> more descriptive error, complaining that a dependency cannot be found >> (the only references my assembly has or needs are System and >> System.Windows.Browser): >> >> Could not load file or assembly 'ScriptableObjects, Culture=neutral, >> PublicKeyToken=null' or one of its dependencies. The system cannot find >> the file specified. >> Source File: test.py >> >> Exception Details: System.IO.FileNotFoundException: Could not load file >> or assembly 'ScriptableObjects, Culture=neutral, PublicKeyToken=null' or >> one of its dependencies. The system cannot find the file specified. >> >> >> Michael Foord >> http://www.voidspace.org.uk/ironpython/index.shtml >> >> _______________________________________________ >> users mailing list >> users at lists.ironpython.com >> http://lists.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 jomes at microsoft.com Thu Jul 19 04:46:23 2007 From: jomes at microsoft.com (John Messerly) Date: Wed, 18 Jul 2007 19:46:23 -0700 Subject: [IronPython] Silverlight - Adding References to Assemblies In-Reply-To: <469EAFBE.4030605@voidspace.org.uk> References: <469EA5DF.8090206@voidspace.org.uk> <918705E903F4714CB713D89AB5F1857D6E6406A57B@NA-EXMSG-C116.redmond.corp.microsoft.com> <469EAD56.20607@voidspace.org.uk> <918705E903F4714CB713D89AB5F1857D6E6406A584@NA-EXMSG-C116.redmond.corp.microsoft.com> <469EAFBE.4030605@voidspace.org.uk> Message-ID: <918705E903F4714CB713D89AB5F1857D6E6406A5BE@NA-EXMSG-C116.redmond.corp.microsoft.com> Did rebooting help? That's a really strange error--the app domain should be recreated every page refresh. Maybe some old copy DLL is in the browser cache... -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Wednesday, July 18, 2007 5:27 PM To: Discussion of IronPython Subject: Re: [IronPython] Silverlight - Adding References to Assemblies John Messerly wrote: > Good catch. I'll see if we can get that text updated. > Well - it caught me. ;-) Actually, now I'm getting a different problem. Restarting both browsers doesn't help. Unless you have any insight I will try restarting my machine. System.IO.FileLoadException: Could not load file or assembly 'ScriptableObjects, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The requested assembly version conflicts with what is already bound in the app domain or specified in the manifest. (Exception from HRESULT: 0x80131053). (Definitely referencing the right System assemblies - I did change the assembly name and even the version whilst trying to get this to work - so a restart might be needed.) Thanks Michael Foord From luismg at gmx.net Thu Jul 19 05:10:29 2007 From: luismg at gmx.net (=?iso-8859-1?Q?Luis_M._Gonz=E1lez?=) Date: Thu, 19 Jul 2007 00:10:29 -0300 Subject: [IronPython] IronPython objects as DataSource for DataGridView References: <81bb01120707181700r4c46021ete8b8dbcd249f8837@mail.gmail.com> Message-ID: <002d01c7c9b2$5e5774e0$6c00a8c0@averatecdda041> This has been filed as a bug sometime ago, and I believe it's supposed to be fixed in the next release... ----- Original Message ----- From: C L To: Discussion of IronPython Sent: Wednesday, July 18, 2007 9:00 PM Subject: [IronPython] IronPython objects as DataSource for DataGridView Hello, I try to use a DataGridView with a collection of IronPython objects. The intention is to use the DataSource property of the DataGridView and let the columns be automatically defined. Something like: ---- class MyDataObject : def __init__(self, a, b, c): # ... pass f = Form( Name="Test") dataGrid = DataGridView() data = [ MyDataObject( 11, 12, 13 ) ] # or #data = [ [11, 12, 13 ] ] dataGrid.DataSource = data f.Controls.Add(dataGrid) Application.Run(f) ---- This gives an exception (see below) And I can't figure out which methods the objects or the container need to provide to get the column names. Do I have to "implement" IListSource for the container? Any help appreciated Regards, Claudius The exception I get is: From System.MissingMemberException : 'instance' object has no attribute 'Get' at IronPython.Runtime.Operations.PythonOps.GetBoundAttr(CodeContext context, Object o, SymbolId name) at IronPython.Runtime.Operations.CustomTypeDescHelpers.SuperDynamicObjectPropertyDescriptor.GetValue (Object component) at System.Windows.Forms.DataGridView.DataGridViewDataConnection.GetValue(Int32 boundColumnIndex, Int32 columnIndex, Int32 rowIndex) From System.MissingMemberException: 'instance' object has no attribute 'Set' at IronPython.Runtime.Operations.PythonOps.GetBoundAttr(CodeContext context, Object o, SymbolId name) at IronPython.Runtime.Operations.CustomTypeDescHelpers.SuperDynamicObjectPropertyDescriptor.GetValue(Object component) at System.Windows.Forms.DataGridView.DataGridViewDataConnection.GetValue(Int32 boundColumnIndex, Int32 columnIndex, Int32 rowIndex) From System.MissingMemberException: 'instance' object has no attribute 'Address' at IronPython.Runtime.Operations.PythonOps.GetBoundAttr(CodeContext context, Object o, SymbolId name) at IronPython.Runtime.Operations.CustomTypeDescHelpers.SuperDynamicObjectPropertyDescriptor.GetValue(Object component) at System.Windows.Forms.DataGridView.DataGridViewDataConnection.GetValue(Int32 boundColumnIndex, Int32 columnIndex, Int32 rowIndex) ------------------------------------------------------------------------------ _______________________________________________ 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 xmlhacker at gmail.com Thu Jul 19 05:23:03 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Wed, 18 Jul 2007 21:23:03 -0600 Subject: [IronPython] [Kamaelia-list] Kamaelia and IronPython (was: Hosting IronPython 2.X in .NET app) In-Reply-To: <7AD436E4270DD54A94238001769C2227B797456015@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <200707112303.34240.ms@cerenity.org> <7AD436E4270DD54A94238001769C2227B797455CBE@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <7AD436E4270DD54A94238001769C2227B797456015@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: On 7/18/07, Dino Viehland wrote: > > Awesome, this will have to be fixed soon. I don't know that any of our > PMs are tracking the list, > And if they were, I would question why in the hell that particular PM is getting in the way of progress! ;-) > it's more like "time to fix bugs, let's look at the list!" J. > Which makes the 16 votes this bug currently has that much more exciting! :D > To make this even better we've been running into some of our own issues w/ > this which provide us w/ additional motivation to fix this. > Nice! > I'm betting it won't make it into the next release (Alpha 3?), but > hopefully the release after that. > All I hope for is that it gets fixed in time for the first beta such that it can be properly and thoroughly tested before the final release. Thanks for all of your efforts with this! One thing: Would it be helpful if myself or someone else were to pull together a test suite composed of Axon/Kamaelia and all non-C API-based Kamaelia components? Not sure if providing external test suites is considered kosher, but if yes and it would be helpful, I'd be happy to put forth the effort. > Thanks everyone who voted for this. > I second the thanks. Thanks everyone! :D -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Thu Jul 19 18:52:32 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 19 Jul 2007 17:52:32 +0100 Subject: [IronPython] Silverlight - Adding References to Assemblies In-Reply-To: <918705E903F4714CB713D89AB5F1857D6E6406A5BE@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <469EA5DF.8090206@voidspace.org.uk> <918705E903F4714CB713D89AB5F1857D6E6406A57B@NA-EXMSG-C116.redmond.corp.microsoft.com> <469EAD56.20607@voidspace.org.uk> <918705E903F4714CB713D89AB5F1857D6E6406A584@NA-EXMSG-C116.redmond.corp.microsoft.com> <469EAFBE.4030605@voidspace.org.uk> <918705E903F4714CB713D89AB5F1857D6E6406A5BE@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <469F96D0.2040108@voidspace.org.uk> John Messerly wrote: > Did rebooting help? > > That's a really strange error--the app domain should be recreated every page refresh. Maybe some old copy DLL is in the browser cache... > Nope - same error on a different machine. *sigh* System.IO.FileLoadException: Could not load file or assembly 'ScriptableObjects, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The requested assembly version conflicts with what is already bound in the app domain or specified in the manifest. (Exception from HRESULT: 0x80131053). I also found by the way that page refreshes in Firefox would *not* load the latest script versions from the server. I would do a page refresh in IE and *then* Firefox would pickup the new version... No further testing yet today. My machine has spent all day downloading and installing the massive Orcas Beta! :-) Just doing the final updates now... Michael Foord http://www.voidspace.org.uk/ironpython/index.shtml > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Wednesday, July 18, 2007 5:27 PM > To: Discussion of IronPython > Subject: Re: [IronPython] Silverlight - Adding References to Assemblies > > John Messerly wrote: > >> Good catch. I'll see if we can get that text updated. >> >> > > Well - it caught me. ;-) > > Actually, now I'm getting a different problem. Restarting both browsers > doesn't help. Unless you have any insight I will try restarting my machine. > > System.IO.FileLoadException: Could not load file or assembly > 'ScriptableObjects, Culture=neutral, PublicKeyToken=null' or one of its > dependencies. The requested assembly version conflicts with what is > already bound in the app domain or specified in the manifest. (Exception > from HRESULT: 0x80131053). > > (Definitely referencing the right System assemblies - I did change the > assembly name and even the version whilst trying to get this to work - > so a restart might be needed.) > > Thanks > > > Michael Foord > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > From jomes at microsoft.com Fri Jul 20 01:09:45 2007 From: jomes at microsoft.com (John Messerly) Date: Thu, 19 Jul 2007 16:09:45 -0700 Subject: [IronPython] Silverlight - Adding References to Assemblies In-Reply-To: <469F96D0.2040108@voidspace.org.uk> References: <469EA5DF.8090206@voidspace.org.uk> <918705E903F4714CB713D89AB5F1857D6E6406A57B@NA-EXMSG-C116.redmond.corp.microsoft.com> <469EAD56.20607@voidspace.org.uk> <918705E903F4714CB713D89AB5F1857D6E6406A584@NA-EXMSG-C116.redmond.corp.microsoft.com> <469EAFBE.4030605@voidspace.org.uk> <918705E903F4714CB713D89AB5F1857D6E6406A5BE@NA-EXMSG-C116.redmond.corp.microsoft.com> <469F96D0.2040108@voidspace.org.uk> Message-ID: <918705E903F4714CB713D89AB5F1857D6E64B73FE0@NA-EXMSG-C116.redmond.corp.microsoft.com> Sounds like a bug in the Silverlight download stack. I'll see if we can reproduce the problem on this end. - John -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Thursday, July 19, 2007 9:53 AM To: Discussion of IronPython Subject: Re: [IronPython] Silverlight - Adding References to Assemblies John Messerly wrote: > Did rebooting help? > > That's a really strange error--the app domain should be recreated every page refresh. Maybe some old copy DLL is in the browser cache... > Nope - same error on a different machine. *sigh* System.IO.FileLoadException: Could not load file or assembly 'ScriptableObjects, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The requested assembly version conflicts with what is already bound in the app domain or specified in the manifest. (Exception from HRESULT: 0x80131053). I also found by the way that page refreshes in Firefox would *not* load the latest script versions from the server. I would do a page refresh in IE and *then* Firefox would pickup the new version... No further testing yet today. My machine has spent all day downloading and installing the massive Orcas Beta! :-) Just doing the final updates now... Michael Foord http://www.voidspace.org.uk/ironpython/index.shtml From fuzzyman at voidspace.org.uk Fri Jul 20 01:23:20 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Fri, 20 Jul 2007 00:23:20 +0100 Subject: [IronPython] Silverlight - Adding References to Assemblies In-Reply-To: <918705E903F4714CB713D89AB5F1857D6E64B73FE0@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <469EA5DF.8090206@voidspace.org.uk> <918705E903F4714CB713D89AB5F1857D6E6406A57B@NA-EXMSG-C116.redmond.corp.microsoft.com> <469EAD56.20607@voidspace.org.uk> <918705E903F4714CB713D89AB5F1857D6E6406A584@NA-EXMSG-C116.redmond.corp.microsoft.com> <469EAFBE.4030605@voidspace.org.uk> <918705E903F4714CB713D89AB5F1857D6E6406A5BE@NA-EXMSG-C116.redmond.corp.microsoft.com> <469F96D0.2040108@voidspace.org.uk> <918705E903F4714CB713D89AB5F1857D6E64B73FE0@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <469FF268.2060304@voidspace.org.uk> John Messerly wrote: > Sounds like a bug in the Silverlight download stack. I'll see if we can reproduce the problem on this end. > Hmm... that problem has gone away (I can't remember what particular change fixed it - but it has gone). See the follow up email though... (Thanks for your help.) Michael > - John > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Thursday, July 19, 2007 9:53 AM > To: Discussion of IronPython > Subject: Re: [IronPython] Silverlight - Adding References to Assemblies > > John Messerly wrote: > >> Did rebooting help? >> >> That's a really strange error--the app domain should be recreated every page refresh. Maybe some old copy DLL is in the browser cache... >> >> > > Nope - same error on a different machine. *sigh* > > System.IO.FileLoadException: Could not load file or assembly > 'ScriptableObjects, Culture=neutral, PublicKeyToken=null' or one of its > dependencies. The requested assembly version conflicts with what is > already bound in the app domain or specified in the manifest. (Exception > from HRESULT: 0x80131053). > > > I also found by the way that page refreshes in Firefox would *not* load > the latest script versions from the server. I would do a page refresh in > IE and *then* Firefox would pickup the new version... > > No further testing yet today. My machine has spent all day downloading > and installing the massive Orcas Beta! :-) Just doing the final updates > now... > > Michael Foord > http://www.voidspace.org.uk/ironpython/index.shtml > _______________________________________________ > 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 20 01:33:22 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Fri, 20 Jul 2007 00:33:22 +0100 Subject: [IronPython] Marking Methods as Scriptable from IronPython with Silverlight (and problems therein) Message-ID: <469FF4C2.2050902@voidspace.org.uk> Hello all (especially John), I've been experimenting with calling into IronPython from Javascript using Silverlight. The way to call into managed code is to mark classes and methods with a Scriptable attribute. Obviously you can't do this from IronPython - still no attributes support ;-). The obvious way to attempt is to create a C# class with the attributes and subclass from IronPython. I have a basic C# example working, so I know I'm on the right track. Unfortunately it fails to work from IronPython (either using the C# class directly or a subclass). The error is: Script object of type 'ScriptableClass.Class' contains a script member 'method' with an invalid type ('System.Object'). Exception Details: System.NotSupportedException: Script object of type 'ScriptableClass.Class' contains a script member 'method' with an invalid type ('System.Object').. Stack Trace: at OnLoad in test.py, line 22 This could be because it is only valid to return a string or other primitive type from a Scriptable method. I wonder if when done from inside IronPython the method signature is mutated to appear as if it returns Object ? Here is the basic C# code: using System; using System.Windows.Browser; namespace ScriptableClass { [Scriptable] public class Class { [Scriptable] public object method() { return this._method(); } public object _method() { return "hello"; } } } The Python code that calls it (adding the reference is working now - God knows why - must have been an oddity on my system - sorry): import clr clr.AddReference("ScriptableObjects, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null") import System import System.Windows.Browser from System.Windows import WebApplication from System.Windows.Browser import HtmlPage from ScriptableClass import Class class Subclass(Class): def _method(self): return 'wobble' def OnLoad(sender, e): example1 = Class() example2 = Subclass() WebApplication.Current.RegisterScriptableObject("test1", example1) WebApplication.Current.RegisterScriptableObject("test2", example2) The error is at the *first* call to "RegisterScriptableObject" - so it isn't even with the subclass... If anyone has any clues as to how I might work round this then it would be much appreciated. (I have already tried moving the call to "RegisterScriptableObject" into C#, but still passing in instances created in Python code and this made no difference.) All the best, Michael Foord http://www.voidspace.org.uk/ironpython/index.shtml From jomes at microsoft.com Fri Jul 20 04:19:58 2007 From: jomes at microsoft.com (John Messerly) Date: Thu, 19 Jul 2007 19:19:58 -0700 Subject: [IronPython] Marking Methods as Scriptable from IronPython with Silverlight (and problems therein) In-Reply-To: <469FF4C2.2050902@voidspace.org.uk> References: <469FF4C2.2050902@voidspace.org.uk> Message-ID: <918705E903F4714CB713D89AB5F1857D6E64B74067@NA-EXMSG-C116.redmond.corp.microsoft.com> What happens if you change method() to return a string, e.g.: [Scriptable] public string method() Does that help? -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Thursday, July 19, 2007 4:33 PM To: Discussion of IronPython Subject: [IronPython] Marking Methods as Scriptable from IronPython with Silverlight (and problems therein) Hello all (especially John), I've been experimenting with calling into IronPython from Javascript using Silverlight. The way to call into managed code is to mark classes and methods with a Scriptable attribute. Obviously you can't do this from IronPython - still no attributes support ;-). The obvious way to attempt is to create a C# class with the attributes and subclass from IronPython. I have a basic C# example working, so I know I'm on the right track. Unfortunately it fails to work from IronPython (either using the C# class directly or a subclass). The error is: Script object of type 'ScriptableClass.Class' contains a script member 'method' with an invalid type ('System.Object'). Exception Details: System.NotSupportedException: Script object of type 'ScriptableClass.Class' contains a script member 'method' with an invalid type ('System.Object').. Stack Trace: at OnLoad in test.py, line 22 This could be because it is only valid to return a string or other primitive type from a Scriptable method. I wonder if when done from inside IronPython the method signature is mutated to appear as if it returns Object ? Here is the basic C# code: using System; using System.Windows.Browser; namespace ScriptableClass { [Scriptable] public class Class { [Scriptable] public object method() { return this._method(); } public object _method() { return "hello"; } } } The Python code that calls it (adding the reference is working now - God knows why - must have been an oddity on my system - sorry): import clr clr.AddReference("ScriptableObjects, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null") import System import System.Windows.Browser from System.Windows import WebApplication from System.Windows.Browser import HtmlPage from ScriptableClass import Class class Subclass(Class): def _method(self): return 'wobble' def OnLoad(sender, e): example1 = Class() example2 = Subclass() WebApplication.Current.RegisterScriptableObject("test1", example1) WebApplication.Current.RegisterScriptableObject("test2", example2) The error is at the *first* call to "RegisterScriptableObject" - so it isn't even with the subclass... If anyone has any clues as to how I might work round this then it would be much appreciated. (I have already tried moving the call to "RegisterScriptableObject" into C#, but still passing in instances created in Python code and this made no difference.) All the best, Michael Foord http://www.voidspace.org.uk/ironpython/index.shtml _______________________________________________ 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 20 14:33:01 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Fri, 20 Jul 2007 13:33:01 +0100 Subject: [IronPython] Marking Methods as Scriptable from IronPython with Silverlight (and problems therein) In-Reply-To: <918705E903F4714CB713D89AB5F1857D6E64B74067@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <469FF4C2.2050902@voidspace.org.uk> <918705E903F4714CB713D89AB5F1857D6E64B74067@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <46A0AB7D.3020506@voidspace.org.uk> John Messerly wrote: > What happens if you change method() to return a string, e.g.: > > [Scriptable] > public string method() > > Does that help? > Uhm... :-o yes it does. Sorry. I spent so long banging head against the C# example (there my Javascript was trying to call into C# before the Silverlight control had properly loaded - so I did learn something useful), that I missed that kind of obvious mistake. :-) Thanks for your patience. 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 19, 2007 4:33 PM > To: Discussion of IronPython > Subject: [IronPython] Marking Methods as Scriptable from IronPython with Silverlight (and problems therein) > > Hello all (especially John), > > > I've been experimenting with calling into IronPython from Javascript > using Silverlight. > > The way to call into managed code is to mark classes and methods with a > Scriptable attribute. Obviously you can't do this from IronPython - > still no attributes support ;-). The obvious way to attempt is to create > a C# class with the attributes and subclass from IronPython. > > I have a basic C# example working, so I know I'm on the right track. > Unfortunately it fails to work from IronPython (either using the C# > class directly or a subclass). The error is: > > Script object of type 'ScriptableClass.Class' contains a script member > 'method' with an invalid type ('System.Object'). > Exception Details: System.NotSupportedException: Script object of type > 'ScriptableClass.Class' contains a script member 'method' with an > invalid type ('System.Object').. > > Stack Trace: > > at OnLoad in test.py, line 22 > > > This could be because it is only valid to return a string or other > primitive type from a Scriptable method. I wonder if when done from > inside IronPython the method signature is mutated to appear as if it > returns Object ? > > > Here is the basic C# code: > > using System; > using System.Windows.Browser; > > namespace ScriptableClass > { > [Scriptable] > public class Class > { > [Scriptable] > public object method() > { > return this._method(); > } > > public object _method() > { > return "hello"; > } > } > > } > > > The Python code that calls it (adding the reference is working now - God > knows why - must have been an oddity on my system - sorry): > > import clr > clr.AddReference("ScriptableObjects, Version=1.0.0.0, Culture=neutral, > PublicKeyToken=null") > > import System > import System.Windows.Browser > > from System.Windows import WebApplication > from System.Windows.Browser import HtmlPage > > > from ScriptableClass import Class > > class Subclass(Class): > def _method(self): > return 'wobble' > > > def OnLoad(sender, e): > example1 = Class() > example2 = Subclass() > > WebApplication.Current.RegisterScriptableObject("test1", example1) > WebApplication.Current.RegisterScriptableObject("test2", example2) > > > The error is at the *first* call to "RegisterScriptableObject" - so it > isn't even with the subclass... > > If anyone has any clues as to how I might work round this then it would > be much appreciated. (I have already tried moving the call to > "RegisterScriptableObject" into C#, but still passing in instances > created in Python code and this made no difference.) > > All the best, > > > Michael Foord > http://www.voidspace.org.uk/ironpython/index.shtml > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.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 Fri Jul 20 17:29:12 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Fri, 20 Jul 2007 08:29:12 -0700 Subject: [IronPython] [Kamaelia-list] Kamaelia and IronPython (was: Hosting IronPython 2.X in .NET app) In-Reply-To: References: <200707112303.34240.ms@cerenity.org> <7AD436E4270DD54A94238001769C2227B797455CBE@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <7AD436E4270DD54A94238001769C2227B797456015@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <7AD436E4270DD54A94238001769C2227B8262D58EC@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Generally what?s best for us is to get small test cases which demonstrate particular problems. Great examples of this are every single one of Seo?s bug reports. We have occasionally picked up external Python libraries and their associated test suites (the best example of this I can think of is nzmath). Unfortunately when we do that we need to talk to lawyers, have them approve the license, and then we keep those files in a separate source repository from our primary one. The small individual test cases we can integrate back into our own test suite, add our own versions of the tests for more coverage, etc? and that?s much more flexible. If they do have a test suite, or if you?re interested in contributing one, I could ping the lawyers, but Kamaelia?s license will at least make that an interesting talk for us ?. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of M. David Peterson Sent: Wednesday, July 18, 2007 8:23 PM To: Discussion of IronPython Cc: kamaelia-list at lists.sourceforge.net; Peter Fisk; ms at cerenity.org Subject: Re: [IronPython] [Kamaelia-list] Kamaelia and IronPython (was: Hosting IronPython 2.X in .NET app) On 7/18/07, Dino Viehland > wrote: Awesome, this will have to be fixed soon. I don't know that any of our PMs are tracking the list, And if they were, I would question why in the hell that particular PM is getting in the way of progress! ;-) it's more like "time to fix bugs, let's look at the list!" ?. Which makes the 16 votes this bug currently has that much more exciting! :D To make this even better we've been running into some of our own issues w/ this which provide us w/ additional motivation to fix this. Nice! I'm betting it won't make it into the next release (Alpha 3?), but hopefully the release after that. All I hope for is that it gets fixed in time for the first beta such that it can be properly and thoroughly tested before the final release. Thanks for all of your efforts with this! One thing: Would it be helpful if myself or someone else were to pull together a test suite composed of Axon/Kamaelia and all non-C API-based Kamaelia components? Not sure if providing external test suites is considered kosher, but if yes and it would be helpful, I'd be happy to put forth the effort. Thanks everyone who voted for this. I second the thanks. Thanks everyone! :D -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From aranguren at deneb.biz Fri Jul 20 17:29:47 2007 From: aranguren at deneb.biz (aranguren at deneb.biz) Date: Fri, 20 Jul 2007 17:29:47 +0200 Subject: [IronPython] Autoreply: users Digest, Vol 36, Issue 29 Message-ID: I am on holiday till the 30th of July and won't be able to reply to your email. For any urgent matters please contact Laura Senent at laura at deneb.biz --------------------------------------------------------------------- This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful From xmlhacker at gmail.com Fri Jul 20 23:29:30 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Fri, 20 Jul 2007 15:29:30 -0600 Subject: [IronPython] [Kamaelia-list] Kamaelia and IronPython (was: Hosting IronPython 2.X in .NET app) In-Reply-To: <7AD436E4270DD54A94238001769C2227B8262D58EC@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <200707112303.34240.ms@cerenity.org> <7AD436E4270DD54A94238001769C2227B797455CBE@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <7AD436E4270DD54A94238001769C2227B797456015@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <7AD436E4270DD54A94238001769C2227B8262D58EC@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: On 7/20/07, Dino Viehland wrote: > > Generally what's best for us is to get small test cases which demonstrate > particular problems. Great examples of this are every single one of Seo's > bug reports. > Seo is without a doubt a shining example of how to effectively contribute to OSS software! We have occasionally picked up external Python libraries and their > associated test suites (the best example of this I can think of is nzmath). > Unfortunately when we do that we need to talk to lawyers, have them approve > the license, and then we keep those files in a separate source repository > from our primary one. > I figured as much. An ugly process, but when you're a company as big as MSFT its one of those things that just has to be this way. To many people on the sidelines looking for a way to stick their fingers into the MSFT pie (or simply cause as much Baby's Mama Drama as they possibly can ;-) The small individual test cases we can integrate back into our own test > suite, add our own versions of the tests for more coverage, etc? and that's > much more flexible. > Cool. That's helpful to know. If they do have a test suite, or if you're interested in contributing one, I > could ping the lawyers, but Kamaelia's license will at least make that an > interesting talk for us J. > :D An interesting comment from Michael Sparks regarding their trilicense scheme[1], My *personal* preference is for the BSD license, but the MPL/GPL/LGPL gives > maximum protections for users and interoperability with other libraries, > whilst protecting the base code from being closed. Also, some interesting food for the argument for open systems fodder[2], At present, proprietary systems fail to provide the BBC any way of > mitigating costs. Open systems based on open standards often replace the > early adopted proprietary systems, simply in order to scale. This has been > likened to proprietary medicines being replaced by generic drugs over time. Maybe its just me, but something tells me that as we move forward into a world powered by "Software as a Service" and decentralized communications, paying attention to the BBC+Kamaelia is going to become as important as paying attention to what MSFT was doing in the 90's and what Google is doing in the 00's. Of course, in this regard gaining support for Kamaelia in IronPython 2.0 (.NET+WCF+DLR+Silverlight+Kamaelia == YES PLEASE! :) makes things that much more sweet in regards to being enabled to do some pretty amazing things in the land of audio/video/p2p communications! [1] http://www.oreillynet.com/xml/blog/2006/10/bbcoss_on_kamaelia_concurrency.html#comment-106266 [2] http://kamaelia.sourceforge.net/Challenges/?tab=6 -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From xmlhacker at gmail.com Fri Jul 20 23:32:19 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Fri, 20 Jul 2007 15:32:19 -0600 Subject: [IronPython] [Kamaelia-list] Kamaelia and IronPython (was: Hosting IronPython 2.X in .NET app) In-Reply-To: <200707201655.18416.ms@cerenity.org> References: <7AD436E4270DD54A94238001769C2227B8262D58EC@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <200707201655.18416.ms@cerenity.org> Message-ID: On 7/20/07, Michael Sparks wrote: > > Hi, > > > In the interests of you having a quiet life (who wants to be dealing with > lawyers when writing code? :-)... Who wants to deal with lawyers *EVER*! ;-) Example that as I understand should trigger your bug: (also attached) Nice! :D Will get this added to my own personal test suite as well. Thanks, Michael! -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From sh at defuze.org Fri Jul 20 23:36:40 2007 From: sh at defuze.org (Sylvain Hellegouarch) Date: Fri, 20 Jul 2007 22:36:40 +0100 Subject: [IronPython] [Kamaelia-list] Kamaelia and IronPython (was: Hosting IronPython 2.X in .NET app) In-Reply-To: References: <7AD436E4270DD54A94238001769C2227B8262D58EC@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <200707201655.18416.ms@cerenity.org> Message-ID: <46A12AE8.2050705@defuze.org> M. David Peterson a ?crit : > On 7/20/07, *Michael Sparks* > wrote: > > Hi, > > > In the interests of you having a quiet life (who wants to be > dealing with > lawyers when writing code? :-)... > > > Who wants to deal with lawyers *EVER*! ;-) I must admit though, after so many years in OSS, this is the first time I hear this sentence. Mind you this is not as if Microsoft was the only one doing so, I bet all the big companies do so. They have to. From a developer point of view though, it's a big "WTF?" :D Thanks Dino for the honesty nonetheless. - Sylvain From aranguren at deneb.biz Sat Jul 21 01:18:06 2007 From: aranguren at deneb.biz (aranguren at deneb.biz) Date: Sat, 21 Jul 2007 01:18:06 +0200 Subject: [IronPython] Autoreply: users Digest, Vol 36, Issue 30 Message-ID: I am on holiday till the 30th of July and won't be able to reply to your email. For any urgent matters please contact Laura Senent at laura at deneb.biz --------------------------------------------------------------------- This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful From xmlhacker at gmail.com Sat Jul 21 01:50:21 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Fri, 20 Jul 2007 17:50:21 -0600 Subject: [IronPython] [Kamaelia-list] Kamaelia and IronPython (was: Hosting IronPython 2.X in .NET app) In-Reply-To: <46A12AE8.2050705@defuze.org> References: <7AD436E4270DD54A94238001769C2227B8262D58EC@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <200707201655.18416.ms@cerenity.org> <46A12AE8.2050705@defuze.org> Message-ID: On 7/20/07, Sylvain Hellegouarch wrote: > > > I must admit though, after so many years in OSS, this is the first time > I hear this sentence. How many OSS projects and/or the projects corporate sponsor generate 50 some odd billion a year in revenue and have at any given time 30-60 some odd billion in the bank? Couple this with the fact that for all intents and purposes MSFT has only been in the open source "business" for between 2-3 years (and its only the last year that they have really pushed the OSS power play button) and it makes sense as to why this is the first time you have heard this sentence. Mind you this is not as if Microsoft was the only > one doing so, I bet all the big companies do so. They have to. Even if they were the only ones, how many big companies do you know that generate 50+/-billion... and have in the bank 30-60+/-billion...? The game changes when you have resources that rival the GNP of a small to medium sized nation. As much as I'm sure we all, to some extent, wish this wasn't the case, it really *IS* about the money. Maybe not in every respect, but again, when you're a target as big as MSFT, the game changes. Maybe its just MSFT being ultra sensitive, but again, when that much cash has to be constantly protected from a million different directions, attempting to convince the lawyers that "yeah, but OSS communities are different than the rest of the world" isn't going to be an easy task, especially when OSS luminaries such as Eric Raymond are making statements such as, > I expect to be quite wealthy once the dust from the Linux IPOs has settled > > Doing It For The Cause, > December 12th, 1999 > Like I said, it really is about the money. >From a developer point of view though, it's a big "WTF?" :D Thus my comment "who want's to deal with lawyers *EVER*". Generally speaking, its not in our genetic makeup to think of the world in such a way. Fortunately there *ARE* lawyers (even if I don't want to deal with them) who take interest in taking care of things like this for us so we can spend more of our time worrying about writing code, and less of our time dealing with the legalities of the trade. Thanks Dino for the honesty nonetheless. Ditto. -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.john.rees at gmail.com Mon Jul 23 15:24:49 2007 From: mark.john.rees at gmail.com (Mark Rees) Date: Mon, 23 Jul 2007 23:24:49 +1000 Subject: [IronPython] Contributions to IronPython library source Message-ID: Hi, I see in John Lams announcement of the IronRuby first source code release (http://www.iunknown.com/2007/07/a-first-look-at.html), they will be accepting source code contributions into the IronRuby libraries. So I cannot resist asking if the IronPython will have the same policy soon for IronPython 2.0 libraries and hopefully IronPython 1.1. Regards Mark From sanxiyn at gmail.com Mon Jul 23 15:34:58 2007 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Mon, 23 Jul 2007 22:34:58 +0900 Subject: [IronPython] Recent Check-Ins Message-ID: <5b0248170707230634x7603c369g94e60d014489aa47@mail.gmail.com> I suspect the "automation" mentioned last month isn't fixed after all. http://lists.ironpython.com/pipermail/users-ironpython.com/2007-June/005099.html John Lam posted IronRuby Pre Alpha 1 code on his site, and diffing its Microsoft.Scripting directory against one from IronPython 2.0 Alpha 2 I get: 92 files changed, 2847 insertions(+), 1035 deletions(-) Here is the command I used: $ diff -I @microsoft.com -urN IronPython-2.0A2/Src/Microsoft.Scripting IronRuby-Pre-Alpha1/Src/Microsoft.Scripting | diffstat -I options is there to ignore mail address changes from ironpy at microsoft.com to ironruby at microsoft.com. -- Seo Sanghyeon From xmlhacker at gmail.com Mon Jul 23 16:58:40 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Mon, 23 Jul 2007 08:58:40 -0600 Subject: [IronPython] .NET Dynamic Languages Group on Facebook Message-ID: http://www.oreillynet.com/windows/blog/2007/07/net_dynamic_languages_group_on.html -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From gary.williams at datacert.com Mon Jul 23 17:39:33 2007 From: gary.williams at datacert.com (Gary Williams) Date: Mon, 23 Jul 2007 10:39:33 -0500 Subject: [IronPython] .NET Dynamic Languages Group on Facebook In-Reply-To: References: Message-ID: The registration page isn't working (This page cannot be displayed)...unless of course, I'm doing something wrong (a high probability scenario :)) Gary Williams ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of M. David Peterson Sent: Monday, July 23, 2007 9:59 AM To: Discussion of IronPython; RubyDOTNET at googlegroups.com Subject: [IronPython] .NET Dynamic Languages Group on Facebook http://www.oreillynet.com/windows/blog/2007/07/net_dynamic_languages_gro up_on.html -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Mon Jul 23 17:49:17 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 23 Jul 2007 16:49:17 +0100 Subject: [IronPython] .NET Dynamic Languages Group on Facebook In-Reply-To: References: Message-ID: <46A4CDFD.3030408@voidspace.org.uk> Gary Williams wrote: > The registration page isn't working (This page cannot be > displayed)...unless of course, I'm doing something wrong (a high > probability scenario :)) It worked ok for me a few minutes ago (and thanks David). Michael Foord http://www.voidspace.org.uk/ironpython/index.shtml > > *Gary Williams* > > > ------------------------------------------------------------------------ > *From:* users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] *On Behalf Of *M. David > Peterson > *Sent:* Monday, July 23, 2007 9:59 AM > *To:* Discussion of IronPython; RubyDOTNET at googlegroups.com > *Subject:* [IronPython] .NET Dynamic Languages Group on Facebook > > http://www.oreillynet.com/windows/blog/2007/07/net_dynamic_languages_group_on.html > > > -- > /M:D > > M. David Peterson > http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | > http://dev.aol.com/blog/3155 > ------------------------------------------------------------------------ > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From xmlhacker at gmail.com Mon Jul 23 17:53:23 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Mon, 23 Jul 2007 09:53:23 -0600 Subject: [IronPython] .NET Dynamic Languages Group on Facebook In-Reply-To: References: Message-ID: On 7/23/07, Gary Williams wrote: > > The registration page isn't working (This page cannot be > displayed)...unless of course, I'm doing something wrong (a high probability > scenario :)) > Facebook registration or the group registration? Anybody else having problems? BTW... I should have included this in the original post to this group, but the direct link to the group on Facebook is http://www.facebook.com/group.php?gid=2430928882 -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From giles.thomas at resolversystems.com Mon Jul 23 19:38:00 2007 From: giles.thomas at resolversystems.com (Giles Thomas) Date: Mon, 23 Jul 2007 18:38:00 +0100 Subject: [IronPython] Future handling of op_Implicit In-Reply-To: <7AD436E4270DD54A94238001769C2227B490A468D5@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <468D116A.20701@resolversystems.com> <7AD436E4270DD54A94238001769C2227B490A468D5@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <46A4E778.1030607@resolversystems.com> Thanks, Dino - I've voted on the bug, thanks for pointing me in that direction. It would be great to be able to avoid writing C# for this. Regards, Giles Dino Viehland wrote: > I believe we're going to get better at this in the future. For starters there are currently some code paths which are missing the checks for the implicit conversions - for example if you define an implicit conversion to string we won't respect it all (in either v1.x or v2.x right now). This is because we have a fast path which isn't checking for the implicit conversion. > > Additionally it would be fairly easy for us to expose this out via some other mechanism for when we're not doing the right thing. For example we could either leave the op_Implicit methods on the type which defines them or maybe we could move them onto the type which we want to do the conversion from (e.g. add a "ToFoo" onto Bar when Foo defines an implicit operator for conversion from Foo to Bar). I believe w/ the 1st option we can get into trouble w/ overloads that only differ by return types but the 2nd option may be less problematic. > > But obviously we've got to do a better job of enabling this basic CLS consumption scenario w/o forcing you to use C#. > > We've also run into this internally recently as a fundamental DLR concept. That's how we discovered the issues w/ string conversions :). > > If you haven't already vote on bug #11278 (http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=11278) please do and we'll look at doing this sooner rather than later. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Giles Thomas > Sent: Thursday, July 05, 2007 8:43 AM > To: Discussion of IronPython > Subject: [IronPython] Future handling of op_Implicit > > Hi, > > I guess we're going to have to use C# to work around the lack of > op_Implicit support in the short term, but I'm interested in knowing > about the IP team's plans for handling conversion operators going forward. > > Here's our situation; we have a highly-scriptable application, and our > clients want to be able to call their own .NET libraries from their > scripts. However, their libraries make heavy use of the implicit casts, > so that they can (for example) have a method that takes an instance of > C1, but pass it a C2 and rely on C1's op_Implicit(C2) to handle the > conversion. This works fine for them when using other .NET languages, > but of course doesn't work in IronPython. > > I must admit that I don't really know what IP could do with this kind of > code; if I understand correctly, op_Implicit(x) in (say) C# is > dispatched based on the type of the variable x rather then the type of > the object to which it is a reference, and of course variable type in > that sense is not a meaningful concept in a dynamic language. > > What should IronPython do? Is this a case where people are going to > have to write more code if they want to use a dynamic language? > > > Regards, > > Giles > -- > > Giles Thomas > giles.thomas at resolversystems.com > +44 (0) 20 7253 6372 > > 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 > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- Giles Thomas giles.thomas at resolversystems.com +44 (0) 20 7253 6372 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 riltim at gmail.com Mon Jul 23 20:35:16 2007 From: riltim at gmail.com (Tim Riley) Date: Mon, 23 Jul 2007 14:35:16 -0400 Subject: [IronPython] IronPython Attribute Workaround Message-ID: I know that IronPython doesn't support attributes but does anyone know of a workaround that will allow IP code to use them? From fuzzyman at voidspace.org.uk Mon Jul 23 21:26:25 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 23 Jul 2007 20:26:25 +0100 Subject: [IronPython] IronPython Attribute Workaround In-Reply-To: References: Message-ID: <46A500E1.6030001@voidspace.org.uk> Tim Riley wrote: > I know that IronPython doesn't support attributes but does anyone know > of a workaround that will allow IP code to use them? > The IronPython team are strangely quiet every time someone asks this... ;-) A lot of people would like an answer to this question. Currently the only way is to use stub C# classes. Michael Foord http://www.voidspace.org.uk/ironpython/index.shtml > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > From riltim at gmail.com Mon Jul 23 21:43:31 2007 From: riltim at gmail.com (Tim Riley) Date: Mon, 23 Jul 2007 15:43:31 -0400 Subject: [IronPython] IronPython Attribute Workaround In-Reply-To: <46A500E1.6030001@voidspace.org.uk> References: <46A500E1.6030001@voidspace.org.uk> Message-ID: Michael: Thanks for the reply. However when reading it my eyes glazed over. Is there any way you could provide a simple man like myself with some example code for me to peruse? Tim On 7/23/07, Michael Foord wrote: > Tim Riley wrote: > > I know that IronPython doesn't support attributes but does anyone know > > of a workaround that will allow IP code to use them? > > > > The IronPython team are strangely quiet every time someone asks this... ;-) > > A lot of people would like an answer to this question. Currently the > only way is to use stub C# classes. > > Michael Foord > http://www.voidspace.org.uk/ironpython/index.shtml > > > > _______________________________________________ > > users mailing list > > users at lists.ironpython.com > > http://lists.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 aranguren at deneb.biz Mon Jul 23 21:43:54 2007 From: aranguren at deneb.biz (aranguren at deneb.biz) Date: Mon, 23 Jul 2007 21:43:54 +0200 Subject: [IronPython] Autoreply: Users Digest, Vol 36, Issue 32 Message-ID: I am on holiday till the 3th of August and won't be able to reply to your email. For any urgent matters please contact Laura Senent at laura at deneb.biz --------------------------------------------------------------------- This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful From fuzzyman at voidspace.org.uk Mon Jul 23 21:47:51 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 23 Jul 2007 20:47:51 +0100 Subject: [IronPython] IronPython Attribute Workaround In-Reply-To: References: <46A500E1.6030001@voidspace.org.uk> Message-ID: <46A505E7.4090407@voidspace.org.uk> Tim Riley wrote: > Michael: > > Thanks for the reply. However when reading it my eyes glazed over. Is > there any way you could provide a simple man like myself with some > example code for me to peruse? > What do you want to achieve? Write the IronPython code you would like - and I will try and provide a C# stub that you can subclass. (You will need a C# compiler - Visual Studio Express C# is probably the most straightforward if you are using Windows.) Michael Foord http://www.voidspace.org.uk/ironpython/index.shtml > Tim > > On 7/23/07, Michael Foord wrote: > >> Tim Riley wrote: >> >>> I know that IronPython doesn't support attributes but does anyone know >>> of a workaround that will allow IP code to use them? >>> >>> >> The IronPython team are strangely quiet every time someone asks this... ;-) >> >> A lot of people would like an answer to this question. Currently the >> only way is to use stub C# classes. >> >> Michael Foord >> http://www.voidspace.org.uk/ironpython/index.shtml >> >> >> >>> _______________________________________________ >>> users mailing list >>> users at lists.ironpython.com >>> http://lists.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 riltim at gmail.com Mon Jul 23 22:16:05 2007 From: riltim at gmail.com (Tim Riley) Date: Mon, 23 Jul 2007 16:16:05 -0400 Subject: [IronPython] IronPython Attribute Workaround In-Reply-To: <46A505E7.4090407@voidspace.org.uk> References: <46A500E1.6030001@voidspace.org.uk> <46A505E7.4090407@voidspace.org.uk> Message-ID: I am messing around with some code that will allow me to use IronPython to automate AutoCAD software via it's .NET API. I already have hacked up some ugly C# code that creates an instance of a PythonEngine and executes a python file a select via an open file dialog box. All works well with this. The next step I'd like to take is to attempt to create a mechanism for registering AutoCAD commands via python code (so I don't have to select a file every time I want to run it. AutoCAD's .NET API allows you to register a command that is callable from the AutoCAD via a CommandMethod attribute[1]. Since IP doesn't support attributes I'd like to develop some sort of decorator that would clone the functionality of the CommandMethod attribute. So I could execute python code like: @commandmethod("test") def tester: print "test worked" and it would register the test command so I could call it from the command line. [1] As an example: http://through-the-interface.typepad.com/through_the_interface/2007/07/updating-a-spec.html Tim On 7/23/07, Michael Foord wrote: > Tim Riley wrote: > > Michael: > > > > Thanks for the reply. However when reading it my eyes glazed over. Is > > there any way you could provide a simple man like myself with some > > example code for me to peruse? > > > > What do you want to achieve? Write the IronPython code you would like - > and I will try and provide a C# stub that you can subclass. (You will > need a C# compiler - Visual Studio Express C# is probably the most > straightforward if you are using Windows.) > > Michael Foord > http://www.voidspace.org.uk/ironpython/index.shtml > > > Tim > > > > On 7/23/07, Michael Foord wrote: > > > >> Tim Riley wrote: > >> > >>> I know that IronPython doesn't support attributes but does anyone know > >>> of a workaround that will allow IP code to use them? > >>> > >>> > >> The IronPython team are strangely quiet every time someone asks this... ;-) > >> > >> A lot of people would like an answer to this question. Currently the > >> only way is to use stub C# classes. > >> > >> Michael Foord > >> http://www.voidspace.org.uk/ironpython/index.shtml > >> > >> > >> > >>> _______________________________________________ > >>> users mailing list > >>> users at lists.ironpython.com > >>> http://lists.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 Mon Jul 23 22:32:10 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 23 Jul 2007 21:32:10 +0100 Subject: [IronPython] IronPython Attribute Workaround In-Reply-To: References: <46A500E1.6030001@voidspace.org.uk> <46A505E7.4090407@voidspace.org.uk> Message-ID: <46A5104A.8020703@voidspace.org.uk> Tim Riley wrote: [snip..] > AutoCAD's .NET API allows > you to register a command that is callable from the AutoCAD via a CommandMethod attribute[1]. Since IP doesn't support attributes I'd like to develop some sort of decorator that would clone the functionality of the CommandMethod attribute. So I could execute > python code like: > > @commandmethod("test") > def tester: > print "test worked" > > and it would register the test command so I could call it from the > command line. > > Right - so you want to dynamically create methods (or functions) with attributes. The attribute takes the name that the command will be exposed with. I wonder if AutoCAD even supports these being dynamically created? If it does I wonder if we can do it by creating an inner class in C#. The method marked with the attribute would call down to another method (marked as virtual) that we can override from IronPython. I'm not exactly sure of the C# syntax/semantics for inner classes - (a class factory) - so I'll have to do some digging. (i.e. will it allow us to set the argument to the attribute at runtime rather than compile time and can we return classes or only instances.) AFAIK, attributes are normally bound at compile time rather than runtime, so using C# to create classes in this way may not work. The proper way (*sigh*) is to use the Reflection.Emit API to add attributes. I've experimented Reflection.Emit - but never got as far as adding attributes dynamically. (You need to 'program in bytecode' using this API - which isn't too bad but has a bit of a learning curve associated.) A *third* approach is to dynamically generate C# and compile to in memory assemblies (using the CodeDOM API if I remember correctly). That turns out to be surprisingly easy. Michael Foord http://www.voidspace.org.uk/ironpython/index.shtml > [1] As an example: > http://through-the-interface.typepad.com/through_the_interface/2007/07/updating-a-spec.html > > > Tim > > On 7/23/07, Michael Foord wrote: > >> Tim Riley wrote: >> >>> Michael: >>> >>> Thanks for the reply. However when reading it my eyes glazed over. Is >>> there any way you could provide a simple man like myself with some >>> example code for me to peruse? >>> >>> >> What do you want to achieve? Write the IronPython code you would like - >> and I will try and provide a C# stub that you can subclass. (You will >> need a C# compiler - Visual Studio Express C# is probably the most >> straightforward if you are using Windows.) >> >> Michael Foord >> http://www.voidspace.org.uk/ironpython/index.shtml >> >> >>> Tim >>> >>> On 7/23/07, Michael Foord wrote: >>> >>> >>>> Tim Riley wrote: >>>> >>>> >>>>> I know that IronPython doesn't support attributes but does anyone know >>>>> of a workaround that will allow IP code to use them? >>>>> >>>>> >>>>> >>>> The IronPython team are strangely quiet every time someone asks this... ;-) >>>> >>>> A lot of people would like an answer to this question. Currently the >>>> only way is to use stub C# classes. >>>> >>>> Michael Foord >>>> http://www.voidspace.org.uk/ironpython/index.shtml >>>> >>>> >>>> >>>> >>>>> _______________________________________________ >>>>> users mailing list >>>>> users at lists.ironpython.com >>>>> http://lists.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 Jim.Hugunin at microsoft.com Mon Jul 23 22:39:40 2007 From: Jim.Hugunin at microsoft.com (Jim Hugunin) Date: Mon, 23 Jul 2007 13:39:40 -0700 Subject: [IronPython] Contributions to IronPython library source In-Reply-To: References: Message-ID: John Lam announced this morning that we will be accepting external source code contributions into the IronRuby libraries on the standard Ruby open source site, Rubyforge. In the hours since that announcement a number of people (including Mark, below) have asked if we're going to do the same thing with the IronPython libraries. Obviously the answer to that question is an enthusiastic yes! However, we still have work to do to figure out the details and the timing. In one sense, we already have such a site for IronPython with the fepy project run by Seo Sanghyeon. This sourceforge project includes many community contributions primarily in the form of libraries that are not a part of the core IronPython release. Seo also produces very nice complete packages of IronPython and related libraries - particularly for folks running on Linux. If you're an eager contributor today who'd like to improve IronPython's library support, I suspect that your contributions would be welcome at fepy - although you'd obviously have to ask Seo for a definitive answer here. In the longer term, we will establish a more official structure so that the community can contribute to more of the IronPython project and so that our "official" releases will include these contributions. Right now, our fairly small team is still focused on working out the details for our new IronRuby release. While we're doing this, we don't want to make any changes to disrupt the IronPython project that has been running successfully for over two years. After the IronRuby sources do in fact go up on Rubyforge, we'll be able to devote the time to talk with folks both within MS and within the Python community to work out the best next step for IronPython to increase our support for community contributors. I'm sorry this is going to take a little more time and thank you for your patience. Thanks - Jim -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Mark Rees Sent: Monday, July 23, 2007 6:25 AM To: Discussion of IronPython Subject: [IronPython] Contributions to IronPython library source Hi, I see in John Lams announcement of the IronRuby first source code release (http://www.iunknown.com/2007/07/a-first-look-at.html), they will be accepting source code contributions into the IronRuby libraries. So I cannot resist asking if the IronPython will have the same policy soon for IronPython 2.0 libraries and hopefully IronPython 1.1. Regards Mark _______________________________________________ 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 23 23:04:42 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 23 Jul 2007 22:04:42 +0100 Subject: [IronPython] Contributions to IronPython library source In-Reply-To: References: Message-ID: <46A517EA.7040906@voidspace.org.uk> Thanks Jim - this is *great* news. Even if it doesn't happen immediately, the announcement that it is a definite goal is very reassuring and appreciated. All the best, Michael Foord http://www.voidspace.org.uk/ironpython/index.shtml Jim Hugunin wrote: > John Lam announced this morning that we will be accepting external source code contributions into the IronRuby libraries on the standard Ruby open source site, Rubyforge. In the hours since that announcement a number of people (including Mark, below) have asked if we're going to do the same thing with the IronPython libraries. Obviously the answer to that question is an enthusiastic yes! However, we still have work to do to figure out the details and the timing. > > In one sense, we already have such a site for IronPython with the fepy project run by Seo Sanghyeon. This sourceforge project includes many community contributions primarily in the form of libraries that are not a part of the core IronPython release. Seo also produces very nice complete packages of IronPython and related libraries - particularly for folks running on Linux. If you're an eager contributor today who'd like to improve IronPython's library support, I suspect that your contributions would be welcome at fepy - although you'd obviously have to ask Seo for a definitive answer here. > > In the longer term, we will establish a more official structure so that the community can contribute to more of the IronPython project and so that our "official" releases will include these contributions. Right now, our fairly small team is still focused on working out the details for our new IronRuby release. While we're doing this, we don't want to make any changes to disrupt the IronPython project that has been running successfully for over two years. After the IronRuby sources do in fact go up on Rubyforge, we'll be able to devote the time to talk with folks both within MS and within the Python community to work out the best next step for IronPython to increase our support for community contributors. I'm sorry this is going to take a little more time and thank you for your patience. > > Thanks - Jim > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Mark Rees > Sent: Monday, July 23, 2007 6:25 AM > To: Discussion of IronPython > Subject: [IronPython] Contributions to IronPython library source > > Hi, > > I see in John Lams announcement of the IronRuby first source code > release (http://www.iunknown.com/2007/07/a-first-look-at.html), they > will be accepting source code contributions into the IronRuby > libraries. So I cannot resist asking if the IronPython will have the > same policy soon for IronPython 2.0 libraries and hopefully IronPython > 1.1. > > Regards > > Mark > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.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 24 01:09:38 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 24 Jul 2007 00:09:38 +0100 Subject: [Users] [IronPython] IronPython Attribute Workaround In-Reply-To: <46A5104A.8020703@voidspace.org.uk> References: <46A500E1.6030001@voidspace.org.uk> <46A505E7.4090407@voidspace.org.uk> <46A5104A.8020703@voidspace.org.uk> Message-ID: <46A53532.2040006@voidspace.org.uk> I'm pretty sure that it is impossible to dynamically generate classes decorated with attributes at runtime using 'pure C#'. The two alternatives are either to use the Reflection.Emit API - which is probably the best way but requires more digging than I have time for at this point in time. Another alternative is to dynamically generate C# and compile to in memory assemblies. This is less memory efficient because it requires an assembly and type object for every command you wish to add. It is a lot faster than you might expect. Attached are two files. One is 'generate.py'. It has a function called 'Generate' which compiles C# using the CodeDom API with the CSharpCodeProvider. As an example I have provided another file - DllImport.py. This uses Generate to compile the C# from my screenshot example : http://www.voidspace.org.uk/ironpython/winforms/part10.shtml It works fine. :-) The specific call is : assembly = Generate(unmanaged_code, 'UnamangedCode', inMemory=True) clr.AddReference(assembly) from UnmanagedCode import User32, GDI32 (You can also use it to save assemblies to disk.) For your use you will need to pass in a list of references (absolute file paths) to the AutoCAD DLLs that your C# code is dependent on. I think you need to generate C# code that looks something like: using Autodesk.AutoCAD.ApplicationServices; using Autodesk.AutoCAD.DatabaseServices; using Autodesk.AutoCAD.EditorInput; using Autodesk.AutoCAD.Runtime; namespace AutoCADStuff { public class AutoCADStuffBase { [CommandMethod("myname")] public void method { _method(); } public virtual void _method { return null; } } In IronPython you can call 'Generate', then import and subclass AutoCADStuffBase and override '_method': class AutoCADStuff(AutoCADStuffBase): def _method(self): some code ... I have used this approach with Silverlight assemblies for creating classes with methods marked with attributes. I hope this helps. Please no one post this code as is - I'll write up and post an article shortly. :-) Michael Foord Michael Foord wrote: > Tim Riley wrote: > [snip..] > >> AutoCAD's .NET API allows >> you to register a command that is callable from the AutoCAD via a CommandMethod attribute[1]. Since IP doesn't support attributes I'd like to develop some sort of decorator that would clone the functionality of the CommandMethod attribute. So I could execute >> python code like: >> >> @commandmethod("test") >> def tester: >> print "test worked" >> >> and it would register the test command so I could call it from the >> command line. >> >> >> > > Right - so you want to dynamically create methods (or functions) with > attributes. The attribute takes the name that the command will be > exposed with. > > I wonder if AutoCAD even supports these being dynamically created? > > If it does I wonder if we can do it by creating an inner class in C#. > The method marked with the attribute would call down to another method > (marked as virtual) that we can override from IronPython. > > I'm not exactly sure of the C# syntax/semantics for inner classes - (a > class factory) - so I'll have to do some digging. (i.e. will it allow us > to set the argument to the attribute at runtime rather than compile time > and can we return classes or only instances.) > > AFAIK, attributes are normally bound at compile time rather than > runtime, so using C# to create classes in this way may not work. > > The proper way (*sigh*) is to use the Reflection.Emit API to add > attributes. I've experimented Reflection.Emit - but never got as far as > adding attributes dynamically. (You need to 'program in bytecode' using > this API - which isn't too bad but has a bit of a learning curve > associated.) > > A *third* approach is to dynamically generate C# and compile to in > memory assemblies (using the CodeDOM API if I remember correctly). That > turns out to be surprisingly easy. > > Michael Foord > http://www.voidspace.org.uk/ironpython/index.shtml > > >> [1] As an example: >> http://through-the-interface.typepad.com/through_the_interface/2007/07/updating-a-spec.html >> >> >> Tim >> >> On 7/23/07, Michael Foord wrote: >> >> >>> Tim Riley wrote: >>> >>> >>>> Michael: >>>> >>>> Thanks for the reply. However when reading it my eyes glazed over. Is >>>> there any way you could provide a simple man like myself with some >>>> example code for me to peruse? >>>> >>>> >>>> >>> What do you want to achieve? Write the IronPython code you would like - >>> and I will try and provide a C# stub that you can subclass. (You will >>> need a C# compiler - Visual Studio Express C# is probably the most >>> straightforward if you are using Windows.) >>> >>> Michael Foord >>> http://www.voidspace.org.uk/ironpython/index.shtml >>> >>> >>> >>>> Tim >>>> >>>> On 7/23/07, Michael Foord wrote: >>>> >>>> >>>> >>>>> Tim Riley wrote: >>>>> >>>>> >>>>> >>>>>> I know that IronPython doesn't support attributes but does anyone know >>>>>> of a workaround that will allow IP code to use them? >>>>>> >>>>>> >>>>>> >>>>>> >>>>> The IronPython team are strangely quiet every time someone asks this... ;-) >>>>> >>>>> A lot of people would like an answer to this question. Currently the >>>>> only way is to use stub C# classes. >>>>> >>>>> Michael Foord >>>>> http://www.voidspace.org.uk/ironpython/index.shtml >>>>> >>>>> >>>>> >>>>> >>>>> >>>>>> _______________________________________________ >>>>>> users mailing list >>>>>> users at lists.ironpython.com >>>>>> http://lists.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 embedded and charset-unspecified text was scrubbed... Name: DllImport.py URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: generate.py URL: From aranguren at deneb.biz Tue Jul 24 01:10:05 2007 From: aranguren at deneb.biz (aranguren at deneb.biz) Date: Tue, 24 Jul 2007 01:10:05 +0200 Subject: [Users] Autoreply: Users Digest, Vol 36, Issue 33 Message-ID: I am on holiday till the 3th of August and won't be able to reply to your email. For any urgent matters please contact Laura Senent at laura at deneb.biz --------------------------------------------------------------------- This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful From aranguren at deneb.biz Tue Jul 24 01:19:55 2007 From: aranguren at deneb.biz (aranguren at deneb.biz) Date: Tue, 24 Jul 2007 01:19:55 +0200 Subject: [Users] Autoreply: Users Digest, Vol 36, Issue 34 Message-ID: I am on holiday till the 3th of August and won't be able to reply to your email. For any urgent matters please contact Laura Senent at laura at deneb.biz --------------------------------------------------------------------- This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful From fuzzyman at voidspace.org.uk Tue Jul 24 02:22:16 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 24 Jul 2007 01:22:16 +0100 Subject: [Users] Dynamically Compiling C# from IronPython Message-ID: <46A54638.1030209@voidspace.org.uk> Hello all, I've written up an article on dynamically compiling C# from IronPython. http://www.voidspace.org.uk/ironpython/dynamically_compiling.shtml Assemblies can be generated in memory and then used directly, or they can be saved to disk. The C# can be generated dynamically as well. This is one way round the lack of attributes support in IronPython. Perhaps not the most efficient way though... Michael Foord http://www.voidspace.org.uk/ironpython/index.shtml From fuzzyman at voidspace.org.uk Tue Jul 24 03:20:03 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 24 Jul 2007 02:20:03 +0100 Subject: [Users] Mailing List Archives Gone Private ? Message-ID: <46A553C3.4090800@voidspace.org.uk> Hello all, It seems like the archive for this mailing list just became private... wtf? If you go to the list page: http://lists.ironpython.com/listinfo.cgi/users-ironpython.com and click on the archives link, it takes you to a sign-in page and is now for subscribers only. That means that it won't be indexed by google and we can't search it... I'm sure this is a mistake - unintended consequence of a mailman upgrade perhaps? Michael Foord http://www.voidspace.org.uk/ironpython/index.shtml From steve at holdenweb.com Tue Jul 24 03:32:48 2007 From: steve at holdenweb.com (Steve Holden) Date: Mon, 23 Jul 2007 21:32:48 -0400 Subject: [Users] Mailing List Archives Gone Private ? In-Reply-To: <46A553C3.4090800@voidspace.org.uk> References: <46A553C3.4090800@voidspace.org.uk> Message-ID: <46A556C0.1020100@holdenweb.com> Michael Foord wrote: > Hello all, > > It seems like the archive for this mailing list just became private... wtf? > > If you go to the list page: > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > and click on the archives link, it takes you to a sign-in page and is > now for subscribers only. > > That means that it won't be indexed by google and we can't search it... > > I'm sure this is a mistake - unintended consequence of a mailman upgrade > perhaps? > As a new subscriber I see that the messages from this list appear with the rather unhelpful list designation "[Users]" in the subject line. It may be too late to amend this now everyone already joined up has set their filters appropriately, but "[IronPython Users]" would be much more user-friendly (and slightly less egocentric ;-) regards Steve -- Steve Holden +1 571 484 6266 +1 800 494 3119 Holden Web LLC/Ltd http://www.holdenweb.com Skype: holdenweb http://del.icio.us/steve.holden --------------- Asciimercial ------------------ Get on the web: Blog, lens and tag the Internet Many services currently offer free registration ----------- Thank You for Reading ------------- From simon at arrowtheory.com Tue Jul 24 03:37:21 2007 From: simon at arrowtheory.com (Simon Burton) Date: Mon, 23 Jul 2007 18:37:21 -0700 Subject: [Users] Mailing List Archives Gone Private ? In-Reply-To: <46A556C0.1020100@holdenweb.com> References: <46A553C3.4090800@voidspace.org.uk> <46A556C0.1020100@holdenweb.com> Message-ID: <20070723183721.efeb7e13.simon@arrowtheory.com> It used to be [IronPython], can we change it back? Simon. On Mon, 23 Jul 2007 21:32:48 -0400 Steve Holden wrote: > Michael Foord wrote: > > Hello all, > > > > It seems like the archive for this mailing list just became private... wtf? > > > > If you go to the list page: > > > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > and click on the archives link, it takes you to a sign-in page and is > > now for subscribers only. > > > > That means that it won't be indexed by google and we can't search it... > > > > I'm sure this is a mistake - unintended consequence of a mailman upgrade > > perhaps? > > > As a new subscriber I see that the messages from this list appear with > the rather unhelpful list designation "[Users]" in the subject line. It > may be too late to amend this now everyone already joined up has set > their filters appropriately, but "[IronPython Users]" would be much more > user-friendly (and slightly less egocentric ;-) > > regards > Steve > -- > Steve Holden +1 571 484 6266 +1 800 494 3119 > Holden Web LLC/Ltd http://www.holdenweb.com > Skype: holdenweb http://del.icio.us/steve.holden > --------------- Asciimercial ------------------ > Get on the web: Blog, lens and tag the Internet > Many services currently offer free registration > ----------- Thank You for Reading ------------- > _______________________________________________ > 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 24 03:35:20 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 24 Jul 2007 02:35:20 +0100 Subject: [Users] Mailing List Archives Gone Private ? In-Reply-To: <46A556C0.1020100@holdenweb.com> References: <46A553C3.4090800@voidspace.org.uk> <46A556C0.1020100@holdenweb.com> Message-ID: <46A55758.7060909@voidspace.org.uk> Steve Holden wrote: > Michael Foord wrote: > >> Hello all, >> >> It seems like the archive for this mailing list just became private... wtf? >> >> If you go to the list page: >> >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> and click on the archives link, it takes you to a sign-in page and is >> now for subscribers only. >> >> That means that it won't be indexed by google and we can't search it... >> >> I'm sure this is a mistake - unintended consequence of a mailman upgrade >> perhaps? >> >> > As a new subscriber I see that the messages from this list appear with > the rather unhelpful list designation "[Users]" in the subject line. It > may be too late to amend this now everyone already joined up has set > their filters appropriately, but "[IronPython Users]" would be much more > user-friendly (and slightly less egocentric ;-) > It *was* set to [IronPython] - but changed at the same time that the archive went private. Looks like another error. As a result people's filters *are* now broken and we're getting spammed with auto-responders... :-) Michael > regards > Steve > From jomes at microsoft.com Tue Jul 24 03:46:48 2007 From: jomes at microsoft.com (John Messerly) Date: Mon, 23 Jul 2007 18:46:48 -0700 Subject: [Users] Mailing List Archives Gone Private ? In-Reply-To: <46A55758.7060909@voidspace.org.uk> References: <46A553C3.4090800@voidspace.org.uk> <46A556C0.1020100@holdenweb.com> <46A55758.7060909@voidspace.org.uk> Message-ID: <918705E903F4714CB713D89AB5F1857D6E64B74807@NA-EXMSG-C116.redmond.corp.microsoft.com> I'm sure it was accidental :). I'll see if I can get someone to fix it. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Monday, July 23, 2007 6:35 PM To: Discussion of IronPython Subject: Re: [Users] Mailing List Archives Gone Private ? Steve Holden wrote: > Michael Foord wrote: > >> Hello all, >> >> It seems like the archive for this mailing list just became private... wtf? >> >> If you go to the list page: >> >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> and click on the archives link, it takes you to a sign-in page and is >> now for subscribers only. >> >> That means that it won't be indexed by google and we can't search it... >> >> I'm sure this is a mistake - unintended consequence of a mailman upgrade >> perhaps? >> >> > As a new subscriber I see that the messages from this list appear with > the rather unhelpful list designation "[Users]" in the subject line. It > may be too late to amend this now everyone already joined up has set > their filters appropriately, but "[IronPython Users]" would be much more > user-friendly (and slightly less egocentric ;-) > It *was* set to [IronPython] - but changed at the same time that the archive went private. Looks like another error. As a result people's filters *are* now broken and we're getting spammed with auto-responders... :-) Michael > regards > Steve > From riltim at gmail.com Tue Jul 24 04:11:17 2007 From: riltim at gmail.com (Tim Riley) Date: Mon, 23 Jul 2007 22:11:17 -0400 Subject: [Users] [IronPython] IronPython Attribute Workaround In-Reply-To: <46A53532.2040006@voidspace.org.uk> References: <46A500E1.6030001@voidspace.org.uk> <46A505E7.4090407@voidspace.org.uk> <46A5104A.8020703@voidspace.org.uk> <46A53532.2040006@voidspace.org.uk> Message-ID: Michael: Earlier today I was doing some digging using Lutz Roeder's .NET Reflector and it seems that the CommandMethod attribute registers the command using the acmgd.Autodesk.AutoCAD.Runtime.ICommandLineCallable interface. As I can tap into any other aspect of AutoCAD's .NET api via ironpython I'm going to assume that I can somehow tap into this and register a command. The only problem is I don't have a clue how...yet. If you want to take a look at what C# code I have so far you can find it @ http://pyacaddotnet.googlecode.com/svn/trunk/PyAcadDotNet.cs Also I have some (lousy) samples that I use for testing IronPython in AutoCAD. You can find them here: http://pyacaddotnet.googlecode.com/svn/trunk/Samples/ Tim On 7/23/07, Michael Foord wrote: > I'm pretty sure that it is impossible to dynamically generate classes > decorated with attributes at runtime using 'pure C#'. > > The two alternatives are either to use the Reflection.Emit API - which > is probably the best way but requires more digging than I have time for > at this point in time. > > Another alternative is to dynamically generate C# and compile to in > memory assemblies. This is less memory efficient because it requires an > assembly and type object for every command you wish to add. It is a lot > faster than you might expect. > > Attached are two files. One is 'generate.py'. It has a function called > 'Generate' which compiles C# using the CodeDom API with the > CSharpCodeProvider. > > As an example I have provided another file - DllImport.py. This uses > Generate to compile the C# from my screenshot example : > > http://www.voidspace.org.uk/ironpython/winforms/part10.shtml > > It works fine. :-) > > The specific call is : > > assembly = Generate(unmanaged_code, 'UnamangedCode', inMemory=True) > clr.AddReference(assembly) > from UnmanagedCode import User32, GDI32 > > (You can also use it to save assemblies to disk.) > > For your use you will need to pass in a list of references (absolute > file paths) to the AutoCAD DLLs that your C# code is dependent on. > > I think you need to generate C# code that looks something like: > > > using Autodesk.AutoCAD.ApplicationServices; > using Autodesk.AutoCAD.DatabaseServices; > using Autodesk.AutoCAD.EditorInput; > using Autodesk.AutoCAD.Runtime; > > namespace AutoCADStuff > > { > public class AutoCADStuffBase > { > [CommandMethod("myname")] > public void method > { > _method(); > } > > public virtual void _method > { > return null; > } > } > > In IronPython you can call 'Generate', then import and subclass > AutoCADStuffBase and override '_method': > > class AutoCADStuff(AutoCADStuffBase): > def _method(self): > some code ... > > I have used this approach with Silverlight assemblies for creating > classes with methods marked with attributes. > > I hope this helps. > > Please no one post this code as is - I'll write up and post an article > shortly. :-) > > Michael Foord > > Michael Foord wrote: > > Tim Riley wrote: > > [snip..] > > > >> AutoCAD's .NET API allows > >> you to register a command that is callable from the AutoCAD via a CommandMethod attribute[1]. Since IP doesn't support attributes I'd like to develop some sort of decorator that would clone the functionality of the CommandMethod attribute. So I could execute > >> python code like: > >> > >> @commandmethod("test") > >> def tester: > >> print "test worked" > >> > >> and it would register the test command so I could call it from the > >> command line. > >> > >> > >> > > > > Right - so you want to dynamically create methods (or functions) with > > attributes. The attribute takes the name that the command will be > > exposed with. > > > > I wonder if AutoCAD even supports these being dynamically created? > > > > If it does I wonder if we can do it by creating an inner class in C#. > > The method marked with the attribute would call down to another method > > (marked as virtual) that we can override from IronPython. > > > > I'm not exactly sure of the C# syntax/semantics for inner classes - (a > > class factory) - so I'll have to do some digging. (i.e. will it allow us > > to set the argument to the attribute at runtime rather than compile time > > and can we return classes or only instances.) > > > > AFAIK, attributes are normally bound at compile time rather than > > runtime, so using C# to create classes in this way may not work. > > > > The proper way (*sigh*) is to use the Reflection.Emit API to add > > attributes. I've experimented Reflection.Emit - but never got as far as > > adding attributes dynamically. (You need to 'program in bytecode' using > > this API - which isn't too bad but has a bit of a learning curve > > associated.) > > > > A *third* approach is to dynamically generate C# and compile to in > > memory assemblies (using the CodeDOM API if I remember correctly). That > > turns out to be surprisingly easy. > > > > Michael Foord > > http://www.voidspace.org.uk/ironpython/index.shtml > > > > > >> [1] As an example: > >> http://through-the-interface.typepad.com/through_the_interface/2007/07/updating-a-spec.html > >> > >> > >> Tim > >> > >> On 7/23/07, Michael Foord wrote: > >> > >> > >>> Tim Riley wrote: > >>> > >>> > >>>> Michael: > >>>> > >>>> Thanks for the reply. However when reading it my eyes glazed over. Is > >>>> there any way you could provide a simple man like myself with some > >>>> example code for me to peruse? > >>>> > >>>> > >>>> > >>> What do you want to achieve? Write the IronPython code you would like - > >>> and I will try and provide a C# stub that you can subclass. (You will > >>> need a C# compiler - Visual Studio Express C# is probably the most > >>> straightforward if you are using Windows.) > >>> > >>> Michael Foord > >>> http://www.voidspace.org.uk/ironpython/index.shtml > >>> > >>> > >>> > >>>> Tim > >>>> > >>>> On 7/23/07, Michael Foord wrote: > >>>> > >>>> > >>>> > >>>>> Tim Riley wrote: > >>>>> > >>>>> > >>>>> > >>>>>> I know that IronPython doesn't support attributes but does anyone know > >>>>>> of a workaround that will allow IP code to use them? > >>>>>> > >>>>>> > >>>>>> > >>>>>> > >>>>> The IronPython team are strangely quiet every time someone asks this... ;-) > >>>>> > >>>>> A lot of people would like an answer to this question. Currently the > >>>>> only way is to use stub C# classes. > >>>>> > >>>>> Michael Foord > >>>>> http://www.voidspace.org.uk/ironpython/index.shtml > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>>> _______________________________________________ > >>>>>> users mailing list > >>>>>> users at lists.ironpython.com > >>>>>> http://lists.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 > > > > > > > import clr > clr.AddReference('System.Drawing') > > from System.Drawing import Bitmap, Image > > from generate import Generate, LoadAssembly > > > unmanaged_code = """ > using System; > using System.Collections.Generic; > using System.Text; > using System.Runtime.InteropServices; > > namespace UnmanagedCode > { > public class GDI32 > { > [DllImport("GDI32.dll")] > public static extern IntPtr CreateCompatibleDC(IntPtr hdc); > > [DllImport("GDI32.dll")] > public static extern IntPtr CreateCompatibleBitmap(IntPtr hdc, int nWidth, > int nHeight); > > [DllImport("GDI32.dll")] > public static extern IntPtr SelectObject(IntPtr hdc, IntPtr hgdiobj); > > [DllImport("GDI32.dll")] > public static extern bool BitBlt(IntPtr hdcDest, int nXDest, int nYDest, > int nWidth, int nHeight, IntPtr hdcSrc, > int nXSrc, int nYSrc, int dwRop); > > [DllImport("GDI32.dll")] > public static extern bool DeleteDC(IntPtr hdc); > > [DllImport("GDI32.dll")] > public static extern bool DeleteObject(IntPtr hObject); > } > > public class User32 > { > [DllImport("user32.dll")] > public static extern IntPtr GetDesktopWindow(); > > [DllImport("user32.dll")] > public static extern IntPtr GetTopWindow(IntPtr hWnd); > > [DllImport("user32.dll")] > public static extern IntPtr GetWindow(IntPtr hWnd, uint wCmd); > > [DllImport("User32.dll")] > public static extern IntPtr GetWindowDC(IntPtr hWnd); > > [DllImport("User32.dll")] > public static extern IntPtr ReleaseDC(IntPtr hWnd, IntPtr hDC); > > } > } > """ > > assembly = Generate(unmanaged_code, 'UnamangedCode', inMemory=True) > > clr.AddReference(assembly) > > from UnmanagedCode import User32, GDI32 > > def ScreenCapture(x, y, width, height): > hdcSrc = User32.GetWindowDC(User32.GetDesktopWindow()) > hdcDest = GDI32.CreateCompatibleDC(hdcSrc) > hBitmap = GDI32.CreateCompatibleBitmap(hdcSrc, width, height) > GDI32.SelectObject(hdcDest, hBitmap) > > # 0x00CC0020 is the magic number for a copy raster operation > GDI32.BitBlt(hdcDest, 0, 0, width, height, hdcSrc, x, y, 0x00CC0020) > result = Bitmap(Image.FromHbitmap(hBitmap)) > User32.ReleaseDC(User32.GetDesktopWindow(), hdcSrc) > GDI32.DeleteDC(hdcDest) > GDI32.DeleteObject(hBitmap) > return result > > image = ScreenCapture(0, 0, 50, 400) > for y in range(image.Height): > row = [] > for x in range(image.Width): > color = image.GetPixel(x, y) > value = color.R + color.G + color.B > if value > 384: > row.append(' ') > else: > row.append('X') > print ''.join(row) > > import clr > > from System.Environment import CurrentDirectory > from System.IO import Path, Directory > > from System.CodeDom import Compiler > from Microsoft.CSharp import CSharpCodeProvider > > > def Generate(code, name, references=None, outputDirectory=None, inMemory=False): > CompilerParams = Compiler.CompilerParameters() > > if outputDirectory is None: > outputDirectory = Directory.GetCurrentDirectory() > if not inMemory: > CompilerParams.OutputAssembly = Path.Combine(outputDirectory, name + ".dll") > CompilerParams.GenerateInMemory = False > else: > CompilerParams.GenerateInMemory = True > > CompilerParams.TreatWarningsAsErrors = False > CompilerParams.GenerateExecutable = False > CompilerParams.CompilerOptions = "/optimize" > > for reference in references or []: > CompilerParams.ReferencedAssemblies.Add(reference) > > provider = CSharpCodeProvider() > compile = provider.CompileAssemblyFromSource(CompilerParams, code) > > if compile.Errors.HasErrors: > raise Exception("Compile error: %r" % list(compile.Errors.List)) > > if inMemory: > return compile.CompiledAssembly > return compile.PathToAssembly > > > def LoadAssembly(name, namespace=None): > clr.AddReference(name) > namespace = __import__(namespace or name) > return namespace > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > From aranguren at deneb.biz Tue Jul 24 04:11:27 2007 From: aranguren at deneb.biz (aranguren at deneb.biz) Date: Tue, 24 Jul 2007 04:11:27 +0200 Subject: [Users] Autoreply: Users Digest, Vol 36, Issue 35 Message-ID: I am on holiday till the 3th of August and won't be able to reply to your email. For any urgent matters please contact Laura Senent at laura at deneb.biz --------------------------------------------------------------------- This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful From stefan.dobrev at gmail.com Tue Jul 24 10:44:42 2007 From: stefan.dobrev at gmail.com (Stefan Dobrev) Date: Tue, 24 Jul 2007 11:44:42 +0300 Subject: [Users] [IronPython] IronPython Attribute Workaround In-Reply-To: References: <46A500E1.6030001@voidspace.org.uk> <46A505E7.4090407@voidspace.org.uk> <46A5104A.8020703@voidspace.org.uk> <46A53532.2040006@voidspace.org.uk> Message-ID: <928de89c0707240144m7727a605ufe302187f3c3bd7d@mail.gmail.com> Can't a Dependency Injection Framework (Spring.NET or Policy Injection Application Block from Enterprise Library 3.0) be used for injecting the required attributes. I'm note sure that this will work. Does anyone had used them with IronPython previously? 2007/7/24, Tim Riley : > > Michael: > > Earlier today I was doing some digging using Lutz Roeder's .NET > Reflector and it seems that the CommandMethod attribute registers the > command using the acmgd.Autodesk.AutoCAD.Runtime.ICommandLineCallable > interface. As I can tap into any other aspect of AutoCAD's .NET api > via ironpython I'm going to assume that I can somehow tap into this > and register a command. The only problem is I don't have a clue > how...yet. > > If you want to take a look at what C# code I have so far you can find > it @ http://pyacaddotnet.googlecode.com/svn/trunk/PyAcadDotNet.cs > > Also I have some (lousy) samples that I use for testing IronPython in > AutoCAD. You can find them here: > http://pyacaddotnet.googlecode.com/svn/trunk/Samples/ > > Tim > > On 7/23/07, Michael Foord wrote: > > I'm pretty sure that it is impossible to dynamically generate classes > > decorated with attributes at runtime using 'pure C#'. > > > > The two alternatives are either to use the Reflection.Emit API - which > > is probably the best way but requires more digging than I have time for > > at this point in time. > > > > Another alternative is to dynamically generate C# and compile to in > > memory assemblies. This is less memory efficient because it requires an > > assembly and type object for every command you wish to add. It is a lot > > faster than you might expect. > > > > Attached are two files. One is 'generate.py'. It has a function called > > 'Generate' which compiles C# using the CodeDom API with the > > CSharpCodeProvider. > > > > As an example I have provided another file - DllImport.py. This uses > > Generate to compile the C# from my screenshot example : > > > > http://www.voidspace.org.uk/ironpython/winforms/part10.shtml > > > > It works fine. :-) > > > > The specific call is : > > > > assembly = Generate(unmanaged_code, 'UnamangedCode', inMemory=True) > > clr.AddReference(assembly) > > from UnmanagedCode import User32, GDI32 > > > > (You can also use it to save assemblies to disk.) > > > > For your use you will need to pass in a list of references (absolute > > file paths) to the AutoCAD DLLs that your C# code is dependent on. > > > > I think you need to generate C# code that looks something like: > > > > > > using Autodesk.AutoCAD.ApplicationServices; > > using Autodesk.AutoCAD.DatabaseServices; > > using Autodesk.AutoCAD.EditorInput; > > using Autodesk.AutoCAD.Runtime; > > > > namespace AutoCADStuff > > > > { > > public class AutoCADStuffBase > > { > > [CommandMethod("myname")] > > public void method > > { > > _method(); > > } > > > > public virtual void _method > > { > > return null; > > } > > } > > > > In IronPython you can call 'Generate', then import and subclass > > AutoCADStuffBase and override '_method': > > > > class AutoCADStuff(AutoCADStuffBase): > > def _method(self): > > some code ... > > > > I have used this approach with Silverlight assemblies for creating > > classes with methods marked with attributes. > > > > I hope this helps. > > > > Please no one post this code as is - I'll write up and post an article > > shortly. :-) > > > > Michael Foord > > > > Michael Foord wrote: > > > Tim Riley wrote: > > > [snip..] > > > > > >> AutoCAD's .NET API allows > > >> you to register a command that is callable from the AutoCAD via a > CommandMethod attribute[1]. Since IP doesn't support attributes I'd like to > develop some sort of decorator that would clone the functionality of the > CommandMethod attribute. So I could execute > > >> python code like: > > >> > > >> @commandmethod("test") > > >> def tester: > > >> print "test worked" > > >> > > >> and it would register the test command so I could call it from the > > >> command line. > > >> > > >> > > >> > > > > > > Right - so you want to dynamically create methods (or functions) with > > > attributes. The attribute takes the name that the command will be > > > exposed with. > > > > > > I wonder if AutoCAD even supports these being dynamically created? > > > > > > If it does I wonder if we can do it by creating an inner class in C#. > > > The method marked with the attribute would call down to another method > > > (marked as virtual) that we can override from IronPython. > > > > > > I'm not exactly sure of the C# syntax/semantics for inner classes - (a > > > class factory) - so I'll have to do some digging. (i.e. will it allow > us > > > to set the argument to the attribute at runtime rather than compile > time > > > and can we return classes or only instances.) > > > > > > AFAIK, attributes are normally bound at compile time rather than > > > runtime, so using C# to create classes in this way may not work. > > > > > > The proper way (*sigh*) is to use the Reflection.Emit API to add > > > attributes. I've experimented Reflection.Emit - but never got as far > as > > > adding attributes dynamically. (You need to 'program in bytecode' > using > > > this API - which isn't too bad but has a bit of a learning curve > > > associated.) > > > > > > A *third* approach is to dynamically generate C# and compile to in > > > memory assemblies (using the CodeDOM API if I remember correctly). > That > > > turns out to be surprisingly easy. > > > > > > Michael Foord > > > http://www.voidspace.org.uk/ironpython/index.shtml > > > > > > > > >> [1] As an example: > > >> > http://through-the-interface.typepad.com/through_the_interface/2007/07/updating-a-spec.html > > >> > > >> > > >> Tim > > >> > > >> On 7/23/07, Michael Foord wrote: > > >> > > >> > > >>> Tim Riley wrote: > > >>> > > >>> > > >>>> Michael: > > >>>> > > >>>> Thanks for the reply. However when reading it my eyes glazed over. > Is > > >>>> there any way you could provide a simple man like myself with some > > >>>> example code for me to peruse? > > >>>> > > >>>> > > >>>> > > >>> What do you want to achieve? Write the IronPython code you would > like - > > >>> and I will try and provide a C# stub that you can subclass. (You > will > > >>> need a C# compiler - Visual Studio Express C# is probably the most > > >>> straightforward if you are using Windows.) > > >>> > > >>> Michael Foord > > >>> http://www.voidspace.org.uk/ironpython/index.shtml > > >>> > > >>> > > >>> > > >>>> Tim > > >>>> > > >>>> On 7/23/07, Michael Foord wrote: > > >>>> > > >>>> > > >>>> > > >>>>> Tim Riley wrote: > > >>>>> > > >>>>> > > >>>>> > > >>>>>> I know that IronPython doesn't support attributes but does anyone > know > > >>>>>> of a workaround that will allow IP code to use them? > > >>>>>> > > >>>>>> > > >>>>>> > > >>>>>> > > >>>>> The IronPython team are strangely quiet every time someone asks > this... ;-) > > >>>>> > > >>>>> A lot of people would like an answer to this question. Currently > the > > >>>>> only way is to use stub C# classes. > > >>>>> > > >>>>> Michael Foord > > >>>>> http://www.voidspace.org.uk/ironpython/index.shtml > > >>>>> > > >>>>> > > >>>>> > > >>>>> > > >>>>> > > >>>>>> _______________________________________________ > > >>>>>> users mailing list > > >>>>>> users at lists.ironpython.com > > >>>>>> http://lists.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 > > > > > > > > > > > > import clr > > clr.AddReference('System.Drawing') > > > > from System.Drawing import Bitmap, Image > > > > from generate import Generate, LoadAssembly > > > > > > unmanaged_code = """ > > using System; > > using System.Collections.Generic; > > using System.Text; > > using System.Runtime.InteropServices; > > > > namespace UnmanagedCode > > { > > public class GDI32 > > { > > [DllImport("GDI32.dll")] > > public static extern IntPtr CreateCompatibleDC(IntPtr hdc); > > > > [DllImport("GDI32.dll")] > > public static extern IntPtr CreateCompatibleBitmap(IntPtr hdc, > int nWidth, > > int nHeight); > > > > [DllImport("GDI32.dll")] > > public static extern IntPtr SelectObject(IntPtr hdc, IntPtr > hgdiobj); > > > > [DllImport("GDI32.dll")] > > public static extern bool BitBlt(IntPtr hdcDest, int nXDest, int > nYDest, > > int nWidth, int nHeight, IntPtr > hdcSrc, > > int nXSrc, int nYSrc, int > dwRop); > > > > [DllImport("GDI32.dll")] > > public static extern bool DeleteDC(IntPtr hdc); > > > > [DllImport("GDI32.dll")] > > public static extern bool DeleteObject(IntPtr hObject); > > } > > > > public class User32 > > { > > [DllImport("user32.dll")] > > public static extern IntPtr GetDesktopWindow(); > > > > [DllImport("user32.dll")] > > public static extern IntPtr GetTopWindow(IntPtr hWnd); > > > > [DllImport("user32.dll")] > > public static extern IntPtr GetWindow(IntPtr hWnd, uint wCmd); > > > > [DllImport("User32.dll")] > > public static extern IntPtr GetWindowDC(IntPtr hWnd); > > > > [DllImport("User32.dll")] > > public static extern IntPtr ReleaseDC(IntPtr hWnd, IntPtr hDC); > > > > } > > } > > """ > > > > assembly = Generate(unmanaged_code, 'UnamangedCode', inMemory=True) > > > > clr.AddReference(assembly) > > > > from UnmanagedCode import User32, GDI32 > > > > def ScreenCapture(x, y, width, height): > > hdcSrc = User32.GetWindowDC(User32.GetDesktopWindow()) > > hdcDest = GDI32.CreateCompatibleDC(hdcSrc) > > hBitmap = GDI32.CreateCompatibleBitmap(hdcSrc, width, height) > > GDI32.SelectObject(hdcDest, hBitmap) > > > > # 0x00CC0020 is the magic number for a copy raster operation > > GDI32.BitBlt(hdcDest, 0, 0, width, height, hdcSrc, x, y, 0x00CC0020) > > result = Bitmap(Image.FromHbitmap(hBitmap)) > > User32.ReleaseDC(User32.GetDesktopWindow(), hdcSrc) > > GDI32.DeleteDC(hdcDest) > > GDI32.DeleteObject(hBitmap) > > return result > > > > image = ScreenCapture(0, 0, 50, 400) > > for y in range(image.Height): > > row = [] > > for x in range(image.Width): > > color = image.GetPixel(x, y) > > value = color.R + color.G + color.B > > if value > 384: > > row.append(' ') > > else: > > row.append('X') > > print ''.join(row) > > > > import clr > > > > from System.Environment import CurrentDirectory > > from System.IO import Path, Directory > > > > from System.CodeDom import Compiler > > from Microsoft.CSharp import CSharpCodeProvider > > > > > > def Generate(code, name, references=None, outputDirectory=None, > inMemory=False): > > CompilerParams = Compiler.CompilerParameters() > > > > if outputDirectory is None: > > outputDirectory = Directory.GetCurrentDirectory() > > if not inMemory: > > CompilerParams.OutputAssembly = Path.Combine(outputDirectory, > name + ".dll") > > CompilerParams.GenerateInMemory = False > > else: > > CompilerParams.GenerateInMemory = True > > > > CompilerParams.TreatWarningsAsErrors = False > > CompilerParams.GenerateExecutable = False > > CompilerParams.CompilerOptions = "/optimize" > > > > for reference in references or []: > > CompilerParams.ReferencedAssemblies.Add(reference) > > > > provider = CSharpCodeProvider() > > compile = provider.CompileAssemblyFromSource(CompilerParams, code) > > > > if compile.Errors.HasErrors: > > raise Exception("Compile error: %r" % list(compile.Errors.List)) > > > > if inMemory: > > return compile.CompiledAssembly > > return compile.PathToAssembly > > > > > > def LoadAssembly(name, namespace=None): > > clr.AddReference(name) > > namespace = __import__(namespace or name) > > return namespace > > > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.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 aranguren at deneb.biz Tue Jul 24 10:44:58 2007 From: aranguren at deneb.biz (aranguren at deneb.biz) Date: Tue, 24 Jul 2007 10:44:58 +0200 Subject: [Users] Autoreply: Users Digest, Vol 36, Issue 36 Message-ID: I am on holiday till the 3th of August and won't be able to reply to your email. For any urgent matters please contact Laura Senent at laura at deneb.biz --------------------------------------------------------------------- This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful From Jim.Hugunin at microsoft.com Tue Jul 24 19:12:25 2007 From: Jim.Hugunin at microsoft.com (Jim Hugunin) Date: Tue, 24 Jul 2007 10:12:25 -0700 Subject: [IronPython] Mailing List Archives Gone Private ? In-Reply-To: <918705E903F4714CB713D89AB5F1857D6E64B74807@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <46A553C3.4090800@voidspace.org.uk> <46A556C0.1020100@holdenweb.com> <46A55758.7060909@voidspace.org.uk> <918705E903F4714CB713D89AB5F1857D6E64B74807@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: I believe that I fixed both the private archive and the header issues. I'm still looking into what happened with my hosting service (dreamhost) last night to cause this and avoid it in the future. A mailman upgrade does sound like the most likely cause. Thanks - Jim -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of John Messerly Sent: Monday, July 23, 2007 6:47 PM To: Discussion of IronPython Subject: Re: [Users] Mailing List Archives Gone Private ? I'm sure it was accidental :). I'll see if I can get someone to fix it. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Monday, July 23, 2007 6:35 PM To: Discussion of IronPython Subject: Re: [Users] Mailing List Archives Gone Private ? Steve Holden wrote: > Michael Foord wrote: > >> Hello all, >> >> It seems like the archive for this mailing list just became private... wtf? >> >> If you go to the list page: >> >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> and click on the archives link, it takes you to a sign-in page and is >> now for subscribers only. >> >> That means that it won't be indexed by google and we can't search it... >> >> I'm sure this is a mistake - unintended consequence of a mailman upgrade >> perhaps? >> >> > As a new subscriber I see that the messages from this list appear with > the rather unhelpful list designation "[Users]" in the subject line. It > may be too late to amend this now everyone already joined up has set > their filters appropriately, but "[IronPython Users]" would be much more > user-friendly (and slightly less egocentric ;-) > It *was* set to [IronPython] - but changed at the same time that the archive went private. Looks like another error. As a result people's filters *are* now broken and we're getting spammed with auto-responders... :-) Michael > regards > Steve > _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From rdawson at exchange.microsoft.com Tue Jul 24 20:13:57 2007 From: rdawson at exchange.microsoft.com (Ryan Dawson) Date: Tue, 24 Jul 2007 11:13:57 -0700 Subject: [IronPython] Recent Check-Ins In-Reply-To: <5b0248170707230634x7603c369g94e60d014489aa47@mail.gmail.com> References: <5b0248170707230634x7603c369g94e60d014489aa47@mail.gmail.com> Message-ID: <50B69702CA6E6D4E849D30CD4989AB8E977C63EFB2@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Hey Seo, the very latest source is now in the Codeplex repository. Have been out of town or I would've synchronized a push with the IronRuby release. Sorry for the delay. -Ryan -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Sanghyeon Seo Sent: Monday, July 23, 2007 6:35 AM To: Discussion of IronPython Subject: [IronPython] Recent Check-Ins I suspect the "automation" mentioned last month isn't fixed after all. http://lists.ironpython.com/pipermail/users-ironpython.com/2007-June/005099.html John Lam posted IronRuby Pre Alpha 1 code on his site, and diffing its Microsoft.Scripting directory against one from IronPython 2.0 Alpha 2 I get: 92 files changed, 2847 insertions(+), 1035 deletions(-) Here is the command I used: $ diff -I @microsoft.com -urN IronPython-2.0A2/Src/Microsoft.Scripting IronRuby-Pre-Alpha1/Src/Microsoft.Scripting | diffstat -I options is there to ignore mail address changes from ironpy at microsoft.com to ironruby at microsoft.com. -- Seo Sanghyeon _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From nicholson.jon at gmail.com Tue Jul 24 23:52:17 2007 From: nicholson.jon at gmail.com (Jon Nicholson) Date: Tue, 24 Jul 2007 14:52:17 -0700 Subject: [IronPython] Py 2.5 bindings for SVN 1.4.4 Message-ID: <29ede7810707241452v699dde54oa3f744627948ccbd@mail.gmail.com> I'd like to use IronPython 1.1 to write a deployment script for an upcoming web project. All of the files for the site are stored in an SVN repository. I'm wondering if IronPython is capable of interfacing with the Python 2.5bindings for SVN 1.4.4. I have everything installed on a sandbox, but so far I have not had any luck so far--but then, I am new to Python (Iron, Bronze, what have you). Does anyone know of a way to do this? As a follow-up question, should I use the SVN API or some other method? All I am really looking to do is read the files to be deployed from an XML file, find the latest version of the corresponding files in the repository, and then FTP these up to the web servers. I basically have been trying to decide among the following three options: 1) Use IronPython and the SVN API. 2) Use IronPython and Powershell to interact with the svn executable. 3) Use IronPython to interact with the console and issue commands to the svn executable. Any thoughts on which of these make the most sense? Jon -------------- next part -------------- An HTML attachment was scrubbed... URL: From curt at hagenlocher.org Wed Jul 25 00:00:56 2007 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Tue, 24 Jul 2007 15:00:56 -0700 Subject: [IronPython] Py 2.5 bindings for SVN 1.4.4 In-Reply-To: <29ede7810707241452v699dde54oa3f744627948ccbd@mail.gmail.com> References: <29ede7810707241452v699dde54oa3f744627948ccbd@mail.gmail.com> Message-ID: On 7/24/07, Jon Nicholson wrote: > > I'd like to use IronPython 1.1 to write a deployment script for an > upcoming web project. All of the files for the site are stored in an SVN > repository. I'm wondering if IronPython is capable of interfacing with the > Python 2.5 bindings for SVN 1.4.4. > I would guess not, as that's almost certainly reliant on C extensions. What you probably want are .NET bindings for SVN. There don't seem to be any "official" ones, but you might try the project at http://www.pumacode.org/projects/svndotnet/ -- Curt Hagenlocher curt at hagenlocher.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Wed Jul 25 00:02:16 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 24 Jul 2007 23:02:16 +0100 Subject: [IronPython] Py 2.5 bindings for SVN 1.4.4 In-Reply-To: <29ede7810707241452v699dde54oa3f744627948ccbd@mail.gmail.com> References: <29ede7810707241452v699dde54oa3f744627948ccbd@mail.gmail.com> Message-ID: <46A676E8.3070706@voidspace.org.uk> Hello Jon, Almost inevitably the Python SVN bindings will be for CPython and *not* work for IronPython (but check this). Interacting with the executable will be fine for many purposes (we do this a bit in our build process to get revision numbers and checkin messages etc). No need to go through Powershell though. Use System.Diagnostics.Process Otherwise look for a .NET SVN interface. Michael Foord http://www.voidspace.org.uk/ironpython/index.shtml Jon Nicholson wrote: > I'd like to use IronPython 1.1 to write a deployment script for an > upcoming web project. All of the files for the site are stored in an > SVN repository. I'm wondering if IronPython is capable of interfacing > with the Python 2.5 bindings for SVN 1.4.4. I have everything > installed on a sandbox, but so far I have not had any luck so far--but > then, I am new to Python (Iron, Bronze, what have you). Does anyone > know of a way to do this? As a follow-up question, should I use the > SVN API or some other method? All I am really looking to do is read > the files to be deployed from an XML file, find the latest version of > the corresponding files in the repository, and then FTP these up to > the web servers. I basically have been trying to decide among the > following three options: > > 1) Use IronPython and the SVN API. > 2) Use IronPython and Powershell to interact with the svn executable. > 3) Use IronPython to interact with the console and issue commands to > the svn executable. > > Any thoughts on which of these make the most sense? > > Jon > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From nicholson.jon at gmail.com Wed Jul 25 00:34:36 2007 From: nicholson.jon at gmail.com (Jon Nicholson) Date: Tue, 24 Jul 2007 15:34:36 -0700 Subject: [IronPython] Py 2.5 bindings for SVN 1.4.4 In-Reply-To: <46A676E8.3070706@voidspace.org.uk> References: <29ede7810707241452v699dde54oa3f744627948ccbd@mail.gmail.com> <46A676E8.3070706@voidspace.org.uk> Message-ID: <29ede7810707241534o6e7abc6cy671c50363188dbb4@mail.gmail.com> Okay, that was what I suspected. I'll take a look at the SVN.NET project Curt mentioned and also System.Diagnostics.Process. I had forgotten about that namespace, but now that you bring it up, I think that will probably be sufficient for what we're doing. Thank you for the help, Jon On 7/24/07, Michael Foord wrote: > > Hello Jon, > > Almost inevitably the Python SVN bindings will be for CPython and *not* > work for IronPython (but check this). > > Interacting with the executable will be fine for many purposes (we do > this a bit in our build process to get revision numbers and checkin > messages etc). No need to go through Powershell though. Use > System.Diagnostics.Process > > Otherwise look for a .NET SVN interface. > > Michael Foord > http://www.voidspace.org.uk/ironpython/index.shtml > > Jon Nicholson wrote: > > I'd like to use IronPython 1.1 to write a deployment script for an > > upcoming web project. All of the files for the site are stored in an > > SVN repository. I'm wondering if IronPython is capable of interfacing > > with the Python 2.5 bindings for SVN 1.4.4. I have everything > > installed on a sandbox, but so far I have not had any luck so far--but > > then, I am new to Python (Iron, Bronze, what have you). Does anyone > > know of a way to do this? As a follow-up question, should I use the > > SVN API or some other method? All I am really looking to do is read > > the files to be deployed from an XML file, find the latest version of > > the corresponding files in the repository, and then FTP these up to > > the web servers. I basically have been trying to decide among the > > following three options: > > > > 1) Use IronPython and the SVN API. > > 2) Use IronPython and Powershell to interact with the svn executable. > > 3) Use IronPython to interact with the console and issue commands to > > the svn executable. > > > > Any thoughts on which of these make the most sense? > > > > Jon > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- Jon Nicholson nicholson.jon at gmail.com http://reformedworldview.solideogloria.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From doublestop at gmail.com Wed Jul 25 03:42:02 2007 From: doublestop at gmail.com (Michael Robinson) Date: Tue, 24 Jul 2007 18:42:02 -0700 Subject: [IronPython] Mailing List Archives Gone Private ? In-Reply-To: References: <46A553C3.4090800@voidspace.org.uk> <46A556C0.1020100@holdenweb.com> <46A55758.7060909@voidspace.org.uk> <918705E903F4714CB713D89AB5F1857D6E64B74807@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: No worries, it happens! What fun would life be without a few surprises here and there. Besides, most of us would be out of work if things always worked as expected. :) Thank you very much for managing the list. Cheers, Michael On 7/24/07, Jim Hugunin wrote: > I believe that I fixed both the private archive and the header issues. I'm still looking into what happened with my hosting service (dreamhost) last night to cause this and avoid it in the future. A mailman upgrade does sound like the most likely cause. > > Thanks - Jim > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of John Messerly > Sent: Monday, July 23, 2007 6:47 PM > To: Discussion of IronPython > Subject: Re: [Users] Mailing List Archives Gone Private ? > > I'm sure it was accidental :). I'll see if I can get someone to fix it. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Monday, July 23, 2007 6:35 PM > To: Discussion of IronPython > Subject: Re: [Users] Mailing List Archives Gone Private ? > > Steve Holden wrote: > > Michael Foord wrote: > > > >> Hello all, > >> > >> It seems like the archive for this mailing list just became private... wtf? > >> > >> If you go to the list page: > >> > >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > >> > >> and click on the archives link, it takes you to a sign-in page and is > >> now for subscribers only. > >> > >> That means that it won't be indexed by google and we can't search it... > >> > >> I'm sure this is a mistake - unintended consequence of a mailman upgrade > >> perhaps? > >> > >> > > As a new subscriber I see that the messages from this list appear with > > the rather unhelpful list designation "[Users]" in the subject line. It > > may be too late to amend this now everyone already joined up has set > > their filters appropriately, but "[IronPython Users]" would be much more > > user-friendly (and slightly less egocentric ;-) > > > > It *was* set to [IronPython] - but changed at the same time that the > archive went private. > > Looks like another error. As a result people's filters *are* now broken > and we're getting spammed with auto-responders... :-) > > Michael > > > regards > > Steve > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.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 Fri Jul 27 02:13:53 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Thu, 26 Jul 2007 17:13:53 -0700 Subject: [IronPython] IronPython v2.0 Alpha 3 Released! Message-ID: <7AD436E4270DD54A94238001769C2227B8262D6170@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Hello IronPython Community, We have just released IronPython 2.0 Alpha 3. This release is a snapshot of the on-going progress with IronPython 2.0 and the DLR. The most significant changes in this release include more work to use dynamic sites from IronPython and improved evaluation mode support. This release is also timed to closely coincide with the IronRuby release and provides a near-identical DLR release. The improved support for dynamic sites from IronPython has resulted in a performance improvement for a number of scenarios including method lookup, indexing operations, and member access. We expect future releases to continue with this trend to get improved performance in future versions. There are no significant changes to the underlying dynamic site infrastructure in this release but we expect some changes there which will also improve performance in future releases. This release also contains near complete support for evaluation support. There are now only a handful of corner cases where evaluation support is incomplete. Evaluation support enables the DLR to interpret code instead of compiling it and executing it resulting in faster run times for code that is executed once or rarely executed at all. There are also a number of small tweaks to the underlying DLR infrastructure as it continues to evolve. None of the changes in this release are radical and most external language implementations should be able to easily move from Alpha 2 to Alpha 3. Note: Again due to dependencies upon APIs that are not present in Silverlight 1.1 Alpha (released at MIX) you won't be able to re-build this release for use with Silverlight. As both products stabilize more we expect better compatibility between releases. You can download IronPython v2.0 Alpha 3 at http://www.codeplex.com/IronPython/Release/ProjectReleases.aspx?ReleaseId=3749 -------------- next part -------------- An HTML attachment was scrubbed... URL: From kfarmer at thuban.org Fri Jul 27 03:56:23 2007 From: kfarmer at thuban.org (Keith J. Farmer) Date: Thu, 26 Jul 2007 18:56:23 -0700 Subject: [IronPython] IronPython v2.0 Alpha 3 Released! References: <7AD436E4270DD54A94238001769C2227B8262D6170@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: Is this DLR compatible with IronRuby's? Also, below you mention different paths for code execution. Does the DLR analyze the code to make that determination, or is there a way we can hint the runtime to say "This code block can be interpreted."? ________________________________ From: users-bounces at lists.ironpython.com on behalf of Dino Viehland Sent: Thu 7/26/2007 5:13 PM To: Discussion of IronPython Subject: [IronPython] IronPython v2.0 Alpha 3 Released! This release also contains near complete support for evaluation support. There are now only a handful of corner cases where evaluation support is incomplete. Evaluation support enables the DLR to interpret code instead of compiling it and executing it resulting in faster run times for code that is executed once or rarely executed at all. -------------- next part -------------- A non-text attachment was scrubbed... Name: winmail.dat Type: application/ms-tnef Size: 4383 bytes Desc: not available URL: From dinov at exchange.microsoft.com Fri Jul 27 04:12:22 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Thu, 26 Jul 2007 19:12:22 -0700 Subject: [IronPython] IronPython v2.0 Alpha 3 Released! In-Reply-To: References: <7AD436E4270DD54A94238001769C2227B8262D6170@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <7AD436E4270DD54A94238001769C2227B8262D61AB@DF-GRTDANE-MSG.exchange.corp.microsoft.com> The two DLRs shipped between IronPython and IronRuby are about 1 day apart - so they should almost be identical. We did bump the version on the IronPython release so they're not actually drop-in replacements for each other. Currently evaluation mode needs to be flipped on and it's a rather global option (-X:FastEval at the command line if you want to play with it although it's not yet exactly "fast"). It will disable its self when it detects it can't handle a certain construct (currently that's generator functions). I'm not sure what the balance will end up being on whether we'll have hints or if we'll try and detect it or a combination of both. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Keith J. Farmer Sent: Thursday, July 26, 2007 6:56 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython v2.0 Alpha 3 Released! Is this DLR compatible with IronRuby's? Also, below you mention different paths for code execution. Does the DLR analyze the code to make that determination, or is there a way we can hint the runtime to say "This code block can be interpreted."? ________________________________ From: users-bounces at lists.ironpython.com on behalf of Dino Viehland Sent: Thu 7/26/2007 5:13 PM To: Discussion of IronPython Subject: [IronPython] IronPython v2.0 Alpha 3 Released! This release also contains near complete support for evaluation support. There are now only a handful of corner cases where evaluation support is incomplete. Evaluation support enables the DLR to interpret code instead of compiling it and executing it resulting in faster run times for code that is executed once or rarely executed at all. -------------- next part -------------- An HTML attachment was scrubbed... URL: From t-jlee at microsoft.com Fri Jul 27 04:45:29 2007 From: t-jlee at microsoft.com (Jacob Lee) Date: Thu, 26 Jul 2007 19:45:29 -0700 Subject: [IronPython] IronPython v2.0 Alpha 3 Released! In-Reply-To: <7AD436E4270DD54A94238001769C2227B8262D61AB@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <7AD436E4270DD54A94238001769C2227B8262D6170@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <7AD436E4270DD54A94238001769C2227B8262D61AB@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <8941DB94DBBD2B4D8B1B5047577FF98E2FBC788897@NA-EXMSG-C110.redmond.corp.microsoft.com> I just want to emphasize that -X:FastEval is not yet ready for production use. It's really only been tested on Python, and besides it being slow, it is not yet 100% correct. Play at your own risk :-). -- Jacob Lee SDE Intern, Dynamic Language Runtime From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Thursday, July 26, 2007 7:12 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython v2.0 Alpha 3 Released! The two DLRs shipped between IronPython and IronRuby are about 1 day apart - so they should almost be identical. We did bump the version on the IronPython release so they're not actually drop-in replacements for each other. Currently evaluation mode needs to be flipped on and it's a rather global option (-X:FastEval at the command line if you want to play with it although it's not yet exactly "fast"). It will disable its self when it detects it can't handle a certain construct (currently that's generator functions). I'm not sure what the balance will end up being on whether we'll have hints or if we'll try and detect it or a combination of both. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Keith J. Farmer Sent: Thursday, July 26, 2007 6:56 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython v2.0 Alpha 3 Released! Is this DLR compatible with IronRuby's? Also, below you mention different paths for code execution. Does the DLR analyze the code to make that determination, or is there a way we can hint the runtime to say "This code block can be interpreted."? ________________________________ From: users-bounces at lists.ironpython.com on behalf of Dino Viehland Sent: Thu 7/26/2007 5:13 PM To: Discussion of IronPython Subject: [IronPython] IronPython v2.0 Alpha 3 Released! This release also contains near complete support for evaluation support. There are now only a handful of corner cases where evaluation support is incomplete. Evaluation support enables the DLR to interpret code instead of compiling it and executing it resulting in faster run times for code that is executed once or rarely executed at all. -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt at geneity.co.uk Fri Jul 27 17:15:18 2007 From: matt at geneity.co.uk (Matt Williams) Date: Fri, 27 Jul 2007 16:15:18 +0100 Subject: [IronPython] System.Reflection.Assembly finding python modules but no classes.. Message-ID: <46AA0C06.7090403@geneity.co.uk> I'm working on an IronPython project in Visual Studio. I'm attempting to use some 3rd party code that's written using Microsoft Application Blocks. This code is attempting to instantiate my IronPython classes dynamically from Microsoft.ApplicationBlocks.UIProcess.GenericFactory. It would appear that the factory is making calls to load the IronPython assembly, then using reflection to load/instantiate and return the specified class. This is causing a problem. It would appear that the IronPython assembly does not have any knowledge of classes contained in the python modules. I've narrowed the code down to the following: The project is building an assembly called 'UIPython', and it contains a python module 'Form1' which itself contains a python class called 'Form1' This code throws an exception: System.Reflection.Assembly.Load("UIPython,Version=1.0.0.0,Culture=neutral,PublicKeyToken=null" ) typeInstance = assemblyInstance.GetType('Form1.Form1', True, False) -- "Could not load type 'Form1.Form1' from assembly 'UIPython, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'." -- However, attempting to load the module appears to be fine: System.Reflection.Assembly.Load("UIPython,Version=1.0.0.0,Culture=neutral,PublicKeyToken=null" ) typeInstance = assemblyInstance.GetType('Form1', True, False) -- Interrogating the types in the assembly (assemblyInstance.GetTypes()) returns the modules, but none of the classes that are defined. I'd be very grateful for any suggestions.. Regards, Matt From curt at hagenlocher.org Fri Jul 27 17:28:16 2007 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Fri, 27 Jul 2007 08:28:16 -0700 Subject: [IronPython] System.Reflection.Assembly finding python modules but no classes.. In-Reply-To: <46AA0C06.7090403@geneity.co.uk> References: <46AA0C06.7090403@geneity.co.uk> Message-ID: On 7/27/07, Matt Williams wrote: > > > This code is attempting to instantiate my IronPython classes dynamically > from Microsoft.ApplicationBlocks.UIProcess.GenericFactory. > > It would appear that the factory is making calls to load the IronPython > assembly, then using reflection to load/instantiate and return the > specified class. Unfortunately, this won't work because Python classes aren't CLR classes -- they can't be, because Python classes are mutable in ways that CLR classes aren't. To load a Python-implemented class via reflection, you'd have to front-end it with a CLR class implemented in C#/VB/etc. -- Curt Hagenlocher curt at hagenlocher.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From garabatus at gmail.com Fri Jul 27 19:09:57 2007 From: garabatus at gmail.com (Garabatus Raptus) Date: Fri, 27 Jul 2007 13:09:57 -0400 Subject: [IronPython] M2Cryto Message-ID: Hi there, I would like to use M2Crypto (a wrapper for OpenSSL) with Ironpython. Any idea of how can I integrate it with Ironpython? thanxs gara From curt at hagenlocher.org Fri Jul 27 19:15:40 2007 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Fri, 27 Jul 2007 10:15:40 -0700 Subject: [IronPython] M2Cryto In-Reply-To: References: Message-ID: On 7/27/07, Garabatus Raptus wrote: > > > I would like to use M2Crypto (a wrapper for OpenSSL) with Ironpython. > Any idea of how can I integrate it with Ironpython? This is an extension to CPython written in C, which is therefore not compatible with IronPython. Depending on your application's requirements, you may be able to use the SslStream class that's built into the .NET Framework instead. -- Curt Hagenlocher curt at hagenlocher.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From xmlhacker at gmail.com Sat Jul 28 10:41:35 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Sat, 28 Jul 2007 02:41:35 -0600 Subject: [IronPython] Py 2.5 bindings for SVN 1.4.4 In-Reply-To: <29ede7810707241534o6e7abc6cy671c50363188dbb4@mail.gmail.com> References: <29ede7810707241452v699dde54oa3f744627948ccbd@mail.gmail.com> <46A676E8.3070706@voidspace.org.uk> <29ede7810707241534o6e7abc6cy671c50363188dbb4@mail.gmail.com> Message-ID: On 7/24/07, Jon Nicholson wrote: > > Okay, that was what I suspected. I'll take a look at the SVN.NET project > Curt mentioned and also System.Diagnostics.Process. > You might find AnkhSVN exactly what you are looking for > http://ankhsvn.tigris.org/ < It's a VS.NET plugin, but the assemblies are installed into the GAC and therefore easily accessible and easily referenced directly in your IronPython application. -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From xmlhacker at gmail.com Sat Jul 28 10:46:01 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Sat, 28 Jul 2007 02:46:01 -0600 Subject: [IronPython] IronPython v2.0 Alpha 3 Released! In-Reply-To: <7AD436E4270DD54A94238001769C2227B8262D6170@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <7AD436E4270DD54A94238001769C2227B8262D6170@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: SWEET! :D Thanks, Dino! (just getting back from OSCON so only now getting caught up with the latest news. A few photo's for those with interest > http://www.facebook.com/album.php?aid=10353&l=944b5&id=502036603 < (URI is publicly accessible)) On 7/26/07, Dino Viehland wrote: > > Hello IronPython Community, > > We have just released IronPython 2.0 Alpha 3. This release is a snapshot > of the on-going progress with IronPython 2.0 and the DLR. The most > significant changes in this release include more work to use dynamic sites > from IronPython and improved evaluation mode support. This release is also > timed to closely coincide with the IronRuby release and provides a > near-identical DLR release. > > > > The improved support for dynamic sites from IronPython has resulted in a > performance improvement for a number of scenarios including method lookup, > indexing operations, and member access. We expect future releases to > continue with this trend to get improved performance in future versions. > There are no significant changes to the underlying dynamic site > infrastructure in this release but we expect some changes there which will > also improve performance in future releases. > > > > This release also contains near complete support for evaluation support. > There are now only a handful of corner cases where evaluation support is > incomplete. Evaluation support enables the DLR to interpret code instead of > compiling it and executing it resulting in faster run times for code that is > executed once or rarely executed at all. > > > > There are also a number of small tweaks to the underlying DLR > infrastructure as it continues to evolve. None of the changes in this > release are radical and most external language implementations should be > able to easily move from Alpha 2 to Alpha 3. > > > > Note: Again due to dependencies upon APIs that are not present in > Silverlight 1.1 Alpha (released at MIX) you won't be able to re-build this > release for use with Silverlight. As both products stabilize more we expect > better compatibility between releases. > > > You can download IronPython v2.0 Alpha 3 at http://www.codeplex.com > /IronPython/Release/ProjectReleases.aspx?ReleaseId=3749 > > > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com > /listinfo.cgi/users-ironpython.com > > -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From xmlhacker at gmail.com Sat Jul 28 11:55:57 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Sat, 28 Jul 2007 03:55:57 -0600 Subject: [IronPython] Py 2.5 bindings for SVN 1.4.4 In-Reply-To: References: <29ede7810707241452v699dde54oa3f744627948ccbd@mail.gmail.com> <46A676E8.3070706@voidspace.org.uk> <29ede7810707241534o6e7abc6cy671c50363188dbb4@mail.gmail.com> Message-ID: On 7/28/07, M. David Peterson wrote: > > > > You might find AnkhSVN exactly what you are looking for > http://ankhsvn.tigris.org/ > < It's a VS.NET plugin, but the assemblies are installed into the GAC and > therefore easily accessible and easily referenced directly in your > IronPython application. > Also, if you want to extract just the assemblies without installing the plugin itself (for those of you who don't use VS.NET), downloaded the latest AnkhSVN release (at present time 1.0.1.2736), cd to wherever you saved the download and then run, msiexec /a AnkhSetup-1.0.1.2736-Final.msi TARGETDIR="C:\AnkhSVN" /qn Which, on Windows, will place the extracted assemblies in C:\AnkhSVN | Don't know of any MSI extraction utils on GNU/Linux|FreeBSD|Unix*|MacOSX, though I doubt no one has taken the time to create one, I just don't know of anybody who has. Anybody know if one exists? -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Sat Jul 28 15:03:24 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sat, 28 Jul 2007 14:03:24 +0100 Subject: [IronPython] Windows Forms on Mac OS X Message-ID: <46AB3E9C.7030101@voidspace.org.uk> Hello all, Has anyone had any success getting Windows Forms to work with IronPython and Mono on Mac OS X? Mono claims to support Windows Forms on Mac OS, but instantiating a form dies horribly (see below). I have the Apple X11 installed. Some (old) Winforms bug reports suggested I might need to add references to the config file - but these are already in place in the current release of Mono. Also - the bug on Mono where the backspace key doesn't work in the console (I realise this is the wrong place to complain about this) is really annoying. :-) IronPython 1.1a1 (1.1) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import clr >>> clr.AddReference('System.Windows.Forms') >>> from System.Windows.Forms import * >>> f = Form() Traceback (most recent call last): File System.Windows.Forms, line unknown, in .cctor File System.Windows.Forms, line unknown, in GetInstance File System.Windows.Forms, line unknown, in .ctor File System.Windows.Forms, line unknown, in SetDisplay File System.Windows.Forms, line unknown, in .ctor File System.Windows.Forms, line unknown, in .ctor File System.Windows.Forms, line unknown, in .ctor File System.Windows.Forms, line unknown, in .ctor File System.Windows.Forms, line unknown, in InternalSizeFromClientSize File System.Windows.Forms, line unknown, in get_CreateParams SystemError: An exception was thrown by the type initializer for System.Windows.Forms.XplatUI >>> All the best, Michael Foord http://www.ironpython.info From fuzzyman at voidspace.org.uk Sat Jul 28 15:06:18 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sat, 28 Jul 2007 14:06:18 +0100 Subject: [IronPython] [Bug] import System enables .NET methods Message-ID: <46AB3F4A.5010207@voidspace.org.uk> Hello all, My understanding was that 'import clr' in a module was supposed to enable .NET methods. 'import System' also has the same effect. Try the following (either from an interactive session or run as a program) in IronPython 1.1. import System print 'hello'.ToUpper() All the best, Michael Foord From fuzzyman at voidspace.org.uk Sat Jul 28 15:14:58 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sat, 28 Jul 2007 14:14:58 +0100 Subject: [IronPython] [Bug] Arrays are stripped of .NET methods / properties Message-ID: <46AB4152.4000801@voidspace.org.uk> Hello all, A bug in IronPython 1.1. This one has bitten us and it would be very nice to have it fixed. Create a .NET array in one module and then use it in another module that hasn't imported clr (or System) and it will be stripped of its .NET methods and properties. Importing clr fixes the problem, but shouldn't be necessary (right?). To see this, create a module called 'createArray.py': from System import Array def CreateArray(): return Array.CreateInstance(int, 2, 2) Then use the module from another IronPython program. E.g. : from createArray import CreateArray array = CreateArray() print array.Rank This results in the following error: C:\>ipy testArray.py Traceback (most recent call last): File C:\testArray.py, line 4, in Initialize AttributeError: 'Array[int]' object has no attribute 'Rank' If you add an import clr to the program then it does the right thing... Michael Foord http://www.ironpython.info From belred at gmail.com Sat Jul 28 16:35:12 2007 From: belred at gmail.com (Bryan) Date: Sat, 28 Jul 2007 07:35:12 -0700 Subject: [IronPython] creating web services Message-ID: <38f48f590707280735p60d22ed5kb08cdf792770b064@mail.gmail.com> can ironpython be used for creating (not consuming) web services on the server side? i couldn't find an example of this. i you can, can this be done with VS2005 or do we need VS-orcas beta 2? is ironpython integrated into VS-orcas beta 2? thanks, bryan From luismgz at gmail.com Sat Jul 28 20:28:13 2007 From: luismgz at gmail.com (Luis M. Gonzalez) Date: Sat, 28 Jul 2007 15:28:13 -0300 Subject: [IronPython] [Bug] import System enables .NET methods References: <46AB3F4A.5010207@voidspace.org.uk> Message-ID: <004b01c7d145$12f7d950$6c00a8c0@averatecdda041> Hi there, This is strange, but this one is weird: >>> 'hello world'.Upper() 'HELLO WORLD' Luis ----- Original Message ----- From: "Michael Foord" To: "Discussion of IronPython" Sent: Saturday, July 28, 2007 10:06 AM Subject: [IronPython] [Bug] import System enables .NET methods > Hello all, > > My understanding was that 'import clr' in a module was supposed to > enable .NET methods. > > 'import System' also has the same effect. Try the following (either from > an interactive session or run as a program) in IronPython 1.1. > > import System > print 'hello'.ToUpper() > > > All the best, > > Michael Foord > _______________________________________________ > 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 28 22:59:53 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sat, 28 Jul 2007 21:59:53 +0100 Subject: [IronPython] Windows Forms on Mac OS X In-Reply-To: <46AB3E9C.7030101@voidspace.org.uk> References: <46AB3E9C.7030101@voidspace.org.uk> Message-ID: <46ABAE49.9080702@voidspace.org.uk> Hello all, I've solved the Windows Forms on Mac OS problem. Although I had X11 installed I wasn't running IronPython from xterm. Doing that fixed Windows Forms *and* the problem with the delete key in the interactive interpreter. All the best, Michael Foord http://www.ironpython.info/ Michael Foord wrote: > Hello all, > > Has anyone had any success getting Windows Forms to work with IronPython > and Mono on Mac OS X? > > Mono claims to support Windows Forms on Mac OS, but instantiating a form > dies horribly (see below). I have the Apple X11 installed. > > Some (old) Winforms bug reports suggested I might need to add references > to the config file - but these are already in place in the current > release of Mono. > > Also - the bug on Mono where the backspace key doesn't work in the > console (I realise this is the wrong place to complain about this) is > really annoying. :-) > > IronPython 1.1a1 (1.1) on .NET 2.0.50727.42 > Copyright (c) Microsoft Corporation. All rights reserved. > >>> import clr > >>> clr.AddReference('System.Windows.Forms') > >>> from System.Windows.Forms import * > >>> f = Form() > Traceback (most recent call last): > File System.Windows.Forms, line unknown, in .cctor > File System.Windows.Forms, line unknown, in GetInstance > File System.Windows.Forms, line unknown, in .ctor > File System.Windows.Forms, line unknown, in SetDisplay > File System.Windows.Forms, line unknown, in .ctor > File System.Windows.Forms, line unknown, in .ctor > File System.Windows.Forms, line unknown, in .ctor > File System.Windows.Forms, line unknown, in .ctor > File System.Windows.Forms, line unknown, in InternalSizeFromClientSize > File System.Windows.Forms, line unknown, in get_CreateParams > SystemError: An exception was thrown by the type initializer for > System.Windows.Forms.XplatUI > >>> > > All the best, > > Michael Foord > http://www.ironpython.info > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > From sanxiyn at gmail.com Sun Jul 29 03:19:23 2007 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Sun, 29 Jul 2007 10:19:23 +0900 Subject: [IronPython] Py 2.5 bindings for SVN 1.4.4 In-Reply-To: References: <29ede7810707241452v699dde54oa3f744627948ccbd@mail.gmail.com> <46A676E8.3070706@voidspace.org.uk> <29ede7810707241534o6e7abc6cy671c50363188dbb4@mail.gmail.com> Message-ID: <5b0248170707281819j5e8e6aa5y4aa1f1de8916d5c4@mail.gmail.com> 2007/7/28, M. David Peterson : > Don't know of any MSI extraction utils on GNU/Linux|FreeBSD|Unix*|MacOSX, > though I doubt no one has taken the time to create one, I just don't know of > anybody who has. > > Anybody know if one exists? This is getting off-topic, but recent versions of Wine has its own implementation of msiexec with compatible commandline. -- Seo Sanghyeon From xmlhacker at gmail.com Sun Jul 29 12:02:42 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Sun, 29 Jul 2007 04:02:42 -0600 Subject: [IronPython] msiexec, Wine, and Exploding MSI Setup Archives on Unix* (was: Py 2.5 bindings for SVN 1.4.4) Message-ID: On 7/28/07, Sanghyeon Seo wrote: > > > This is getting off-topic, but recent versions of Wine has its own > implementation of msiexec with compatible commandline. Good point! And while the generalized topic of exploding an MSI on Unix* is really off-topic for even this list (and as such its a conversation we should probably not continue past this), it does seem worth changing the subject line to ensure ease of locating this information in the future. In summary: Apparently msiexec can be run via Wine, and in this regard the following commandline sequence should allow you to gain access to .NET assemblies contained inside of an MSI without actually installing the application associated with an MSI. In this example this will explode the AnkhSVN[1] assemblies (which can then be accessed via IronPython, enabling interop with SVN repositories as a result) into the C:\AnkhSVN on Windows. I can only assume that changing this to something like "/home//ankhsvn" should work just as well using Wine+msiexec** msiexec /a AnkhSetup-1.0.1.2736-Final.msi TARGETDIR="C:\AnkhSVN" /qn ** Please make sure you fully understand and agree to the various licensing issues involved with using Microsoft Windows Win32 binaries via Wine. Not that this isn't obvious, but its important to make clear the fact that regardless of the fact that IronPython is open source and liberally licensed, the Windows binaries are not. [1] http://ankhsvn.tigris.org/ -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From xmlhacker at gmail.com Sun Jul 29 12:16:04 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Sun, 29 Jul 2007 04:16:04 -0600 Subject: [IronPython] Version of DLR in Silverlight Alpha Refresh? Message-ID: Just noticed Miguel posted Tim Sneath's Silverlight 1.0RC1/1.1Alpha Refresh post[1] to the Olive mailing list. Nice! Can someone from MSFT (or anyone else who happens to know the answer) clarify if this new refresh is compatible with IP2.0A3? If not, what version of IP/DLR is present in this release? Thanks in advance! [1] http://blogs.msdn.com/tims/archive/2007/07/27/silverlight-1-0-rc1-is-here.aspx -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Sun Jul 29 19:54:07 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Sun, 29 Jul 2007 10:54:07 -0700 Subject: [IronPython] [Bug] import System enables .NET methods In-Reply-To: <46AB3F4A.5010207@voidspace.org.uk> References: <46AB3F4A.5010207@voidspace.org.uk> Message-ID: <7AD436E4270DD54A94238001769C2227B8262D6399@DF-GRTDANE-MSG.exchange.corp.microsoft.com> I think this one is by design. The idea is if you import any .NET namespace you're interested in the .NET world and so .NET methods are enabled. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Saturday, July 28, 2007 6:06 AM To: Discussion of IronPython Subject: [IronPython] [Bug] import System enables .NET methods Hello all, My understanding was that 'import clr' in a module was supposed to enable .NET methods. 'import System' also has the same effect. Try the following (either from an interactive session or run as a program) in IronPython 1.1. import System print 'hello'.ToUpper() All the best, Michael Foord _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From sanxiyn at gmail.com Mon Jul 30 02:21:35 2007 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Mon, 30 Jul 2007 09:21:35 +0900 Subject: [IronPython] msiexec, Wine, and Exploding MSI Setup Archives on Unix* (was: Py 2.5 bindings for SVN 1.4.4) In-Reply-To: References: Message-ID: <5b0248170707291721y63c2b1b4uc35ca21ec5c1e25d@mail.gmail.com> 2007/7/29, M. David Peterson : > ** Please make sure you fully understand and agree to the various licensing > issues involved with using Microsoft Windows Win32 binaries via Wine. Did you understand me? I repeat, Wine has its *own* implementation of msiexec.exe *indepedent* of Microsoft's implementation. -- Seo Sanghyeon From jomes at microsoft.com Mon Jul 30 03:40:55 2007 From: jomes at microsoft.com (John Messerly) Date: Sun, 29 Jul 2007 18:40:55 -0700 Subject: [IronPython] Version of DLR in Silverlight Alpha Refresh? In-Reply-To: References: Message-ID: <918705E903F4714CB713D89AB5F1857D6E650572AA@NA-EXMSG-C116.redmond.corp.microsoft.com> The version of IronPython/DLR that shipped with the Silverlight 1.1 Alpha Refresh is the same one that shipped in the original MIX release: IronPython 2.0 alpha 1. The Refresh release was focused on bug fixes rather than new features. The next Silverlight 1.1 release should have newer IronPython bits. Cheers, John From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of M. David Peterson Sent: Sunday, July 29, 2007 3:16 AM To: Discussion of IronPython Subject: [IronPython] Version of DLR in Silverlight Alpha Refresh? Just noticed Miguel posted Tim Sneath's Silverlight 1.0RC1/1.1Alpha Refresh post[1] to the Olive mailing list. Nice! Can someone from MSFT (or anyone else who happens to know the answer) clarify if this new refresh is compatible with IP2.0A3? If not, what version of IP/DLR is present in this release? Thanks in advance! [1] http://blogs.msdn.com/tims/archive/2007/07/27/silverlight-1-0-rc1-is-here.aspx -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From sanxiyn at gmail.com Mon Jul 30 04:33:23 2007 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Mon, 30 Jul 2007 11:33:23 +0900 Subject: [IronPython] msiexec, Wine, and Exploding MSI Setup Archives on Unix* (was: Py 2.5 bindings for SVN 1.4.4) In-Reply-To: <5b0248170707291721y63c2b1b4uc35ca21ec5c1e25d@mail.gmail.com> References: <5b0248170707291721y63c2b1b4uc35ca21ec5c1e25d@mail.gmail.com> Message-ID: <5b0248170707291933l1dc74b0q4c839007801f5742@mail.gmail.com> 2007/7/30, Sanghyeon Seo : > 2007/7/29, M. David Peterson : > > ** Please make sure you fully understand and agree to the various licensing > > issues involved with using Microsoft Windows Win32 binaries via Wine. > > Did you understand me? I repeat, Wine has its *own* implementation of > msiexec.exe *indepedent* of Microsoft's implementation. Just to be clear, the complete source code of Wine's msiexec.exe is available here: http://source.winehq.org/source/programs/msiexec/ -- Seo Sanghyeon From xmlhacker at gmail.com Mon Jul 30 12:57:54 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Mon, 30 Jul 2007 04:57:54 -0600 Subject: [IronPython] msiexec, Wine, and Exploding MSI Setup Archives on Unix* (was: Py 2.5 bindings for SVN 1.4.4) In-Reply-To: <5b0248170707291721y63c2b1b4uc35ca21ec5c1e25d@mail.gmail.com> References: <5b0248170707291721y63c2b1b4uc35ca21ec5c1e25d@mail.gmail.com> Message-ID: On 7/29/07, Sanghyeon Seo wrote: > > > Did you understand me? I repeat, Wine has its *own* implementation of > msiexec.exe *indepedent* of Microsoft's implementation. Ohhh... Got it. Okay, cool. I misunderstood what you said, but that was due to my own re-interpretation of what you said, as obviously you spell this out in the original post. Thanks for the clarification! -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From xmlhacker at gmail.com Mon Jul 30 12:59:03 2007 From: xmlhacker at gmail.com (M. David Peterson) Date: Mon, 30 Jul 2007 04:59:03 -0600 Subject: [IronPython] Version of DLR in Silverlight Alpha Refresh? In-Reply-To: <918705E903F4714CB713D89AB5F1857D6E650572AA@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <918705E903F4714CB713D89AB5F1857D6E650572AA@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: On 7/29/07, John Messerly wrote: > > The version of IronPython/DLR that shipped with the Silverlight 1.1 Alpha > Refresh is the same one that shipped in the original MIX release: IronPython > 2.0 alpha 1. The Refresh release was focused on bug fixes rather than new > features. The next Silverlight 1.1 release should have newer IronPython > > bits. > Thanks for the info, John! -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | http://dev.aol.com/blog/3155 -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Mon Jul 30 17:31:39 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 30 Jul 2007 08:31:39 -0700 Subject: [IronPython] [Bug] Arrays are stripped of .NET methods / properties In-Reply-To: <46AB4152.4000801@voidspace.org.uk> References: <46AB4152.4000801@voidspace.org.uk> Message-ID: <7AD436E4270DD54A94238001769C2227B8262D63BE@DF-GRTDANE-MSG.exchange.corp.microsoft.com> This one is definite a bug - all the methods on array should always be visible. I've created work item 11971 for the issue (http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=11971). I've tentatively lumped it in 1.1.1 but having not looked at the issue I don't know how invasive the fix will be - but I suspect it will be fairly simple. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Saturday, July 28, 2007 6:15 AM To: Discussion of IronPython Subject: [IronPython] [Bug] Arrays are stripped of .NET methods / properties Hello all, A bug in IronPython 1.1. This one has bitten us and it would be very nice to have it fixed. Create a .NET array in one module and then use it in another module that hasn't imported clr (or System) and it will be stripped of its .NET methods and properties. Importing clr fixes the problem, but shouldn't be necessary (right?). To see this, create a module called 'createArray.py': from System import Array def CreateArray(): return Array.CreateInstance(int, 2, 2) Then use the module from another IronPython program. E.g. : from createArray import CreateArray array = CreateArray() print array.Rank This results in the following error: C:\>ipy testArray.py Traceback (most recent call last): File C:\testArray.py, line 4, in Initialize AttributeError: 'Array[int]' object has no attribute 'Rank' If you add an import clr to the program then it does the right thing... Michael Foord http://www.ironpython.info _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From erochest at gmail.com Mon Jul 30 22:36:56 2007 From: erochest at gmail.com (Eric Rochester) Date: Mon, 30 Jul 2007 16:36:56 -0400 Subject: [IronPython] CLR class constructors and arrays Message-ID: <88bcce100707301336o67b65ff7p46fc8649508f523b@mail.gmail.com> Hi, I've been using IronPython for a few months now, and I'm really enjoying it. Thanks for all the hard work that's gone into it. I recently ran across an issue, and I wondered if anyone else has seen it. I think it's probably a bug, but I couldn't find a bug report, either. Basically, if there is a CLR class that takes an array as its only constructor argument, IronPython always tries to call it using params. For example, if I compile this to ParamCall.dll: // ParamCall.cs > > using System; > > namespace ParamCall > { > public class ParamCall > { > private string[] args; > > public ParamCall(string[] args) > { > this.args = args; > } > > public string Joined() > { > return String.Join(",", args); > } > } > } > And I call it using this script: # paramcall.py > > import clr > clr.AddReference('ParamCall') > > from ParamCall import ParamCall > from System import Array > > args = Array[str]( ['a', 'b', 'c'] ) > print 'args =', args > > print 'creating ParamCall object:' > pc = ParamCall(args) > print 'pc.Joined() =>', pc.Joined() > > print > I get these results. C:\home\eric\src\ase\Lse.Net>IronPython\ipy paramcall.py > args = System.String[]('a', 'b', 'c') > creating ParamCall object: > Traceback (most recent call last): > File C:\home\eric\src\ase\Lse.Net\paramcall.py, line 7, in Initialize > File , line 0, in __import__##4 > File C:\home\eric\src\ase\Lse.Net\ParamCall.py, line 15, in Initialize > File , line 0, in NonDefaultNew##54 > TypeError: ParamCall() takes exactly 1 argument (3 given) > I have also tried wrapping the arguments in a tuple and calling it like ParamCall( *(args,) ), but the results are the same. If anyone has any suggestions for work-arounds or clues as to what I'm doing wrong, I'd be glad to hear them. Thanks, -- Eric Rochester -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Mon Jul 30 22:56:15 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 30 Jul 2007 21:56:15 +0100 Subject: [IronPython] CLR class constructors and arrays In-Reply-To: <88bcce100707301336o67b65ff7p46fc8649508f523b@mail.gmail.com> References: <88bcce100707301336o67b65ff7p46fc8649508f523b@mail.gmail.com> Message-ID: <46AE506F.5020503@voidspace.org.uk> Hello Eric, Interestingly it works with: pc = ParamCall(('a', 'b', 'c')) passing a tuple instead of an array. Still looks like a bug. Michael http://www.ironpython.info/ Eric Rochester wrote: > Hi, > > I've been using IronPython for a few months now, and I'm really > enjoying it. Thanks for all the hard work that's gone into it. > > I recently ran across an issue, and I wondered if anyone else has seen > it. I think it's probably a bug, but I couldn't find a bug report, > either. > > Basically, if there is a CLR class that takes an array as its only > constructor argument, IronPython always tries to call it using params. > For example, if I compile this to ParamCall.dll: > > // ParamCall.cs > > using System; > > namespace ParamCall > { > public class ParamCall > { > private string[] args; > > public ParamCall(string[] args) > { > this.args = args; > } > > public string Joined() > { > return String.Join(",", args); > } > } > } > > > And I call it using this script: > > # paramcall.py > > import clr > clr.AddReference('ParamCall') > > from ParamCall import ParamCall > from System import Array > > args = Array[str]( ['a', 'b', 'c'] ) > print 'args =', args > > print 'creating ParamCall object:' > pc = ParamCall(args) > print 'pc.Joined() =>', pc.Joined() > > print > > > I get these results. > > C:\home\eric\src\ase\Lse.Net>IronPython\ipy paramcall.py > args = System.String[]('a', 'b', 'c') > creating ParamCall object: > Traceback (most recent call last): > File C:\home\eric\src\ase\Lse.Net\paramcall.py, line 7, in > Initialize > File , line 0, in __import__##4 > File C:\home\eric\src\ase\Lse.Net\ParamCall.py, line 15, in > Initialize > File , line 0, in NonDefaultNew##54 > TypeError: ParamCall() takes exactly 1 argument (3 given) > > > I have also tried wrapping the arguments in a tuple and calling it > like ParamCall( *(args,) ), but the results are the same. > > If anyone has any suggestions for work-arounds or clues as to what I'm > doing wrong, I'd be glad to hear them. > > Thanks, > > -- > Eric Rochester > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From erochest at gmail.com Mon Jul 30 23:33:52 2007 From: erochest at gmail.com (Eric Rochester) Date: Mon, 30 Jul 2007 17:33:52 -0400 Subject: [IronPython] CLR class constructors and arrays In-Reply-To: <46AE506F.5020503@voidspace.org.uk> References: <88bcce100707301336o67b65ff7p46fc8649508f523b@mail.gmail.com> <46AE506F.5020503@voidspace.org.uk> Message-ID: <88bcce100707301433r30de6241x3cee7eeedefdafaf@mail.gmail.com> Thanks, Michael, that will work. It seems blindingly obvious now, but I hadn't even considered it, since I generally try to pass CLR types to CLR methods. Sheepishly, Eric On 7/30/07, Michael Foord wrote: > > Hello Eric, > > Interestingly it works with: > pc = ParamCall(('a', 'b', 'c')) > > passing a tuple instead of an array. > > Still looks like a bug. > > Michael > http://www.ironpython.info/ > > Eric Rochester wrote: > > Hi, > > > > I've been using IronPython for a few months now, and I'm really > > enjoying it. Thanks for all the hard work that's gone into it. > > > > I recently ran across an issue, and I wondered if anyone else has seen > > it. I think it's probably a bug, but I couldn't find a bug report, > > either. > > > > Basically, if there is a CLR class that takes an array as its only > > constructor argument, IronPython always tries to call it using params. > > For example, if I compile this to ParamCall.dll: > > > > // ParamCall.cs > > > > using System; > > > > namespace ParamCall > > { > > public class ParamCall > > { > > private string[] args; > > > > public ParamCall(string[] args) > > { > > this.args = args; > > } > > > > public string Joined() > > { > > return String.Join(",", args); > > } > > } > > } > > > > > > And I call it using this script: > > > > # paramcall.py > > > > import clr > > clr.AddReference('ParamCall') > > > > from ParamCall import ParamCall > > from System import Array > > > > args = Array[str]( ['a', 'b', 'c'] ) > > print 'args =', args > > > > print 'creating ParamCall object:' > > pc = ParamCall(args) > > print 'pc.Joined() =>', pc.Joined() > > > > print > > > > > > I get these results. > > > > C:\home\eric\src\ase\Lse.Net>IronPython\ipy paramcall.py > > args = System.String[]('a', 'b', 'c') > > creating ParamCall object: > > Traceback (most recent call last): > > File C:\home\eric\src\ase\Lse.Net\paramcall.py, line 7, in > > Initialize > > File , line 0, in __import__##4 > > File C:\home\eric\src\ase\Lse.Net\ParamCall.py, line 15, in > > Initialize > > File , line 0, in NonDefaultNew##54 > > TypeError: ParamCall() takes exactly 1 argument (3 given) > > > > > > I have also tried wrapping the arguments in a tuple and calling it > > like ParamCall( *(args,) ), but the results are the same. > > > > If anyone has any suggestions for work-arounds or clues as to what I'm > > doing wrong, I'd be glad to hear them. > > > > Thanks, > > > > -- > > Eric Rochester > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- Eric Rochester http://writingcoding.blogspot.com/ http://www.linkedin.com/in/erochester -------------- next part -------------- An HTML attachment was scrubbed... URL: From jomes at microsoft.com Tue Jul 31 00:20:14 2007 From: jomes at microsoft.com (John Messerly) Date: Mon, 30 Jul 2007 15:20:14 -0700 Subject: [IronPython] CLR class constructors and arrays In-Reply-To: <88bcce100707301336o67b65ff7p46fc8649508f523b@mail.gmail.com> References: <88bcce100707301336o67b65ff7p46fc8649508f523b@mail.gmail.com> Message-ID: <918705E903F4714CB713D89AB5F1857D6E65057696@NA-EXMSG-C116.redmond.corp.microsoft.com> For what it's worth, this appears to be fixed in IronPython 2.0 alpha 3: >ipy paramcalltest.py args = System.String[]('a', 'b', 'c') creating ParamCall object: pc.Joined() => a,b,c If it's really bothersome we could add it to the 1.1.1 bug list, but in the meantime I'd suggest the workaround Michael mentioned (wrapping the args up in the tuple) Cheers, John -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Eric Rochester Sent: Monday, July 30, 2007 1:37 PM To: IronPython Users Subject: [IronPython] CLR class constructors and arrays Hi, I've been using IronPython for a few months now, and I'm really enjoying it. Thanks for all the hard work that's gone into it. I recently ran across an issue, and I wondered if anyone else has seen it. I think it's probably a bug, but I couldn't find a bug report, either. Basically, if there is a CLR class that takes an array as its only constructor argument, IronPython always tries to call it using params. For example, if I compile this to ParamCall.dll: // ParamCall.cs using System; namespace ParamCall { public class ParamCall { private string[] args; public ParamCall(string[] args) { this.args = args; } public string Joined() { return String.Join(",", args); } } } And I call it using this script: # paramcall.py import clr clr.AddReference('ParamCall') from ParamCall import ParamCall from System import Array args = Array[str]( ['a', 'b', 'c'] ) print 'args =', args print 'creating ParamCall object:' pc = ParamCall(args) print 'pc.Joined() =>', pc.Joined() print I get these results. C:\home\eric\src\ase\Lse.Net>IronPython\ipy paramcall.py args = System.String[]('a', 'b', 'c') creating ParamCall object: Traceback (most recent call last): File C:\home\eric\src\ase\Lse.Net\paramcall.py, line 7, in Initialize File , line 0, in __import__##4 File C:\home\eric\src\ase\Lse.Net\ParamCall.py, line 15, in Initialize File , line 0, in NonDefaultNew##54 TypeError: ParamCall() takes exactly 1 argument (3 given) I have also tried wrapping the arguments in a tuple and calling it like ParamCall( *(args,) ), but the results are the same. If anyone has any suggestions for work-arounds or clues as to what I'm doing wrong, I'd be glad to hear them. Thanks, -- Eric Rochester From erochest at gmail.com Tue Jul 31 12:19:54 2007 From: erochest at gmail.com (Eric Rochester) Date: Tue, 31 Jul 2007 06:19:54 -0400 Subject: [IronPython] CLR class constructors and arrays In-Reply-To: <918705E903F4714CB713D89AB5F1857D6E65057696@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <88bcce100707301336o67b65ff7p46fc8649508f523b@mail.gmail.com> <918705E903F4714CB713D89AB5F1857D6E65057696@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <88bcce100707310319w7854ef3al5f94988e3dbb40ee@mail.gmail.com> It's not a problem at all. I was just trying to test the API for a library from the interactive interpreter. When it happened, I remembered that it had bit me before, and this time I just happened to be in a mood to track it down. Thanks, Eric On 7/30/07, John Messerly wrote: > > For what it's worth, this appears to be fixed in IronPython 2.0 alpha 3: > > >ipy paramcalltest.py > args = System.String[]('a', 'b', 'c') > creating ParamCall object: > pc.Joined() => a,b,c > > If it's really bothersome we could add it to the 1.1.1 bug list, but in > the meantime I'd suggest the workaround Michael mentioned (wrapping the args > up in the tuple) > > Cheers, > John > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] On Behalf Of Eric Rochester > Sent: Monday, July 30, 2007 1:37 PM > To: IronPython Users > Subject: [IronPython] CLR class constructors and arrays > > Hi, > > I've been using IronPython for a few months now, and I'm really enjoying > it. Thanks for all the hard work that's gone into it. > > I recently ran across an issue, and I wondered if anyone else has seen it. > I think it's probably a bug, but I couldn't find a bug report, either. > > Basically, if there is a CLR class that takes an array as its only > constructor argument, IronPython always tries to call it using params. For > example, if I compile this to ParamCall.dll: > // ParamCall.cs > > using System; > > namespace ParamCall > { > public class ParamCall > { > private string[] args; > > public ParamCall(string[] args) > { > this.args = args; > } > > public string Joined() > { > return String.Join(",", args); > } > } > } > > And I call it using this script: > # paramcall.py > > import clr > clr.AddReference('ParamCall') > > from ParamCall import ParamCall > from System import Array > > args = Array[str]( ['a', 'b', 'c'] ) > print 'args =', args > > print 'creating ParamCall object:' > pc = ParamCall(args) > print 'pc.Joined() =>', pc.Joined() > > print > > I get these results. > C:\home\eric\src\ase\Lse.Net>IronPython\ipy paramcall.py > args = System.String[]('a', 'b', 'c') > creating ParamCall object: > Traceback (most recent call last): > File C:\home\eric\src\ase\Lse.Net\paramcall.py, line 7, in Initialize > File , line 0, in __import__##4 > File C:\home\eric\src\ase\Lse.Net\ParamCall.py, line 15, in Initialize > File , line 0, in NonDefaultNew##54 > TypeError: ParamCall() takes exactly 1 argument (3 given) > > I have also tried wrapping the arguments in a tuple and calling it like > ParamCall( *(args,) ), but the results are the same. > > If anyone has any suggestions for work-arounds or clues as to what I'm > doing wrong, I'd be glad to hear them. > > Thanks, > > -- > Eric Rochester > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- Eric Rochester http://writingcoding.blogspot.com/ http://www.linkedin.com/in/erochester -------------- next part -------------- An HTML attachment was scrubbed... URL: