From jvm_cop at spamcop.net Sat Jul 1 00:13:15 2006 From: jvm_cop at spamcop.net (J. Merrill) Date: Fri, 30 Jun 2006 18:13:15 -0400 Subject: [IronPython] list -> Array conversion in Beta 8 In-Reply-To: References: Message-ID: <7.0.1.0.2.20060630181114.03eb5b70@wheresmymailserver.com> As was pointed out, this was intentionally changed. In your sample, you should be able to do print myClass.SumArray( tuple(L) ) That is, just convert the list to a tuple. At 03:03 PM 6/30/2006, Milman, Seth wrote >Hi, >I just upgraded from Beta 7 to Beta 8 and I'm having a problem passing >runtime lists to assembly functions that expect an array. In beta 7, >the list went through function >IronPython.Runtime.Converter.TryConvertToArray. In beta 8, it is passed >to IronPython.Runtime.NewConverter.ConvertToArray. > >Beta 7 seemed to work, Beta 8 doesn't. Is this new behavior by design? >If so, how should I work around it? > >Here is a repro: > > >// C# Code >Namespace mySpace { > public class myClass { > public static double SumArray( System.Double[] a ) { > double sum = 0.0; > foreach( double d in a ) { > sum += d; > } > return sum; > } > } >} > > ># Python code >... >L = [1.0, 2.0, 3.0] >print myClass.SumArray( L ) > > >In beta 7 it works. >In beta 8, I get this exception trace: > >expected array_float, found list [snip] > >Any suggestions? > >Thanks, > >Seth Milman J. Merrill / Analytical Software Corp From neville.bagnall at propylon.com Sat Jul 1 00:20:07 2006 From: neville.bagnall at propylon.com (Neville Bagnall) Date: Fri, 30 Jun 2006 23:20:07 +0100 Subject: [IronPython] Bug when calling ironpythonconsole from powershell In-Reply-To: <4039D552ADAB094BB1EA670F3E96214E03F7B991F6@df-foxhound-msg.exchange.corp.microsoft.com> References: <44A2CC41.3020903@bostream.nu> <4039D552ADAB094BB1EA670F3E96214E03F7B991F6@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: In PowerShell drive names are far less restrictive: PS C:\IronPython> Get-PSDrive Name Provider Root ---- -------- ---- Alias Alias C FileSystem C:\ cert Certificate \ D FileSystem D:\ E FileSystem E:\ Env Environment Function Function HKCU Registry HKEY_CURRENT_USER HKLM Registry HKEY_LOCAL_MACHINE Variable Variable So when the parser sees -X:SaveAssemblies it thinks it is the "SaveAssemblies" item on the "-X" Drive. If you enclose the item in quotes '-X:SaveAssemblies' the parser will interpret it as a string and pass it through. PS C:\IronPython> .\IronPythonConsole.exe '-X:SaveAssemblies' IronPython 1.0.60619 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> "Interestingly", cmdlets do the right thing: PS C:\IronPython> gci -r:0 Mode LastWriteTime Length Name ---- ------------- ------ ---- -a--- 12/06/2006 09:32 4580 FAQ.html -a--- 19/06/2006 13:53 47904 FePy.exe -a--- 19/06/2006 13:53 43808 IronMath.dll -a--- 19/06/2006 13:53 1174304 IronPython.dll -a--- 19/06/2006 13:53 47904 IronPythonConsole.exe -a--- 19/06/2006 13:53 43808 IronPythonWindow.exe -a--- 12/06/2006 09:32 2832 License.html -a--- 12/06/2006 09:32 5945 Readme.html d---- 20/06/2006 16:36 Doc d---- 30/06/2006 23:09 Lib d---- 20/06/2006 16:36 Src d---- 20/06/2006 16:36 Tutorial PS C:\IronPython> Probably because the parser gets the parameter information through reflection. On Thu, 29 Jun 2006 22:48:14 +0100, Dino Viehland wrote: > This actually sounds more like a PowerShell bug than an IronPython bug > (it's splitting a command line option or maybe : is a special character > in PowerShell?). > > I don't currently have PowerShell installed, but does \: instead of : > work (it's just a crazy guess that maybe it needs to be escaped). > > -----Original Message----- > From: users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] On Behalf Of J?rgen Stenarson > Sent: Wednesday, June 28, 2006 11:37 AM > To: Discussion of IronPython > Subject: [IronPython] Bug when calling ironpythonconsole from powershell > > Hi > > I have a problem calling ironpythonconsole from windows powershell using > the -X: options. Below are excerpts from sessions both in cmd.exe and > powershell: > > From cmd.exe: > C:\IronPython>IronPythonConsole.exe -X:SaveAssemblies hej.py HELLO WORLD! > > > From windows powershell: > PS C:\IronPython> IronPythonConsole.exe -X:SaveAssemblies hej.py File > -X: does not exist > > looks like there is some issue with commandline parsing. > > > Best regards, > J?rgen Stenarson > > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.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 glumor at faza.ru Sat Jul 1 14:43:58 2006 From: glumor at faza.ru (glumor at faza.ru) Date: Sat, 01 Jul 2006 15:43:58 +0300 Subject: [IronPython] Visit this sites! Message-ID: An HTML attachment was scrubbed... URL: From glumor at faza.ru Sat Jul 1 16:06:13 2006 From: glumor at faza.ru (glumor at faza.ru) Date: Sat, 01 Jul 2006 09:06:13 -0500 Subject: [IronPython] Visit this sites! Message-ID: Visit %3Cahref%3Dhttp%3A%2F%2Farbat.or.at%2Fadipex%2F%3Ehttp%3A%2F%2Farbat.or.at%2Fadipex%2F%3C%2Fa%3E%3Cahref%3Dhttp%3A%2F%2Farbat.or.at%2Fxanax%2F%3Ehttp%3A%2F%2Farbat.or.at%2Fxanax%2F%3C%2Fa%3E%3Cahref%3Dhttp%3A%2F%2Farbat.or.at%2Fphentermine%2F%3Ehttp%3A%2F%2Farbat.or.at%2Fphentermine%2F%3C%2Fa%3E%3Cahref%3Dhttp%3A%2F%2Farbat.or.at%2Fcialis%2F%3Ehttp%3A%2F%2Farbat.or.at%2Fcialis%2F%3C%2Fa%3E%3Cahref%3Dhttp%3A%2F%2Farbat.or.at%2Fviagra%2F%3Ehttp%3A%2F%2Farbat.or.at%2Fviagra%2F%3C%2Fa%3E From glumor at faza.ru Sat Jul 1 16:18:54 2006 From: glumor at faza.ru (glumor at faza.ru) Date: Sat, 01 Jul 2006 09:18:54 -0500 Subject: [IronPython] Visit this sites! Message-ID: Visit http://arbat.or.at/adipex/ http://arbat.or.at/xanax/ http://arbat.or.at/phentermine/ http://arbat.or.at/cialis/ http://arbat.or.at/viagra/ From glumor at faza.ru Sat Jul 1 16:20:03 2006 From: glumor at faza.ru (glumor at faza.ru) Date: Sat, 01 Jul 2006 09:20:03 -0500 Subject: [IronPython] Visit this sites! Message-ID: Visit http://arbat.or.at/adipex/ http://arbat.or.at/xanax/ http://arbat.or.at/phentermine/ http://arbat.or.at/cialis/ http://arbat.or.at/viagra/ From glumor at faza.ru Sat Jul 1 18:13:53 2006 From: glumor at faza.ru (glumor at faza.ru) Date: Sat, 01 Jul 2006 11:13:53 -0500 Subject: [IronPython] Visit this sites! Message-ID: Visit http://alcoholico-es.info/ http://arbat.or.at/adipex/#adipex http://arbat.or.at/alprazolam/#alprazolam http://arbat.or.at/ambien/#ambien http://arbat.or.at/ativan/#ativan http://arbat.or.at/bontril/#bontril http://arbat.or.at/texas-holdem/#texas-holdem http://arbat.or.at/tramadol/#tramadol http://arbat.or.at/ultram/#ultram http://arbat.or.at/valium/#valium http://arbat.or.at/viagra/#viagra http://arbat.or.at/vicodin/#vicodin http://arbat.or.at/xanax/#xanax http://arbat.or.at/butalbital/#butalbital http://arbat.or.at/carisoprodol/ http://arbat.or.at/cialis/#cialis http://arbat.or.at/clonazepam/#clonazepam http://arbat.or.at/diazepam/#diazepam http://arbat.or.at/didrex/#didrex http://arbat.or.at/lorazepam/#cheap http://arbat.or.at/online-pharmacy/#online http://arbat.or.at/phentermine/#phentermine http://arbat.or.at/poker-room/#poker-room-online http://arbat.or.at/fioricet/#fioricet http://arbat.or.at/hydrocodone/#hydrocodone http://arbat.or.at/ionamin/#ionamine http://arbat.or.at/klonopin/#klonopin http://arbat.or.at/lorcet/#lorcet http://arbat.or.at/lortab/#lortab http://arbat.or.at/fastin/#fastin http://arbat.or.at/rivotril/#rivotril http://arbat.or.at/soma/#soma http://arbat.or.at/stilnox/#stilnox http://arbat.or.at/tenuate/#tenuate http://arbat.or.at/carisoma/#carisoma http://arbat.or.at/zolpidem/#zolpidem http://phenblonews.net/#wheight-loss-phentermine http://phennewsblo.com/#adipex-phentermine http://pax-blogs.info/#paxil http://phe-blogs.info/#phentermine-drug http://pr-blogs.info/#prozac-us http://pla-blogs.info/#plavix http://pro-blogs.info/#prozac http://nor-blogs.info/#norvax-online http://red-blogs.info/ http://val-blogs.info/#valium-order http://via-blogs.info/#viagra-cialis http://xen-blogs.info/#xenical-online http://xan-blogs.info/#buy-xanax http://arbat.or.at/boxing-betting/#boxing-betting http://peoplegrad.gen.in/ad/#onlineadipex http://peoplegrad.gen.in/allam/#onlinealprazolam http://peoplegrad.gen.in/ambi/#onlineambien http://peoplegrad.gen.in/avan/#cheapativan http://peoplegrad.gen.in/bont/#cheapbontril http://peoplegrad.gen.in/cilis/#cheapcialis http://peoplegrad.gen.in/clon/#clonazepambuy http://peoplegrad.gen.in/dize/#diazepambuy http://peoplegrad.gen.in/dix/#didrexpharmacy http://peoplegrad.gen.in/hycod/#hydrocodonevicodine http://peoplegrad.gen.in/lorz/#lorazepamorder http://peoplegrad.gen.in/pha/#onlinepharmacy http://peoplegrad.gen.in/fent/#phenterminepills http://peoplegrad.gen.in/trad/#tramadolultram http://peoplegrad.gen.in/valm/#valium-diazepam http://peoplegrad.gen.in/vgra/#viagra-buy-online http://peoplegrad.gen.in/naxan/#xanax-alprazolam-buy From alex at syzmk.com Sun Jul 2 06:45:56 2006 From: alex at syzmk.com (Alex Henderson) Date: Sun, 2 Jul 2006 16:45:56 +1200 Subject: [IronPython] __main__ module and global variables issue... In-Reply-To: <7.0.1.0.2.20060630181114.03eb5b70@wheresmymailserver.com> Message-ID: <001001c69d92$691f68d0$4201a8c0@tokai> Our system is using IP for an expression engine - in most cases we are creating a new ModuleScope and evaluating against it, which works fine ie. On setup we assign some global variables, and generate functions on the fly for the lifetime of the module which are evaluated, and thrown away after use. However I've also been using the default module scope for evaluating some expressions, and I seem to be getting some odd behavior... where any global variables we've assigned (in this case, "_container", "_log" and "_config") at some indeterminate point end up reverting to None values - the names still exist, but the references to the class instances have gone. This is only happening for the default module scope, everything works as expected when we create our own module scope... and there's no code being executed other then that which sets the global variables in the first place, which is definitely assigning non-null values (I've changed the methods to set then fetch the value to make sure). Is there perhaps something different between a scope I've created using new ModuleScope(), and the PythonEngine's DefaultModuleScope with regards to global variables? Chez, - Alex From kristof.wagemans at gmail.com Sun Jul 2 09:39:47 2006 From: kristof.wagemans at gmail.com (Kristof Wagemans) Date: Sun, 2 Jul 2006 09:39:47 +0200 Subject: [IronPython] True division error Message-ID: <000001c69daa$b2a1d7f0$0f01a8c0@notebook> IronPython 1.0.2365 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> 1/2 0 >>> from __future__ import division Traceback (most recent call last): File , line 0, in ##3 File , line 0, in __import__##7 ImportError: No module named __future__ >>> 1/2 0.500 -------------- next part -------------- An HTML attachment was scrubbed... URL: From KBjorke at nvidia.com Sun Jul 2 17:39:32 2006 From: KBjorke at nvidia.com (Kevin Bjorke) Date: Sun, 2 Jul 2006 08:39:32 -0700 Subject: [IronPython] Python Module Scopes versus WinForms Event Handlers In-Reply-To: <590FCAE72E27D54CA1EADE7293BB444F04422AFC@hqemmail04.nvidia.com> Message-ID: <590FCAE72E27D54CA1EADE7293BB444F04422B01@hqemmail04.nvidia.com> This ended up being weirder and more subtle than I realized... And possibly not an IP bug I discovered that within the problematic scope, one module was using a variable with the same name as an imported module -- and within that narrow scope at least, was over-writing the namespace for the module. This may have been at the root of the problems I was experiencing -- import blah blah = 7 blah.someclass.somemethod(4) Is likely to cause an error since the "blah" namespace is actually an object, no? In my case it was subtle since the re-assignment would only happen when a certain combination of events occurred in a running program, only after the entire thing was up and running with all windows initialized and so forth, and only within certain parts of the program. I'm now re-revising my code to use "normal" global scopes again, and if it's all good, won't write about this issue any more ^_^;; Kb (*sometimes* missing rigid typing, heh) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Kevin Bjorke Sent: Thursday, June 29, 2006 4:52 PM To: Discussion of IronPython Subject: [IronPython] Python Module Scopes versus WinForms Event Handlers ===================== This message appears to be from an NVIDIA.COM e-mail address, yet did not originate from an NVIDIA server. Please be cautious of any attachments or links in this message. Thank you, NVIDIA IT Team. ===================== A typical idiom for a global value is to define it in some imported module, e.g. # config.py gVal = 3 And then all the other modules can import config And get/set the value by accessing "config.gVal" Unfortunately, this gets broken when using WinForms! It seems that in methods called as event handlers (or any methods called by those methods) that (in this case) "config.gVal" is not a valid attribute. For all other method contexts, "config.gVal" works perfectly. A global declared within the scope of the module containg the event handler CAN be used within the event handler, so my modules end up doing something like this: import config global gVal # ...and somewhere before any other code in the current mdule gets executed.... gVal = config.gVal ...so that event handlers can use the local-module "global" version. Obviously if the value of "config.gVal" changes a lot this would be an even huger hassle (fortunately, all I want is to maintain a globally-available pointer to my top-level app, which never changes once the app is initialized) ------------------------------------------------------------------------ ----------- This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. ------------------------------------------------------------------------ ----------- _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Martin.Maly at microsoft.com Sun Jul 2 19:27:04 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Sun, 2 Jul 2006 10:27:04 -0700 Subject: [IronPython] True division error In-Reply-To: <000001c69daa$b2a1d7f0$0f01a8c0@notebook> Message-ID: This is actually a correct behavior (*). The "from __future__ import division" is detected at compile-time, which is what will affect the division IronPython uses in the given module. However, the module will still try to import the module called "__future__" at runtime. Since IronPython distribution doesn't contain that module, you'll see the exception you are getting. What you can do is point IronPython to the standard python library directory (for example C:\Python24\Lib) and IronPython will find the __future__.py module which is part of standard Python. The easy way to do this once and for all is to modify IronPython's site.py (the only file in the IronPython's Lib directory): import sys sys.path.append("C:\\Python24\\Lib") (*) you can try similar trick with standard Python. This snippet will clear the import search path so the import statement will not find the module __future__.py, but the division behavior will still get changed. Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path = [] >>> 1/2 0 >>> from __future__ import division Traceback (most recent call last): File "", line 1, in ? ImportError: No module named __future__ >>> 1/2 0.5 >>> ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Kristof Wagemans Sent: Sunday, July 02, 2006 12:40 AM To: 'Discussion of IronPython' Subject: [IronPython] True division error IronPython 1.0.2365 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> 1/2 0 >>> from __future__ import division Traceback (most recent call last): File , line 0, in ##3 File , line 0, in __import__##7 ImportError: No module named __future__ >>> 1/2 0.500 -------------- next part -------------- An HTML attachment was scrubbed... URL: From joesox at gmail.com Sun Jul 2 19:57:19 2006 From: joesox at gmail.com (JoeSox) Date: Sun, 2 Jul 2006 10:57:19 -0700 Subject: [IronPython] UnicodeDecodeError: Unable to translate bytes [81] at index 0 from specified code page to Unicode Message-ID: <785694cd0607021057h3fa93af3ob470b804619f5509@mail.gmail.com> I don't understand this error and was wondering if someone could open my eyes to the exact problem. I am working with IronPython beta8 and importing this array.py file: http://codespeak.net/svn/user/nik/array_py/trunk/src/array.py here is the execption details: =========== Traceback (most recent call last): File , line 0, in ##70 File E:\CNUDB.py, line 24, in __init__ File E:\CNUTools.py, line 13, in __init__ File E:\CNUMontylingua.py, line 15, in __init__ File E:\CNUMontyTagger.py, line 15, in __init__ File E:\CNUMontyLexiconFast.py, line 37, in __init__ File E:\CNUMontyLexiconFast.py, line 101, in load_fastlexicon File CNUMontyLexiconFast, line unknown, in array_fromfile File E:\CNUMontyLexiconFast.py, line 254, in array_fromfile File E:\array.py, line 209, in fromfile File E:\array.py, line 222, in fromstring File mscorlib, line unknown, in GetString File mscorlib, line unknown, in GetString File mscorlib, line unknown, in CreateStringFromEncoding File mscorlib, line unknown, in GetCharCount File mscorlib, line unknown, in InternalFallback File mscorlib, line unknown, in Fallback File mscorlib, line unknown, in Throw UnicodeDecodeError: Unable to translate bytes [81] at index 0 from specified cod e page to Unicode. ========== It is having some kind of trouble reading FASTLEXICON_3.MDF file which is included with ConceptNet's Montylingua. I am just not sure why. I have a complete ConceptNet mini-browser just like the Python version but developed in C#/IronPython but this error is stumping me right now. This array.py is for array.array support using IronPython. Thanks. -- Later, Joe From joesox at gmail.com Mon Jul 3 07:30:32 2006 From: joesox at gmail.com (JoeSox) Date: Sun, 2 Jul 2006 22:30:32 -0700 Subject: [IronPython] Importing embedded .py files Message-ID: <785694cd0607022230l7e286b14ta05385c3f309b554@mail.gmail.com> What is the correct way to import an embedded module file(s) into a PythonEngine? In VS I have some embedded .py files which I have access to but I can't seem to get the PythonEngine to import the modules. I don't know if I am using the correct methods or not. [embedded file: CNUDB.py in namespace ConceptNetUtils2] ... public static PythonEngine cn_pe = new PythonEngine(); cn_pe.Execute("import sys"); Assembly CNUAssembly = Assembly.GetExecutingAssembly(); cn_pe.LoadAssembly(CNUAssembly); cn_pe.Execute("import CNUDB"); //module CNUDB not found ... If have also tried cn_pe.Import("ConceptNetUtils2.CNUDB.py"); and cn_pe.Import("clr"); cn_pe.Execute("clr.AddReference(\"ConceptNetUtils2.CNUDB.py\")"); IP exception:"Could not add reference to assembly ConceptNetUtils2.CNUDB.py" any direction would be helpful. I'm sure I am over looking something. Thanks. -- Later, Joe From sanxiyn at gmail.com Mon Jul 3 08:26:30 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Mon, 3 Jul 2006 15:26:30 +0900 Subject: [IronPython] Importing embedded .py files In-Reply-To: <785694cd0607022230l7e286b14ta05385c3f309b554@mail.gmail.com> References: <785694cd0607022230l7e286b14ta05385c3f309b554@mail.gmail.com> Message-ID: <5b0248170607022326v5ce2a72nfc890457ec6a60a4@mail.gmail.com> 2006/7/3, JoeSox : > What is the correct way to import an embedded module file(s) into a > PythonEngine? (snip) This is an interesting use case that could be done with PEP 302 import hooks. In CPython it was introduced to allow importing modules from .zip files, but in .NET setting it certainly makes sense to allow importing modules embedded in the assembly, which I believe is not yet possible with IronPython. Seo Sanghyeon From raathm at gmail.com Mon Jul 3 11:50:48 2006 From: raathm at gmail.com (Mike Raath) Date: Mon, 3 Jul 2006 11:50:48 +0200 Subject: [IronPython] Bug in time.strptime? Message-ID: <664260580607030250i450da6c2j5f403d7d9eb229ae@mail.gmail.com> I'm getting an exception in IronPython which I don't get in CPython. >From the CPython console window: >>> import time, datetime >>> d = time.strptime("July 3, 2006 At 0724 GMT", "%B %d, %Y At %H%M GMT") >>> print d (2006, 7, 3, 7, 24, 0, 0, 184, -1) >From IronPython, a similar set of statements: engine.Execute("import datetime") engine.Execute("d = time.strptime(""July 3, 2006 At 0724 GMT"", ""%B %d, %Y At %H%M GMT"")") results in this exception: The string was not recognized as a valid DateTime. There is a unknown word starting at index 13. The word starting at index 13 is the "At" but the format string provided should tell strptime how to interpret it. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sanxiyn at gmail.com Mon Jul 3 12:38:26 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Mon, 3 Jul 2006 19:38:26 +0900 Subject: [IronPython] Issue Tracker Components Message-ID: <5b0248170607030338i71297df4of0c87a447a5c5a82@mail.gmail.com> Hi, Currently, IronPython's Issue Tracker has following Components: Code Generator, Compiler, Module, Runtime. I would like to have Console as another component. Does anyone have another suggestion? Seo Sanghyeon From kristof.wagemans at gmail.com Mon Jul 3 12:49:28 2006 From: kristof.wagemans at gmail.com (Kristof Wagemans) Date: Mon, 3 Jul 2006 12:49:28 +0200 Subject: [IronPython] Importing embedded .py files In-Reply-To: <5b0248170607022326v5ce2a72nfc890457ec6a60a4@mail.gmail.com> Message-ID: <000e01c69e8e$5c71e2f0$0f01a8c0@notebook> Having an extensible mechanism for importing files would be very useful. I would like to be able to import python files stored in a database. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Sanghyeon Seo Sent: Monday 3 July 2006 8:27 To: Discussion of IronPython Subject: Re: [IronPython] Importing embedded .py files 2006/7/3, JoeSox : > What is the correct way to import an embedded module file(s) into a > PythonEngine? (snip) This is an interesting use case that could be done with PEP 302 import hooks. In CPython it was introduced to allow importing modules from .zip files, but in .NET setting it certainly makes sense to allow importing modules embedded in the assembly, which I believe is not yet possible with IronPython. Seo Sanghyeon _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From sanxiyn at gmail.com Mon Jul 3 13:29:20 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Mon, 3 Jul 2006 20:29:20 +0900 Subject: [IronPython] Array str/repr Message-ID: <5b0248170607030429n1ffd86e0u29235e98168d180f@mail.gmail.com> This can be very confusing. >>> from System import Array, Object >>> o = Array[Object]([0]) >>> str(o) 'System.Object[]' >>> repr(o) 'System.Object[](0)' Seo Sanghyeon From joesox at gmail.com Mon Jul 3 15:47:23 2006 From: joesox at gmail.com (JoeSox) Date: Mon, 3 Jul 2006 06:47:23 -0700 Subject: [IronPython] Importing embedded .py files In-Reply-To: <5b0248170607022326v5ce2a72nfc890457ec6a60a4@mail.gmail.com> References: <785694cd0607022230l7e286b14ta05385c3f309b554@mail.gmail.com> <5b0248170607022326v5ce2a72nfc890457ec6a60a4@mail.gmail.com> Message-ID: <785694cd0607030647nb03f55cic33bf287d47e651f@mail.gmail.com> On 7/2/06, Sanghyeon Seo wrote: > 2006/7/3, JoeSox : > > What is the correct way to import an embedded module file(s) into a > > PythonEngine? (snip) > > This is an interesting use case that could be done with PEP 302 import > hooks. In CPython it was introduced to allow importing modules from > .zip files, but in .NET setting it certainly makes sense to allow > importing modules embedded in the assembly, which I believe is not yet > possible with IronPython. Interesting. Hopefully it will be supported in the future, until then I guess I will include my script files with my .dll, which seems odd to. -- Later, Joe From fuzzyman at voidspace.org.uk Mon Jul 3 15:48:34 2006 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 03 Jul 2006 14:48:34 +0100 Subject: [IronPython] Importing embedded .py files In-Reply-To: <785694cd0607030647nb03f55cic33bf287d47e651f@mail.gmail.com> References: <785694cd0607022230l7e286b14ta05385c3f309b554@mail.gmail.com> <5b0248170607022326v5ce2a72nfc890457ec6a60a4@mail.gmail.com> <785694cd0607030647nb03f55cic33bf287d47e651f@mail.gmail.com> Message-ID: <44A92032.4000305@voidspace.org.uk> JoeSox wrote: > On 7/2/06, Sanghyeon Seo wrote: > >> 2006/7/3, JoeSox : >> >>> What is the correct way to import an embedded module file(s) into a >>> PythonEngine? (snip) >>> >> This is an interesting use case that could be done with PEP 302 import >> hooks. In CPython it was introduced to allow importing modules from >> .zip files, but in .NET setting it certainly makes sense to allow >> importing modules embedded in the assembly, which I believe is not yet >> possible with IronPython. >> > > Interesting. Hopefully it will be supported in the future, until then > I guess I will include my script files with my .dll, which seems odd > to. > As a workaround, you could create your own module objects very easily assuming you have the source code as a string. import imp import sys newModule = imp.new_module(moduleName) exec(sourceCode, newModule.__dict__) sys.modules[moduleName] = newModule You *should* then be able to import from this module in the normal way. (Unless I have made a mistake in the above code.) All the best, Michael Foord http://www.voidspace.org.uk/python/index.shtml From joesox at gmail.com Mon Jul 3 16:21:51 2006 From: joesox at gmail.com (JoeSox) Date: Mon, 3 Jul 2006 07:21:51 -0700 Subject: [IronPython] Importing embedded .py files In-Reply-To: <44A92032.4000305@voidspace.org.uk> References: <785694cd0607022230l7e286b14ta05385c3f309b554@mail.gmail.com> <5b0248170607022326v5ce2a72nfc890457ec6a60a4@mail.gmail.com> <785694cd0607030647nb03f55cic33bf287d47e651f@mail.gmail.com> <44A92032.4000305@voidspace.org.uk> Message-ID: <785694cd0607030721h1edd709v215bb3e7e70aa738@mail.gmail.com> On 7/3/06, Michael Foord wrote: > JoeSox wrote: > > On 7/2/06, Sanghyeon Seo wrote: > > > >> 2006/7/3, JoeSox : > >> > >>> What is the correct way to import an embedded module file(s) into a > >>> PythonEngine? (snip) > >>> > >> This is an interesting use case that could be done with PEP 302 import > >> hooks. In CPython it was introduced to allow importing modules from > >> .zip files, but in .NET setting it certainly makes sense to allow > >> importing modules embedded in the assembly, which I believe is not yet > >> possible with IronPython. > >> > > > > Interesting. Hopefully it will be supported in the future, until then > > I guess I will include my script files with my .dll, which seems odd > > to. > > > As a workaround, you could create your own module objects very easily > assuming you have the source code as a string. > > import imp > import sys > > newModule = imp.new_module(moduleName) > exec(sourceCode, newModule.__dict__) > sys.modules[moduleName] = newModule > > You *should* then be able to import from this module in the normal way. > (Unless I have made a mistake in the above code.) I can get the resources as a string so I'll have to play around with that. Thanks good idea. -- Later, Joe From s.kobalczyk at softwaremind.pl Mon Jul 3 16:40:36 2006 From: s.kobalczyk at softwaremind.pl (Szymon Kobalczyk) Date: Mon, 03 Jul 2006 16:40:36 +0200 Subject: [IronPython] Importing embedded .py files In-Reply-To: <785694cd0607030721h1edd709v215bb3e7e70aa738@mail.gmail.com> References: <785694cd0607022230l7e286b14ta05385c3f309b554@mail.gmail.com> <5b0248170607022326v5ce2a72nfc890457ec6a60a4@mail.gmail.com> <785694cd0607030647nb03f55cic33bf287d47e651f@mail.gmail.com> <44A92032.4000305@voidspace.org.uk> <785694cd0607030721h1edd709v215bb3e7e70aa738@mail.gmail.com> Message-ID: <44A92C64.4010906@softwaremind.pl> JoeSox napisa?(a): > I can get the resources as a string so I'll have to play around with > that. Thanks good idea. > Hi, From the source code I can see that the FromFile method on Parser class reads the file contents to byte array and later uses MemoryStream to create StreamReader for actual parsing. You can easily generalize this code to extract a FromStream method and then surface it to the PythonEngine API. If you have this you can easily read the file from a resource stream. Szymon Kobalczyk From mbk.lists at gmail.com Mon Jul 3 17:13:59 2006 From: mbk.lists at gmail.com (Mike Krell) Date: Mon, 3 Jul 2006 08:13:59 -0700 Subject: [IronPython] IronPython + IPython? Message-ID: "You got your peanut butter on my chocolate!" "You got your chocolate in my peanut butter!" "Hey, they're two great tastes that taste great together!" What would it take to get IronPython to work well with the IPython shell? A quick google on this topic revealed this message http://www.scipy.net/pipermail/ipython-user/2005-December/001222.html which indicates that sys._getframe would be required. Does FePy support this? Could it be done? Mike From t-clacul at microsoft.com Mon Jul 3 17:56:48 2006 From: t-clacul at microsoft.com (Lee Culver) Date: Mon, 3 Jul 2006 08:56:48 -0700 Subject: [IronPython] IronPython + IPython? In-Reply-To: Message-ID: <529C8DA84B5B364FB86BB4DC8707508B016196FA@RED-MSG-80.redmond.corp.microsoft.com> Let me know if you get this working. IPython is an incredible shell, and combining it with IronPython would be wonderful. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Mike Krell Sent: Monday, July 03, 2006 8:14 AM To: users at lists.ironpython.com; ipython-dev at scipy.net Subject: [IronPython] IronPython + IPython? "You got your peanut butter on my chocolate!" "You got your chocolate in my peanut butter!" "Hey, they're two great tastes that taste great together!" What would it take to get IronPython to work well with the IPython shell? A quick google on this topic revealed this message http://www.scipy.net/pipermail/ipython-user/2005-December/001222.html which indicates that sys._getframe would be required. Does FePy support this? Could it be done? Mike _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From spgoodman at earthlight.net Mon Jul 3 18:43:01 2006 From: spgoodman at earthlight.net (Stephen Goodman) Date: Mon, 3 Jul 2006 17:43:01 +0100 Subject: [IronPython] Request for Info Message-ID: <000501c69ebf$c16e47d0$0207a8c0@eluk1> Greetings all, As a new user of IronPython, but an old programmer of batch files, I'd like to find some kind of equivalency of sorts to aid in the conversion of an old batch file to scripting, so I can bring an old app into the present. Thanks! Stephen Goodman * * Cartoons about DVDs and Stuff * http://www.earthlight.net/HiddenTrack From Martin.Maly at microsoft.com Mon Jul 3 18:49:16 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Mon, 3 Jul 2006 09:49:16 -0700 Subject: [IronPython] IronPython + IPython? In-Reply-To: <529C8DA84B5B364FB86BB4DC8707508B016196FA@RED-MSG-80.redmond.corp.microsoft.com> Message-ID: IronPython doesn't support _getframe yet. It is something that is on our list of things to investigate, but we may not be able to implement it before the next release. Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Lee Culver Sent: Monday, July 03, 2006 8:57 AM To: Discussion of IronPython Subject: Re: [IronPython] IronPython + IPython? Let me know if you get this working. IPython is an incredible shell, and combining it with IronPython would be wonderful. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Mike Krell Sent: Monday, July 03, 2006 8:14 AM To: users at lists.ironpython.com; ipython-dev at scipy.net Subject: [IronPython] IronPython + IPython? "You got your peanut butter on my chocolate!" "You got your chocolate in my peanut butter!" "Hey, they're two great tastes that taste great together!" What would it take to get IronPython to work well with the IPython shell? A quick google on this topic revealed this message http://www.scipy.net/pipermail/ipython-user/2005-December/001222.html which indicates that sys._getframe would be required. Does FePy support this? Could it be done? Mike _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Shri.Borde at microsoft.com Mon Jul 3 19:10:23 2006 From: Shri.Borde at microsoft.com (Shri Borde) Date: Mon, 3 Jul 2006 10:10:23 -0700 Subject: [IronPython] __main__ module and global variables issue... In-Reply-To: <001001c69d92$691f68d0$4201a8c0@tokai> Message-ID: <50B69702CA6E6D4E849D30CD4989AB8E1B69A50DE1@DF-GRTDANE-MSG.exchange.corp.microsoft.com> There should be nothing special about the default scope, other than the fact that all the PythonEngine APIs like Evaluate, Execute have an overload that implicitly operate on the default scope. The DefaultScope is created just like any other scope. Is it possible that you are executing some code that sets the values of your variables to None? You could put a breakpoint in ModuleScope.SetLocal and ModuleScope.SetGlobal to watch for all assignments. Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Alex Henderson Sent: Saturday, July 01, 2006 9:46 PM To: 'Discussion of IronPython' Subject: [IronPython] __main__ module and global variables issue... Our system is using IP for an expression engine - in most cases we are creating a new ModuleScope and evaluating against it, which works fine ie. On setup we assign some global variables, and generate functions on the fly for the lifetime of the module which are evaluated, and thrown away after use. However I've also been using the default module scope for evaluating some expressions, and I seem to be getting some odd behavior... where any global variables we've assigned (in this case, "_container", "_log" and "_config") at some indeterminate point end up reverting to None values - the names still exist, but the references to the class instances have gone. This is only happening for the default module scope, everything works as expected when we create our own module scope... and there's no code being executed other then that which sets the global variables in the first place, which is definitely assigning non-null values (I've changed the methods to set then fetch the value to make sure). Is there perhaps something different between a scope I've created using new ModuleScope(), and the PythonEngine's DefaultModuleScope with regards to global variables? Chez, - Alex _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From t-bruch at microsoft.com Mon Jul 3 19:18:14 2006 From: t-bruch at microsoft.com (Bruce Christensen) Date: Mon, 3 Jul 2006 10:18:14 -0700 Subject: [IronPython] Request for Info In-Reply-To: <000501c69ebf$c16e47d0$0207a8c0@eluk1> References: <000501c69ebf$c16e47d0$0207a8c0@eluk1> Message-ID: <3581AA168D87A2479D88EA319BDF7D32C46103@RED-MSG-80.redmond.corp.microsoft.com> I don't know of any tools or documentation written specifically for people converting from batch files to Python scripts. However, there are a number of useful references available for getting started with Python. Once you have a basic understanding of Python, the conversion will (hopefully) be pretty straightforward. For getting started with Python, take a look at the Python Tutorial at http://docs.python.org/tut/. You may find sections 1-4, 7, and 10 particularly helpful for converting batch files. Other references are available at http://www.python.org/doc/. --Bruce -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Stephen Goodman Sent: Monday, July 03, 2006 9:43 AM To: users at lists.ironpython.com Subject: [IronPython] Request for Info Greetings all, As a new user of IronPython, but an old programmer of batch files, I'd like to find some kind of equivalency of sorts to aid in the conversion of an old batch file to scripting, so I can bring an old app into the present. Thanks! Stephen Goodman * * Cartoons about DVDs and Stuff * http://www.earthlight.net/HiddenTrack _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From alex at syzmk.com Mon Jul 3 23:37:49 2006 From: alex at syzmk.com (Alex Henderson) Date: Tue, 4 Jul 2006 09:37:49 +1200 Subject: [IronPython] __main__ module and global variables issue... In-Reply-To: <50B69702CA6E6D4E849D30CD4989AB8E1B69A50DE1@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <015701c69ee8$eee73950$6701a8c0@tokai> Yep, my apologies it was some errant code that was tripping me up - nothing to do with IP in the end (thankfully :) > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Shri Borde > Sent: Tuesday, 4 July 2006 5:10 a.m. > To: Discussion of IronPython > Subject: Re: [IronPython] __main__ module and global variables issue... > > There should be nothing special about the default scope, other than the > fact that all the PythonEngine APIs like Evaluate, Execute have an > overload that implicitly operate on the default scope. The DefaultScope is > created just like any other scope. > > Is it possible that you are executing some code that sets the values of > your variables to None? You could put a breakpoint in ModuleScope.SetLocal > and ModuleScope.SetGlobal to watch for all assignments. > > Do you want to help develop Dynamic languages on CLR? > (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE- > 11F0-45DF-8B78-DC1B43134038) > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Alex Henderson > Sent: Saturday, July 01, 2006 9:46 PM > To: 'Discussion of IronPython' > Subject: [IronPython] __main__ module and global variables issue... > > Our system is using IP for an expression engine - in most cases we are > creating a new ModuleScope and evaluating against it, which works fine ie. > On setup we assign some global variables, and generate functions on the > fly > for the lifetime of the module which are evaluated, and thrown away after > use. > > However I've also been using the default module scope for evaluating some > expressions, and I seem to be getting some odd behavior... where any > global > variables we've assigned (in this case, "_container", "_log" and > "_config") > at some indeterminate point end up reverting to None values - the names > still exist, but the references to the class instances have gone. > > This is only happening for the default module scope, everything works as > expected when we create our own module scope... and there's no code being > executed other then that which sets the global variables in the first > place, > which is definitely assigning non-null values (I've changed the methods to > set then fetch the value to make sure). > > Is there perhaps something different between a scope I've created using > new > ModuleScope(), and the PythonEngine's DefaultModuleScope with regards to > global variables? > > Chez, > > - Alex > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.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 korpse-ironpython at kaydash.za.net Mon Jul 3 23:53:44 2006 From: korpse-ironpython at kaydash.za.net (Jonathan Jacobs) Date: Mon, 03 Jul 2006 23:53:44 +0200 Subject: [IronPython] Odd behaviour from nested classes Message-ID: <44A991E8.40207@kaydash.za.net> Hi, I just found some incredibly strange behaviour when using nested C# classes. Here's the repro: Test.cs: namespace Test { public class Aye { public class AyeBee { } } } hax/__init__.py: import clr clr.AddReferenceToFile('Test.dll') >>> import hax >>> import Test >>> Test.Aye >>> Test.Aye.AyeBee Traceback (most recent call last): File , line 0, in ##15 AttributeError: type object 'Aye' has no attribute 'AyeBee' >>> import clr >>> Test.Aye.AyeBee The trick here is hax/__init__.py, if I reference the assembly "manually" then the problem ceases to exist. I'm not sure whether this is a quirk of nested classes or the clr module itself. Regards -- Jonathan When you meet a master swordsman, show him your sword. When you meet a man who is not a poet, do not show him your poem. -- Rinzai, ninth century Zen master From korpse-ironpython at kaydash.za.net Tue Jul 4 00:00:33 2006 From: korpse-ironpython at kaydash.za.net (Jonathan Jacobs) Date: Tue, 04 Jul 2006 00:00:33 +0200 Subject: [IronPython] globals() and locals() cause fireworks Message-ID: <44A99381.2080800@kaydash.za.net> IronPython 1.0.60619 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> globals() Process is terminated due to StackOverflowException. IronPython 1.0.60619 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> locals() Process is terminated due to StackOverflowException. Wheee! -- Jonathan From haiboluo at exchange.microsoft.com Tue Jul 4 00:11:10 2006 From: haiboluo at exchange.microsoft.com (Haibo Luo) Date: Mon, 3 Jul 2006 15:11:10 -0700 Subject: [IronPython] globals() and locals() cause fireworks In-Reply-To: <44A99381.2080800@kaydash.za.net> Message-ID: This has been fixed by Dino last week. Please download from codeplex if you need the fix. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jonathan Jacobs Sent: Monday, July 03, 2006 3:01 PM To: Discussion of IronPython Subject: [IronPython] globals() and locals() cause fireworks IronPython 1.0.60619 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> globals() Process is terminated due to StackOverflowException. IronPython 1.0.60619 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> locals() Process is terminated due to StackOverflowException. Wheee! -- Jonathan _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Martin.Maly at microsoft.com Tue Jul 4 00:09:09 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Mon, 3 Jul 2006 15:09:09 -0700 Subject: [IronPython] globals() and locals() cause fireworks In-Reply-To: <44A99381.2080800@kaydash.za.net> Message-ID: Wheee! indeed. Are you using Beta 8? Apparently, this is already fixed on the daily build, sources of which are on codeplex. M. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jonathan Jacobs Sent: Monday, July 03, 2006 3:01 PM To: Discussion of IronPython Subject: [IronPython] globals() and locals() cause fireworks IronPython 1.0.60619 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> globals() Process is terminated due to StackOverflowException. IronPython 1.0.60619 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> locals() Process is terminated due to StackOverflowException. Wheee! -- Jonathan _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From korpse-ironpython at kaydash.za.net Tue Jul 4 00:19:13 2006 From: korpse-ironpython at kaydash.za.net (Jonathan Jacobs) Date: Tue, 04 Jul 2006 00:19:13 +0200 Subject: [IronPython] globals() and locals() cause fireworks In-Reply-To: References: Message-ID: <44A997E1.8090703@kaydash.za.net> Martin Maly wrote: > Wheee! indeed. Are you using Beta 8? Apparently, this is already fixed on > the daily build, sources of which are on codeplex. I see Haibo said the same thing. I'll update if I actually need either. I wanted to use these to debug my previous problem. Thanks -- Jonathan From jvm_cop at spamcop.net Tue Jul 4 05:30:41 2006 From: jvm_cop at spamcop.net (J. Merrill) Date: Mon, 03 Jul 2006 23:30:41 -0400 Subject: [IronPython] Request for Info In-Reply-To: <000501c69ebf$c16e47d0$0207a8c0@eluk1> References: <000501c69ebf$c16e47d0$0207a8c0@eluk1> Message-ID: <7.0.1.0.2.20060703232247.07f212a8@wheresmymailserver.com> I'm a batch file guy too but not a Python (or IronPython) expert. You need to make a key decision: are you planning to re-write a particular batch file as a single Python program, or are you hoping to be able to simplify your batch file by invoking Python to do something that's a pain in batch-land? For example, the ability to get a string of the form YYYY-MM-DD with today's date in it (and put that string into a batch file variable) is useful, but it's painful in batch language, at least in part because you can't know what format the user's PC uses for dates. (Is 2/3/2006 Feb 3 or March 2?) You might have a batch file that has a collection of statements to do that work and want to replace them with a call to the Python interpreter. However, if your purpose in getting such a string is so that you can (e.g.) rename a bunch of files by sticking the date at the end of the current filename (before the extension), and you're doing so with a "for each do" loop in batch-language, it might make sense to do it all in Python. Are your batch files simple & non-proprietary enough that you can post one and we can help you look at your options? At 12:43 PM 7/3/2006, Stephen Goodman wrote >Greetings all, > >As a new user of IronPython, but an old programmer of batch files, I'd like >to find some kind of equivalency of sorts to aid in the conversion of an old >batch file to scripting, so I can bring an old app into the present. >Thanks! > >Stephen Goodman J. Merrill / Analytical Software Corp From joesox at gmail.com Tue Jul 4 07:09:34 2006 From: joesox at gmail.com (JoeSox) Date: Mon, 3 Jul 2006 22:09:34 -0700 Subject: [IronPython] Importing embedded .py files In-Reply-To: <44A92032.4000305@voidspace.org.uk> References: <785694cd0607022230l7e286b14ta05385c3f309b554@mail.gmail.com> <5b0248170607022326v5ce2a72nfc890457ec6a60a4@mail.gmail.com> <785694cd0607030647nb03f55cic33bf287d47e651f@mail.gmail.com> <44A92032.4000305@voidspace.org.uk> Message-ID: <785694cd0607032209i7010dd13jc0b0241a00b045bb@mail.gmail.com> This is working except two of the embedded .py files import each other, so no matter which one I place first, it errors out. So I guess I can catch it. lol. It's going to end up being about 60+ lines of code to import 9 modules into the engine. Or, I could modify the .py files some more but I prefer not to. On 7/3/06, Michael Foord wrote: > As a workaround, you could create your own module objects very easily > assuming you have the source code as a string. > > import imp > import sys > > newModule = imp.new_module(moduleName) > exec(sourceCode, newModule.__dict__) > sys.modules[moduleName] = newModule > > You *should* then be able to import from this module in the normal way. > (Unless I have made a mistake in the above code.) > > All the best, -- Later, Joe From joesox at gmail.com Tue Jul 4 07:43:15 2006 From: joesox at gmail.com (JoeSox) Date: Mon, 3 Jul 2006 22:43:15 -0700 Subject: [IronPython] Importing embedded .py files In-Reply-To: <44A92C64.4010906@softwaremind.pl> References: <785694cd0607022230l7e286b14ta05385c3f309b554@mail.gmail.com> <5b0248170607022326v5ce2a72nfc890457ec6a60a4@mail.gmail.com> <785694cd0607030647nb03f55cic33bf287d47e651f@mail.gmail.com> <44A92032.4000305@voidspace.org.uk> <785694cd0607030721h1edd709v215bb3e7e70aa738@mail.gmail.com> <44A92C64.4010906@softwaremind.pl> Message-ID: <785694cd0607032243u61db0fb8g8a40c1e5f6d8b0ca@mail.gmail.com> Thanks Szymon for the reply and I have looked at your proposed solution. I already can achieve reading the resource files using StreamReader. If it's easy to surface it into PythonEngine so it appears to already been imported, then I am asking for more clarity because I do not see what method I need to be calling. If I call: myIronPythonEngine.Evaluate(Misc.getEmbeddedResourceContent("CNUDB.py")); //getEmbeddedResourceContent returns a string I get 'unexpected token import' probably formatting issues which are too numerous for me to manually to fix because of the .py file size and the other files I need to do the same for. If I call: cn_pe.Import(Misc.getEmbeddedResourceContent("CNUDB.py")); I get 'Illegal characters in path.' So I really don't know what else to try. These are only a few things out of a number of methods I have tried. I am still open to specific suggestions but I am almost completed with the workaround suggested by Michael. Joe On 7/3/06, Szymon Kobalczyk wrote: > Hi, > From the source code I can see that the FromFile method on Parser class > reads the file contents to byte array and later uses MemoryStream to > create StreamReader for actual parsing. You can easily generalize this > code to extract a FromStream method and then surface it to the > PythonEngine API. > If you have this you can easily read the file from a resource stream. -- Later, Joe From fuzzyman at voidspace.org.uk Tue Jul 4 09:08:16 2006 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 04 Jul 2006 08:08:16 +0100 Subject: [IronPython] Importing embedded .py files In-Reply-To: <785694cd0607032209i7010dd13jc0b0241a00b045bb@mail.gmail.com> References: <785694cd0607022230l7e286b14ta05385c3f309b554@mail.gmail.com> <5b0248170607022326v5ce2a72nfc890457ec6a60a4@mail.gmail.com> <785694cd0607030647nb03f55cic33bf287d47e651f@mail.gmail.com> <44A92032.4000305@voidspace.org.uk> <785694cd0607032209i7010dd13jc0b0241a00b045bb@mail.gmail.com> Message-ID: <44AA13E0.7050900@voidspace.org.uk> JoeSox wrote: > This is working except two of the embedded .py files import each > other, so no matter which one I place first, it errors out. Try creating the empty modules and putting them in sys.modules first. I think this is basically what the import machinery does in cases of circular imports. Michael Foord http://www.voidspace.org.uk/python/index.shtml > So I > guess I can catch it. lol. It's going to end up being about 60+ lines > of code to import 9 modules into the engine. > Or, I could modify the .py files some more but I prefer not to. > > > On 7/3/06, Michael Foord wrote: > >> As a workaround, you could create your own module objects very easily >> assuming you have the source code as a string. >> >> import imp >> import sys >> >> newModule = imp.new_module(moduleName) >> exec(sourceCode, newModule.__dict__) >> sys.modules[moduleName] = newModule >> >> You *should* then be able to import from this module in the normal way. >> (Unless I have made a mistake in the above code.) >> >> All the best, >> > > From ernsnat at iit.edu Tue Jul 4 09:12:46 2006 From: ernsnat at iit.edu (Nathan R. Ernst) Date: Tue, 4 Jul 2006 02:12:46 -0500 Subject: [IronPython] Importing embedded .py files In-Reply-To: <785694cd0607032209i7010dd13jc0b0241a00b045bb@mail.gmail.com> Message-ID: <20060704071019.8B3A31BB61@che.dreamhost.com> Out of curiosity, is there any sort of hook into the engine that would allow you search for a module on your own? e.g. a search of sys.path did not find the specified module, so before raising an import error, we give a set of registered event handlers a crack at it? I would envision a cancelable event would be raised, such that the first handler (if any) to successfully find the module would prevent further handlers from being called. I would need to take a closer look at the engine interfaces to see if this would work, but I'd think this would be a relatively minor change (if its not there already, of course). -Nathan -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of JoeSox Sent: Tuesday, July 04, 2006 12:10 AM To: Discussion of IronPython Subject: Re: [IronPython] Importing embedded .py files This is working except two of the embedded .py files import each other, so no matter which one I place first, it errors out. So I guess I can catch it. lol. It's going to end up being about 60+ lines of code to import 9 modules into the engine. Or, I could modify the .py files some more but I prefer not to. On 7/3/06, Michael Foord wrote: > As a workaround, you could create your own module objects very easily > assuming you have the source code as a string. > > import imp > import sys > > newModule = imp.new_module(moduleName) > exec(sourceCode, newModule.__dict__) > sys.modules[moduleName] = newModule > > You *should* then be able to import from this module in the normal way. > (Unless I have made a mistake in the above code.) > > All the best, -- Later, Joe _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From joesox at gmail.com Tue Jul 4 09:47:24 2006 From: joesox at gmail.com (JoeSox) Date: Tue, 4 Jul 2006 00:47:24 -0700 Subject: [IronPython] Importing embedded .py files In-Reply-To: <44AA13E0.7050900@voidspace.org.uk> References: <785694cd0607022230l7e286b14ta05385c3f309b554@mail.gmail.com> <5b0248170607022326v5ce2a72nfc890457ec6a60a4@mail.gmail.com> <785694cd0607030647nb03f55cic33bf287d47e651f@mail.gmail.com> <44A92032.4000305@voidspace.org.uk> <785694cd0607032209i7010dd13jc0b0241a00b045bb@mail.gmail.com> <44AA13E0.7050900@voidspace.org.uk> Message-ID: <785694cd0607040047v2a685421r76f7a72d7f4646dd@mail.gmail.com> On 7/4/06, Michael Foord wrote: > JoeSox wrote: > > This is working except two of the embedded .py files import each > > other, so no matter which one I place first, it errors out. > Try creating the empty modules and putting them in sys.modules first. I > think this is basically what the import machinery does in cases of > circular imports. Yes, that worked. Now the only error I get from my project is still the "Unable to translate bytes [81] at index 0 from specified code page to Unicode" coming from the array.py file I am using http://codespeak.net/svn/user/nik/array_py/trunk/src/array.py It sounds like some incoming arraytype is set incorrectly but I doubt it because I haven't changed much of the code in the ConceptNet modules. There must be something different between that array.py file and Python's builtin array but I have no idea since I really can't find the actual sourcecode for Python's array module. Also, I forget if I had it working with this new array.py file or my old array.py file. Anyway, I appreciate the help. -- Later, Joe From joesox at gmail.com Tue Jul 4 10:01:04 2006 From: joesox at gmail.com (JoeSox) Date: Tue, 4 Jul 2006 01:01:04 -0700 Subject: [IronPython] Importing embedded .py files In-Reply-To: <20060704071019.8B3A31BB61@che.dreamhost.com> References: <785694cd0607032209i7010dd13jc0b0241a00b045bb@mail.gmail.com> <20060704071019.8B3A31BB61@che.dreamhost.com> Message-ID: <785694cd0607040101i2ccdbd05k62eb78b8b38021c9@mail.gmail.com> On 7/4/06, Nathan R. Ernst wrote: > Out of curiosity, is there any sort of hook into the engine that would allow > you search for a module on your own? e.g. a search of sys.path did not find > the specified module, so before raising an import error, we give a set of > registered event handlers a crack at it? I would envision a cancelable event > would be raised, such that the first handler (if any) to successfully find > the module would prevent further handlers from being called. > > I would need to take a closer look at the engine interfaces to see if this > would work, but I'd think this would be a relatively minor change (if its > not there already, of course). If I understand you correctly, I could just catch the "could not import" exception (because that is really the only "hook" into the engine in this case, and then grab the module name from the exception string then pass it to something like: public searchForModule(string modname) { Assembly myAssembly = Assembly.GetExecutingAssembly(); string resName = String.Empty; foreach (string resourceName in myAssembly.GetManifestResourceNames()) { if (resourceName.IndexOf(modname+".py") >= 0) { do something; break; } } } -- Later, Joe From fuzzyman at voidspace.org.uk Tue Jul 4 10:03:29 2006 From: fuzzyman at voidspace.org.uk (Fuzzyman) Date: Tue, 04 Jul 2006 09:03:29 +0100 Subject: [IronPython] Importing embedded .py files In-Reply-To: <785694cd0607040047v2a685421r76f7a72d7f4646dd@mail.gmail.com> References: <785694cd0607022230l7e286b14ta05385c3f309b554@mail.gmail.com> <5b0248170607022326v5ce2a72nfc890457ec6a60a4@mail.gmail.com> <785694cd0607030647nb03f55cic33bf287d47e651f@mail.gmail.com> <44A92032.4000305@voidspace.org.uk> <785694cd0607032209i7010dd13jc0b0241a00b045bb@mail.gmail.com> <44AA13E0.7050900@voidspace.org.uk> <785694cd0607040047v2a685421r76f7a72d7f4646dd@mail.gmail.com> Message-ID: <44AA20D1.9040207@voidspace.org.uk> JoeSox wrote: >On 7/4/06, Michael Foord wrote: > > >>JoeSox wrote: >> >> >>>This is working except two of the embedded .py files import each >>>other, so no matter which one I place first, it errors out. >>> >>> >>Try creating the empty modules and putting them in sys.modules first. I >>think this is basically what the import machinery does in cases of >>circular imports. >> >> > >Yes, that worked. >Now the only error I get from my project is still the >"Unable to translate bytes [81] at index 0 from specified code page to Unicode" >coming from the array.py file I am using >http://codespeak.net/svn/user/nik/array_py/trunk/src/array.py > >It sounds like some incoming arraytype is set incorrectly but I doubt >it because I haven't changed much of the code in the ConceptNet >modules. There must be something different between that array.py file >and Python's builtin array but I have no idea since I really can't >find the actual sourcecode for Python's array module. >Also, I forget if I had it working with this new array.py file or my >old array.py file. > > Hmmm... well here is the source code for the Python array module. I'm not sure it will help much though. http://svn.python.org/view/python/trunk/Modules/arraymodule.c?&view=markup Perhaps you could contact the author of the PyPy version of array and see if he can help. It looks like it's this guy : http://ubique.ch/soc/?p=2 All the best, Michael Foord http://www.voidspace.org.uk/python/index.shtml >Anyway, I appreciate the help. > > From joesox at gmail.com Tue Jul 4 10:18:13 2006 From: joesox at gmail.com (JoeSox) Date: Tue, 4 Jul 2006 01:18:13 -0700 Subject: [IronPython] Importing embedded .py files In-Reply-To: <44AA20D1.9040207@voidspace.org.uk> References: <785694cd0607022230l7e286b14ta05385c3f309b554@mail.gmail.com> <5b0248170607022326v5ce2a72nfc890457ec6a60a4@mail.gmail.com> <785694cd0607030647nb03f55cic33bf287d47e651f@mail.gmail.com> <44A92032.4000305@voidspace.org.uk> <785694cd0607032209i7010dd13jc0b0241a00b045bb@mail.gmail.com> <44AA13E0.7050900@voidspace.org.uk> <785694cd0607040047v2a685421r76f7a72d7f4646dd@mail.gmail.com> <44AA20D1.9040207@voidspace.org.uk> Message-ID: <785694cd0607040118r705d136m8df81015dcf26187@mail.gmail.com> On 7/4/06, Fuzzyman wrote: > Hmmm... well here is the source code for the Python array module. I'm > not sure it will help much though. > > http://svn.python.org/view/python/trunk/Modules/arraymodule.c?&view=markup Outstanding! Although, my brain is about to power down soon even though I will probably take a quick look. > Perhaps you could contact the author of the PyPy version of array and > see if he can help. It looks like it's this guy : > > http://ubique.ch/soc/?p=2 I may have to if I can't figure it out. or I wonder if I can recompile it and reference it as a dll or something in IronPython? Always two steps forward and one step back. :) -- Later, Joe From korpse-ironpython at kaydash.za.net Tue Jul 4 19:21:46 2006 From: korpse-ironpython at kaydash.za.net (Jonathan Jacobs) Date: Tue, 04 Jul 2006 19:21:46 +0200 Subject: [IronPython] Importing embedded .py files In-Reply-To: <20060704071019.8B3A31BB61@che.dreamhost.com> References: <20060704071019.8B3A31BB61@che.dreamhost.com> Message-ID: <44AAA3AA.8080603@kaydash.za.net> Nathan R. Ernst wrote: > Out of curiosity, is there any sort of hook into the engine that would allow > you search for a module on your own? e.g. a search of sys.path did not find I'm not sure how well this is going to work with IronPython, but in CPython you're advised to use ihooks (http://pydoc.org/2.4.1/ihooks.html), which is a pure Python module in the stdlib, to write your own import hooks. -- Jonathan From raathm at gmail.com Tue Jul 4 19:23:00 2006 From: raathm at gmail.com (Mike Raath) Date: Tue, 4 Jul 2006 19:23:00 +0200 Subject: [IronPython] Bug in time.strptime? In-Reply-To: <664260580607030250i450da6c2j5f403d7d9eb229ae@mail.gmail.com> References: <664260580607030250i450da6c2j5f403d7d9eb229ae@mail.gmail.com> Message-ID: <664260580607041023h24d7aa9amaf72562faa69187c@mail.gmail.com> Just wondering if this post slipped in under the radar - can anyone please confirm whether this is a bug, or if I could be using IronPython differently to achieve the same thing? I need to be able to interpret non-standard dates (the format of which I can't dictate) and in CPython this is possible using the code below. Thanks, Mike I'm getting an exception in IronPython which I don't get in CPython. > > From the CPython console window: > > >>> import time, datetime > >>> d = time.strptime("July 3, 2006 At 0724 GMT", "%B %d, %Y At %H%M GMT") > > >>> print d > (2006, 7, 3, 7, 24, 0, 0, 184, -1) > > > From IronPython, a similar set of statements: > > engine.Execute("import datetime") > engine.Execute("d = time.strptime(""July 3, 2006 At 0724 GMT"", ""%B %d, > %Y At %H%M GMT"")") > > results in this exception: > The string was not recognized as a valid DateTime. There is a unknown word > starting at index 13. > > > > The word starting at index 13 is the "At" but the format string provided > should tell strptime how to interpret it. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From joesox at gmail.com Tue Jul 4 19:52:37 2006 From: joesox at gmail.com (JoeSox) Date: Tue, 4 Jul 2006 10:52:37 -0700 Subject: [IronPython] Id: 356 unicode throws when creating a Unicode string from an invalid Unicode string (was Re: Importing embedded .py files) Message-ID: <785694cd0607041052p61c9a794jd91b59ebde7457fe@mail.gmail.com> On 7/4/06, Fuzzyman wrote: > Hmmm... well here is the source code for the Python array module. I'm > not sure it will help much though. > > http://svn.python.org/view/python/trunk/Modules/arraymodule.c?&view=markup Ah, it looks like this specific error is known http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkItemId=356 http://lists.ironpython.com/pipermail/users-ironpython.com/2006-May/002235.html I'm not sure how to workaround this one yet and it looks like I will be waiting for 1.0rc. Here is my stack if anyone is interested. [I have some comments next to some tracelines that explain what it should be doing]: Traceback (most recent call last): File , line 0, in ##70 File E:\CNUDB.py, line 24, in __init__ [self.nltools = CNUTools.ConceptNetNLTools(self)] File E:\CNUTools.py, line 13, in __init__ [self.m = CNUMontylingua.MontyLingua()] File E:\CNUMontylingua.py, line 15, in __init__ [self.theMontyLemmatiser = MontyLemmatiser.MontyLemmatiser()] File E:\CNUMontyTagger.py, line 15, in __init__ [self.theLexicon=CNUMontyLexiconFast.MontyLexiconFast()] File E:\CNUMontyLexiconFast.py, line 37, in __init__ [self.load_fastlexicon()] (found .MDF file "FASTLEXICON") File E:\CNUMontyLexiconFast.py, line 101, in load_fastlexicon [line1=self.array_fromfile(res_arr,self.word_start_arr,built_in_p,self.java_p,java_code='ws')] * res_arr = " * built_in_p = 260759 * line1 = None File CNUMontyLexiconFast, line unknown, in array_fromfile ? File E:\CNUMontyLexiconFast.py, line 254, in array_fromfile [array_ptr.fromfile(file_ptr,length)] file_ptr = " References: <44A2CE0B.4050107@bostream.nu> <4039D552ADAB094BB1EA670F3E96214E03E9FC8051@df-foxhound-msg.exchange.corp.microsoft.com> <44A2F2C7.90505@bostream.nu> <4039D552ADAB094BB1EA670F3E96214E03E9FC8268@df-foxhound-msg.exchange.corp.microsoft.com> <44A4268E.9010902@bostream.nu> <4039D552ADAB094BB1EA670F3E96214E03F7B991E7@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <44AABA8A.4010007@bostream.nu> Dino, thanks for your suggestion. It worked out fine. Now I have basic typing in pyreadline but I still have work to do to get editing and keyboard shortcuts to work. I'll post again when I have something more useful. While doing this I stumbled on this traceback inconsistency to cpython which took me a while to figure out. Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> def c(): ... pass ... >>> a,b=c() Traceback (most recent call last): File "", line 1, in ? TypeError: unpack non-sequence >>> IronPython 1.0.2375 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> def c(): ... pass ... >>> a,b=c() Traceback (most recent call last): File , line 0, in ##58 TypeError: None is not enumerable >>> /J?rgen Dino Viehland skrev: > Unfortunately there's currently no way to switch this from Python code. > > What we need to do is expose something in IronPythonConsole.exe which lets you set PythonCommandLine.MyConsole (currently you can't do this because PythonCommandLine is private). If you made PythonCommandLine public you could do clr.AddReference('IronPythonConsole.exe') and then from IronPythonConsole import PythonCommandLine, IConsole. Finally you can implement your own console: > > class MyConsole(IConsole): > def ReadLine(autoIndentSize): pass > def Write(text, style): pass > def WriteLine(text, style): pass > > > and then call PythonCommandLine.MyConsole = MyConsole() > > and those methods will override the interface implementation (or in other words - it's quite easy to deal with overriding methods :) ). > > That's the hacky way to get to where you can start experimenting with this. We probably need to come up w/ a better long-term way to do this. This is an unfortunate side effect of the runtime & console being so separated - the runtime doesn't know anything about the console, and the console can't use the runtime's stdin because it needs to be able to deal w/ input such as arrow keys. > > I don't know that we could do anything here before 1.0, but I'll open a CodePlex bug for improving console <-> runtime interop. > > From simon.dahlbacka at gmail.com Wed Jul 5 14:44:12 2006 From: simon.dahlbacka at gmail.com (Simon Dahlbacka) Date: Wed, 5 Jul 2006 15:44:12 +0300 Subject: [IronPython] site.py discrepancy Message-ID: <57124720607050544i3a56c813s8fee90a9c558ed43@mail.gmail.com> if I put a site.py file with the following contents # begin site.py print "Hello World" # end site.py next to IronPythonConsole.exe and start ironpython I get the following output: Hello World IronPython 1.0.60619 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> so site is automatically imported but when I do a dir() then I see ['__builtins__', '__doc__', '__name__', 'site'] while in CPytion the 'site' is not in dir() /Simon BTW. it seems I cannot copy from the IronPythonConsole window (at least not like from a normal "cmd" window, i.e. right-click -> Mark -> select, rightclick), I don't get a rightclick menu? -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrzej.krzywda at resolversystems.com Wed Jul 5 16:19:56 2006 From: andrzej.krzywda at resolversystems.com (Andrzej Krzywda) Date: Wed, 05 Jul 2006 15:19:56 +0100 Subject: [IronPython] Constructor overloading Message-ID: <44ABCA8C.3080203@resolversystems.com> Hello all, We are trying to create a .Net type object which has several one-parameter constructors. By default it does the wrong thing and we want to specify which constructor is called. We tried: Icon.__overloads__[Stream](myStream) Icon.__init__.__new__.__overloads__[Stream](myStream) but neither of these methods work. How can we do it? We also attempted to work around the issue by using Reflection on the Icon class: typeof(Icon).GetConstructor([Stream]).Invoke([myStream]) but we can't find the IronPython equivalent of typeof. Does it exist? -- Andrzej Krzywda From dinov at exchange.microsoft.com Wed Jul 5 18:29:24 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 5 Jul 2006 09:29:24 -0700 Subject: [IronPython] Importing embedded .py files In-Reply-To: <44AAA3AA.8080603@kaydash.za.net> References: <20060704071019.8B3A31BB61@che.dreamhost.com> <44AAA3AA.8080603@kaydash.za.net> Message-ID: <4039D552ADAB094BB1EA670F3E96214E0445BB6E53@df-foxhound-msg.exchange.corp.microsoft.com> I've opened a bug on CodePlex (bug 775 http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkItemId=775) to implement PEP-302 which seems to be the new version of ihooks (it says no one was satisfied w/ ihooks). I've opened it as a post-1.0 bug. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jonathan Jacobs Sent: Tuesday, July 04, 2006 10:22 AM To: Discussion of IronPython Subject: Re: [IronPython] Importing embedded .py files Nathan R. Ernst wrote: > Out of curiosity, is there any sort of hook into the engine that would > allow you search for a module on your own? e.g. a search of sys.path > did not find I'm not sure how well this is going to work with IronPython, but in CPython you're advised to use ihooks (http://pydoc.org/2.4.1/ihooks.html), which is a pure Python module in the stdlib, to write your own import hooks. -- Jonathan _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Wed Jul 5 18:33:14 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 5 Jul 2006 09:33:14 -0700 Subject: [IronPython] Importing embedded .py files In-Reply-To: <785694cd0607040047v2a685421r76f7a72d7f4646dd@mail.gmail.com> References: <785694cd0607022230l7e286b14ta05385c3f309b554@mail.gmail.com> <5b0248170607022326v5ce2a72nfc890457ec6a60a4@mail.gmail.com> <785694cd0607030647nb03f55cic33bf287d47e651f@mail.gmail.com> <44A92032.4000305@voidspace.org.uk> <785694cd0607032209i7010dd13jc0b0241a00b045bb@mail.gmail.com> <44AA13E0.7050900@voidspace.org.uk> <785694cd0607040047v2a685421r76f7a72d7f4646dd@mail.gmail.com> Message-ID: <4039D552ADAB094BB1EA670F3E96214E0445BB6E5B@df-foxhound-msg.exchange.corp.microsoft.com> This is likely due to a Unicode / ASCII difference. I suspect that somewhere someone is calling str(xyz) or unicode(xyz) w/ a character that is outside of the ASCII range but also doesn't decode into Unicode. For an example of this you can look at bug 356 on CodePlex http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkItemId=356 I'm not entirely sure how we go about handling this due to the differences in the way the two implementations handle strings (all of ours are Unicode), but we will try and work on a solution for v1.0. If you could look and see if this is coming from a call to the built-in str or unicode types that would be helpful in understanding how we need to fix this (ParrotBench also runs into this issue an expects an exception, so unfortuntately it's not as easy as suppressing the exception - as it is correct sometimes). -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of JoeSox Sent: Tuesday, July 04, 2006 12:47 AM To: Discussion of IronPython Subject: Re: [IronPython] Importing embedded .py files On 7/4/06, Michael Foord wrote: > JoeSox wrote: > > This is working except two of the embedded .py files import each > > other, so no matter which one I place first, it errors out. > Try creating the empty modules and putting them in sys.modules first. > I think this is basically what the import machinery does in cases of > circular imports. Yes, that worked. Now the only error I get from my project is still the "Unable to translate bytes [81] at index 0 from specified code page to Unicode" coming from the array.py file I am using http://codespeak.net/svn/user/nik/array_py/trunk/src/array.py It sounds like some incoming arraytype is set incorrectly but I doubt it because I haven't changed much of the code in the ConceptNet modules. There must be something different between that array.py file and Python's builtin array but I have no idea since I really can't find the actual sourcecode for Python's array module. Also, I forget if I had it working with this new array.py file or my old array.py file. Anyway, I appreciate the help. -- Later, Joe _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Wed Jul 5 18:39:29 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 5 Jul 2006 09:39:29 -0700 Subject: [IronPython] Constructor overloading In-Reply-To: <44ABCA8C.3080203@resolversystems.com> References: <44ABCA8C.3080203@resolversystems.com> Message-ID: <4039D552ADAB094BB1EA670F3E96214E0445BB6E6B@df-foxhound-msg.exchange.corp.microsoft.com> To do typeof you can do: import clr clr.GetClrType(pythonType) and then you can do the GetConstructor call. There have been some recent fixes which change the way overloading constructors works - you'll want to overload __new__ and not __init__. There was some potential for confusion here in beta 8 and earlier. But the correct way to call it should be via new, so you should be able to do: Class MySubClass(MyDotNetBaseClass): def __new__(cls, arg): return MyDotNetBaseClass.__new__(cls, arg) and then to select overloads you should be able to do: class MySubClass(MyDotNetBaseClass): def __new__(cls, arg): return MyDotNetBaseClass.__overloads__[Stream](cls, arg) If that doesn't work for you w/ Beta 8 you might want to try downloading the latest bits and see if that fixes it for you. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Andrzej Krzywda Sent: Wednesday, July 05, 2006 7:20 AM To: Discussion of IronPython Subject: [IronPython] Constructor overloading Hello all, We are trying to create a .Net type object which has several one-parameter constructors. By default it does the wrong thing and we want to specify which constructor is called. We tried: Icon.__overloads__[Stream](myStream) Icon.__init__.__new__.__overloads__[Stream](myStream) but neither of these methods work. How can we do it? We also attempted to work around the issue by using Reflection on the Icon class: typeof(Icon).GetConstructor([Stream]).Invoke([myStream]) but we can't find the IronPython equivalent of typeof. Does it exist? -- Andrzej Krzywda _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Wed Jul 5 18:44:01 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 5 Jul 2006 09:44:01 -0700 Subject: [IronPython] Bug in time.strptime? In-Reply-To: <664260580607041023h24d7aa9amaf72562faa69187c@mail.gmail.com> References: <664260580607030250i450da6c2j5f403d7d9eb229ae@mail.gmail.com> <664260580607041023h24d7aa9amaf72562faa69187c@mail.gmail.com> Message-ID: <4039D552ADAB094BB1EA670F3E96214E0445BB6E79@df-foxhound-msg.exchange.corp.microsoft.com> Sorry for the delay - it was a really long weekend for many of us. Currently our strptime implementation is mostly built by translating from Python formatting codes to .NET formatting codes and then calling the .NET Formatting APIs. There's apparently a difference here in that .NET doesn't allow random extra characters in its formatting strings, and CPython does. I've opened a bug on CodePlex (#776, http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkItemId=776) to track this. We'll try and get to this for 1.0 but I'm not entirely sure we'll be able to get it done in time. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Mike Raath Sent: Tuesday, July 04, 2006 10:23 AM To: users at lists.ironpython.com Subject: Re: [IronPython] Bug in time.strptime? Just wondering if this post slipped in under the radar - can anyone please confirm whether this is a bug, or if I could be using IronPython differently to achieve the same thing? I need to be able to interpret non-standard dates (the format of which I can't dictate) and in CPython this is possible using the code below. Thanks, Mike I'm getting an exception in IronPython which I don't get in CPython. >From the CPython console window: >>> import time, datetime >>> d = time.strptime("July 3, 2006 At 0724 GMT", "%B %d, %Y At %H%M GMT") >>> print d (2006, 7, 3, 7, 24, 0, 0, 184, -1) >From IronPython, a similar set of statements: engine.Execute("import datetime") engine.Execute("d = time.strptime(""July 3, 2006 At 0724 GMT"", ""%B %d, %Y At %H%M GMT"")") results in this exception: The string was not recognized as a valid DateTime. There is a unknown word starting at index 13. The word starting at index 13 is the "At" but the format string provided should tell strptime how to interpret it. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Wed Jul 5 18:47:39 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 5 Jul 2006 09:47:39 -0700 Subject: [IronPython] ironpython alternative to PyOS_ReadlineFunctionPointer In-Reply-To: <44AABA8A.4010007@bostream.nu> References: <44A2CE0B.4050107@bostream.nu> <4039D552ADAB094BB1EA670F3E96214E03E9FC8051@df-foxhound-msg.exchange.corp.microsoft.com> <44A2F2C7.90505@bostream.nu> <4039D552ADAB094BB1EA670F3E96214E03E9FC8268@df-foxhound-msg.exchange.corp.microsoft.com> <44A4268E.9010902@bostream.nu> <4039D552ADAB094BB1EA670F3E96214E03F7B991E7@df-foxhound-msg.exchange.corp.microsoft.com> <44AABA8A.4010007@bostream.nu> Message-ID: <4039D552ADAB094BB1EA670F3E96214E0445BB6E86@df-foxhound-msg.exchange.corp.microsoft.com> Thanks for the bug report - this one should be pretty easy to fix, we'll try and get it in for the next release. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of J?rgen Stenarson Sent: Tuesday, July 04, 2006 11:59 AM To: Discussion of IronPython Subject: Re: [IronPython] ironpython alternative to PyOS_ReadlineFunctionPointer Dino, thanks for your suggestion. It worked out fine. Now I have basic typing in pyreadline but I still have work to do to get editing and keyboard shortcuts to work. I'll post again when I have something more useful. While doing this I stumbled on this traceback inconsistency to cpython which took me a while to figure out. Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> def c(): ... pass ... >>> a,b=c() Traceback (most recent call last): File "", line 1, in ? TypeError: unpack non-sequence >>> IronPython 1.0.2375 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> def c(): ... pass ... >>> a,b=c() Traceback (most recent call last): File , line 0, in ##58 TypeError: None is not enumerable >>> /J?rgen Dino Viehland skrev: > Unfortunately there's currently no way to switch this from Python code. > > What we need to do is expose something in IronPythonConsole.exe which lets you set PythonCommandLine.MyConsole (currently you can't do this because PythonCommandLine is private). If you made PythonCommandLine public you could do clr.AddReference('IronPythonConsole.exe') and then from IronPythonConsole import PythonCommandLine, IConsole. Finally you can implement your own console: > > class MyConsole(IConsole): > def ReadLine(autoIndentSize): pass > def Write(text, style): pass > def WriteLine(text, style): pass > > > and then call PythonCommandLine.MyConsole = MyConsole() > > and those methods will override the interface implementation (or in other words - it's quite easy to deal with overriding methods :) ). > > That's the hacky way to get to where you can start experimenting with this. We probably need to come up w/ a better long-term way to do this. This is an unfortunate side effect of the runtime & console being so separated - the runtime doesn't know anything about the console, and the console can't use the runtime's stdin because it needs to be able to deal w/ input such as arrow keys. > > I don't know that we could do anything here before 1.0, but I'll open a CodePlex bug for improving console <-> runtime interop. > > _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Wed Jul 5 18:50:49 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 5 Jul 2006 09:50:49 -0700 Subject: [IronPython] site.py discrepancy In-Reply-To: <57124720607050544i3a56c813s8fee90a9c558ed43@mail.gmail.com> References: <57124720607050544i3a56c813s8fee90a9c558ed43@mail.gmail.com> Message-ID: <4039D552ADAB094BB1EA670F3E96214E0445BB6E8F@df-foxhound-msg.exchange.corp.microsoft.com> Thanks for the bug report! I've opened this on CodePlex as bug 778 - http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkItemId=778 - I've tentatively opened it against 1.0 RC, but I've left the priority low as I'm not sure what the possible underlying issue is here, or how risky the change may be. As for the copy & paste functionality this all comes from the Windows console, and it's off by default, and is enabled on a per-app basis. If you right click the menu bar, select Properties, go to Options, and Check Quick Edit you'll get this for your IP Consoles as well (and then choose save when you're done). You may also want to set the layout to be a more sane set of options while you're there as well J. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Simon Dahlbacka Sent: Wednesday, July 05, 2006 5:44 AM To: Discussion of IronPython Subject: [IronPython] site.py discrepancy if I put a site.py file with the following contents # begin site.py print "Hello World" # end site.py next to IronPythonConsole.exe and start ironpython I get the following output: Hello World IronPython 1.0.60619 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> so site is automatically imported but when I do a dir() then I see ['__builtins__', '__doc__', '__name__', 'site'] while in CPytion the 'site' is not in dir() /Simon BTW. it seems I cannot copy from the IronPythonConsole window (at least not like from a normal "cmd" window, i.e. right-click -> Mark -> select, rightclick), I don't get a rightclick menu? -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Wed Jul 5 18:45:32 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 5 Jul 2006 09:45:32 -0700 Subject: [IronPython] Id: 356 unicode throws when creating a Unicode string from an invalid Unicode string (was Re: Importing embedded .py files) In-Reply-To: <785694cd0607041052p61c9a794jd91b59ebde7457fe@mail.gmail.com> References: <785694cd0607041052p61c9a794jd91b59ebde7457fe@mail.gmail.com> Message-ID: <4039D552ADAB094BB1EA670F3E96214E0445BB6E7B@df-foxhound-msg.exchange.corp.microsoft.com> Ahh, excellent! I hadn't seen this mail yet when I wrote my other one, and this is exactly what I wanted to see (the call to str). The only fix I can see for this at this time is supporting 2 different constructors for str & unicode, one which will throw if the conversion fails, and one which won't. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of JoeSox Sent: Tuesday, July 04, 2006 10:53 AM To: Discussion of IronPython Subject: [IronPython] Id: 356 unicode throws when creating a Unicode string from an invalid Unicode string (was Re: Importing embedded .py files) On 7/4/06, Fuzzyman wrote: > Hmmm... well here is the source code for the Python array module. I'm > not sure it will help much though. > > http://svn.python.org/view/python/trunk/Modules/arraymodule.c?&view=ma > rkup Ah, it looks like this specific error is known http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkItemId=356 http://lists.ironpython.com/pipermail/users-ironpython.com/2006-May/002235.html I'm not sure how to workaround this one yet and it looks like I will be waiting for 1.0rc. Here is my stack if anyone is interested. [I have some comments next to some tracelines that explain what it should be doing]: Traceback (most recent call last): File , line 0, in ##70 File E:\CNUDB.py, line 24, in __init__ [self.nltools = CNUTools.ConceptNetNLTools(self)] File E:\CNUTools.py, line 13, in __init__ [self.m = CNUMontylingua.MontyLingua()] File E:\CNUMontylingua.py, line 15, in __init__ [self.theMontyLemmatiser = MontyLemmatiser.MontyLemmatiser()] File E:\CNUMontyTagger.py, line 15, in __init__ [self.theLexicon=CNUMontyLexiconFast.MontyLexiconFast()] File E:\CNUMontyLexiconFast.py, line 37, in __init__ [self.load_fastlexicon()] (found .MDF file "FASTLEXICON") File E:\CNUMontyLexiconFast.py, line 101, in load_fastlexicon [line1=self.array_fromfile(res_arr,self.word_start_arr,built_in_p,self.java_p,java_code='ws')] * res_arr = " * built_in_p = 260759 * line1 = None File CNUMontyLexiconFast, line unknown, in array_fromfile ? File E:\CNUMontyLexiconFast.py, line 254, in array_fromfile [array_ptr.fromfile(file_ptr,length)] file_ptr = " References: <44A991E8.40207@kaydash.za.net> Message-ID: <4039D552ADAB094BB1EA670F3E96214E0445BB6EAF@df-foxhound-msg.exchange.corp.microsoft.com> Thanks for the bug report, I've opened CodePlex bug 779 - this is similar to another issue we saw recently but I don't think we fixed the type case. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jonathan Jacobs Sent: Monday, July 03, 2006 2:54 PM To: Discussion of IronPython Subject: [IronPython] Odd behaviour from nested classes Hi, I just found some incredibly strange behaviour when using nested C# classes. Here's the repro: Test.cs: namespace Test { public class Aye { public class AyeBee { } } } hax/__init__.py: import clr clr.AddReferenceToFile('Test.dll') >>> import hax >>> import Test >>> Test.Aye >>> Test.Aye.AyeBee Traceback (most recent call last): File , line 0, in ##15 AttributeError: type object 'Aye' has no attribute 'AyeBee' >>> import clr >>> Test.Aye.AyeBee The trick here is hax/__init__.py, if I reference the assembly "manually" then the problem ceases to exist. I'm not sure whether this is a quirk of nested classes or the clr module itself. Regards -- Jonathan When you meet a master swordsman, show him your sword. When you meet a man who is not a poet, do not show him your poem. -- Rinzai, ninth century Zen master _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Wed Jul 5 19:03:01 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 5 Jul 2006 10:03:01 -0700 Subject: [IronPython] Array str/repr In-Reply-To: <5b0248170607030429n1ffd86e0u29235e98168d180f@mail.gmail.com> References: <5b0248170607030429n1ffd86e0u29235e98168d180f@mail.gmail.com> Message-ID: <4039D552ADAB094BB1EA670F3E96214E0445BB6EBF@df-foxhound-msg.exchange.corp.microsoft.com> Agreed! Thanks for the report, I've opened CodePlex bug 780 to track it. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Sanghyeon Seo Sent: Monday, July 03, 2006 4:29 AM To: Discussion of IronPython Subject: [IronPython] Array str/repr This can be very confusing. >>> from System import Array, Object >>> o = Array[Object]([0]) >>> str(o) 'System.Object[]' >>> repr(o) 'System.Object[](0)' 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 Wed Jul 5 19:04:48 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 5 Jul 2006 10:04:48 -0700 Subject: [IronPython] Issue Tracker Components In-Reply-To: <5b0248170607030338i71297df4of0c87a447a5c5a82@mail.gmail.com> References: <5b0248170607030338i71297df4of0c87a447a5c5a82@mail.gmail.com> Message-ID: <4039D552ADAB094BB1EA670F3E96214E0445BB6EC7@df-foxhound-msg.exchange.corp.microsoft.com> I've added Console as another available component. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Sanghyeon Seo Sent: Monday, July 03, 2006 3:38 AM To: Discussion of IronPython Subject: [IronPython] Issue Tracker Components Hi, Currently, IronPython's Issue Tracker has following Components: Code Generator, Compiler, Module, Runtime. I would like to have Console as another component. Does anyone have another suggestion? Seo Sanghyeon _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From simon.dahlbacka at gmail.com Wed Jul 5 21:01:39 2006 From: simon.dahlbacka at gmail.com (Simon Dahlbacka) Date: Wed, 5 Jul 2006 22:01:39 +0300 Subject: [IronPython] help / help() Message-ID: <57124720607051201k6053a5bdle2686ada33e8064b@mail.gmail.com> CPython 2.4.1: >>> help Type help() for interactive help, or help(object) for help about object. >>> help() Welcome to Python 2.4! This is the online help utility. If this is your first time using Python, you should definitely check out the tutorial on the Internet at http://www.python.org/doc/tut/. Enter the name of any module, keyword, or topic to get help on writing Python programs and using Python modules. To quit this help utility and return to the interpreter, just type "quit". To get a list of available modules, keywords, or topics, type "modules", "keywords", or "topics". Each module also comes with a one-line summary of what it does; to list the modules whose summaries contain a given word such as "spam", type "modules spam". help> IronPython beta8: >>> help >>> help() Traceback (most recent call last): File , line 0, in ##7 TypeError: help() takes exactly 1 argument (0 given) -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.dahlbacka at gmail.com Wed Jul 5 21:29:04 2006 From: simon.dahlbacka at gmail.com (Simon Dahlbacka) Date: Wed, 5 Jul 2006 22:29:04 +0300 Subject: [IronPython] __slots__ and __str__/__repr__ Message-ID: <57124720607051229h3e3e6044k39f1a9b7a05320a6@mail.gmail.com> CPython2.4.1 >>>class foo(object): ... __slots__ = ["bar"] ... >>>foo.bar >>> f = foo() >>> f.bar Traceback (most recent call last): File "", line 1, in ? AttributeError: bar Ironpython beta8 >>>class foo(object): ... __slots__ = ["bar"] >>>foo.bar >>> f = foo() >>> f.bar Traceback (most recent call last): File , line 0, in ##42 File , line 0, in get_bar##43 AttributeError: '' object has no attribute 'bar' -------------- next part -------------- An HTML attachment was scrubbed... URL: From Shri.Borde at microsoft.com Wed Jul 5 22:07:51 2006 From: Shri.Borde at microsoft.com (Shri Borde) Date: Wed, 5 Jul 2006 13:07:51 -0700 Subject: [IronPython] Constructor overloading In-Reply-To: <4039D552ADAB094BB1EA670F3E96214E0445BB6E6B@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <50B69702CA6E6D4E849D30CD4989AB8E1B6E5D5F15@DF-GRTDANE-MSG.exchange.corp.microsoft.com> I have opened http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkItemId=794 to track this. Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Wednesday, July 05, 2006 9:39 AM To: Discussion of IronPython Subject: Re: [IronPython] Constructor overloading To do typeof you can do: import clr clr.GetClrType(pythonType) and then you can do the GetConstructor call. There have been some recent fixes which change the way overloading constructors works - you'll want to overload __new__ and not __init__. There was some potential for confusion here in beta 8 and earlier. But the correct way to call it should be via new, so you should be able to do: Class MySubClass(MyDotNetBaseClass): def __new__(cls, arg): return MyDotNetBaseClass.__new__(cls, arg) and then to select overloads you should be able to do: class MySubClass(MyDotNetBaseClass): def __new__(cls, arg): return MyDotNetBaseClass.__overloads__[Stream](cls, arg) If that doesn't work for you w/ Beta 8 you might want to try downloading the latest bits and see if that fixes it for you. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Andrzej Krzywda Sent: Wednesday, July 05, 2006 7:20 AM To: Discussion of IronPython Subject: [IronPython] Constructor overloading Hello all, We are trying to create a .Net type object which has several one-parameter constructors. By default it does the wrong thing and we want to specify which constructor is called. We tried: Icon.__overloads__[Stream](myStream) Icon.__init__.__new__.__overloads__[Stream](myStream) but neither of these methods work. How can we do it? We also attempted to work around the issue by using Reflection on the Icon class: typeof(Icon).GetConstructor([Stream]).Invoke([myStream]) but we can't find the IronPython equivalent of typeof. Does it exist? -- Andrzej Krzywda _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Wed Jul 5 23:07:52 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 5 Jul 2006 14:07:52 -0700 Subject: [IronPython] help / help() In-Reply-To: <57124720607051201k6053a5bdle2686ada33e8064b@mail.gmail.com> References: <57124720607051201k6053a5bdle2686ada33e8064b@mail.gmail.com> Message-ID: <4039D552ADAB094BB1EA670F3E96214E0445BB7218@df-foxhound-msg.exchange.corp.microsoft.com> Thanks for the report, I've opened bug 797 to track it: http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkItemId=797 From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Simon Dahlbacka Sent: Wednesday, July 05, 2006 12:02 PM To: Discussion of IronPython Subject: [IronPython] help / help() CPython 2.4.1: >>> help Type help() for interactive help, or help(object) for help about object. >>> help() Welcome to Python 2.4! This is the online help utility. If this is your first time using Python, you should definitely check out the tutorial on the Internet at http://www.python.org/doc/tut/. Enter the name of any module, keyword, or topic to get help on writing Python programs and using Python modules. To quit this help utility and return to the interpreter, just type "quit". To get a list of available modules, keywords, or topics, type "modules", "keywords", or "topics". Each module also comes with a one-line summary of what it does; to list the modules whose summaries contain a given word such as "spam", type "modules spam". help> IronPython beta8: >>> help >>> help() Traceback (most recent call last): File , line 0, in ##7 TypeError: help() takes exactly 1 argument (0 given) -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Wed Jul 5 23:08:42 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 5 Jul 2006 14:08:42 -0700 Subject: [IronPython] help / help() References: <57124720607051201k6053a5bdle2686ada33e8064b@mail.gmail.com> Message-ID: <4039D552ADAB094BB1EA670F3E96214E0445BB721B@df-foxhound-msg.exchange.corp.microsoft.com> Errr, that's bug 796 for this one actually... http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkItemId=796 From: Dino Viehland Sent: Wednesday, July 05, 2006 2:08 PM To: Discussion of IronPython Subject: RE: [IronPython] help / help() Thanks for the report, I've opened bug 797 to track it: http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkItemId=797 From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Simon Dahlbacka Sent: Wednesday, July 05, 2006 12:02 PM To: Discussion of IronPython Subject: [IronPython] help / help() CPython 2.4.1: >>> help Type help() for interactive help, or help(object) for help about object. >>> help() Welcome to Python 2.4! This is the online help utility. If this is your first time using Python, you should definitely check out the tutorial on the Internet at http://www.python.org/doc/tut/. Enter the name of any module, keyword, or topic to get help on writing Python programs and using Python modules. To quit this help utility and return to the interpreter, just type "quit". To get a list of available modules, keywords, or topics, type "modules", "keywords", or "topics". Each module also comes with a one-line summary of what it does; to list the modules whose summaries contain a given word such as "spam", type "modules spam". help> IronPython beta8: >>> help >>> help() Traceback (most recent call last): File , line 0, in ##7 TypeError: help() takes exactly 1 argument (0 given) -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Wed Jul 5 23:09:38 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 5 Jul 2006 14:09:38 -0700 Subject: [IronPython] __slots__ and __str__/__repr__ In-Reply-To: <57124720607051229h3e3e6044k39f1a9b7a05320a6@mail.gmail.com> References: <57124720607051229h3e3e6044k39f1a9b7a05320a6@mail.gmail.com> Message-ID: <4039D552ADAB094BB1EA670F3E96214E0445BB7221@df-foxhound-msg.exchange.corp.microsoft.com> Thanks again for the bug report. I've opened bug 797 to track this one http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkItemId=797 Is this currently blocking you? The reason I ask is we're only differing by a couple of things (the property name being the obviously most egregious one) and it'd be nice to have an idea how we should prioritize this. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Simon Dahlbacka Sent: Wednesday, July 05, 2006 12:29 PM To: Discussion of IronPython Subject: [IronPython] __slots__ and __str__/__repr__ CPython2.4.1 >>>class foo(object): ... __slots__ = ["bar"] ... >>>foo.bar >>> f = foo() >>> f.bar Traceback (most recent call last): File "", line 1, in ? AttributeError: bar Ironpython beta8 >>>class foo(object): ... __slots__ = ["bar"] >>>foo.bar >>> f = foo() >>> f.bar Traceback (most recent call last): File , line 0, in ##42 File , line 0, in get_bar##43 AttributeError: '' object has no attribute 'bar' -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.dahlbacka at gmail.com Wed Jul 5 23:12:35 2006 From: simon.dahlbacka at gmail.com (Simon Dahlbacka) Date: Thu, 6 Jul 2006 00:12:35 +0300 Subject: [IronPython] __slots__ and __str__/__repr__ In-Reply-To: <4039D552ADAB094BB1EA670F3E96214E0445BB7221@df-foxhound-msg.exchange.corp.microsoft.com> References: <57124720607051229h3e3e6044k39f1a9b7a05320a6@mail.gmail.com> <4039D552ADAB094BB1EA670F3E96214E0445BB7221@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <57124720607051412j38160cebhf9225bfe4274deff@mail.gmail.com> no, not at all, I just played around at the console trying to find bugs.. :) That said, it probably would suck pretty badly if I was using doctest or something similar.. /S On 7/6/06, Dino Viehland wrote: > > Thanks again for the bug report. I've opened bug 797 to track this one > > > > > http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkItemId=797 > > > > Is this currently blocking you? The reason I ask is we're only differing > by a couple of things (the property name being the obviously most egregious > one) and it'd be nice to have an idea how we should prioritize this. > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Simon Dahlbacka > *Sent:* Wednesday, July 05, 2006 12:29 PM > *To:* Discussion of IronPython > *Subject:* [IronPython] __slots__ and __str__/__repr__ > > > > CPython2.4.1 > >>>class foo(object): > ... __slots__ = ["bar"] > ... > >>>foo.bar > > >>> f = foo() > >>> f.bar > Traceback (most recent call last): > File "", line 1, in ? > AttributeError: bar > > > > > Ironpython beta8 > >>>class foo(object): > ... __slots__ = ["bar"] > >>>foo.bar > > >>> f = foo() > >>> f.bar > Traceback (most recent call last): > File , line 0, in ##42 > File , line 0, in get_bar##43 > AttributeError: '' object has no attribute 'bar' > > _______________________________________________ > 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 Jonathan.Hogg at kbcaim.com Tue Jul 4 11:55:09 2006 From: Jonathan.Hogg at kbcaim.com (Hogg, Jonathan) Date: Tue, 4 Jul 2006 10:55:09 +0100 Subject: [IronPython] Beta 8 and passing None for nullable arguments Message-ID: <716052183E837C44BCAAFEBABBD8A3EF015D568D@london.kbcfp.com> Hi there, With beta 7 I was able to call a (non-Python) method that expected Nullable arguments with either an object of type T or None. As of beta 8 I get an ArgumentType exception using None (expected Nullable, got NoneType). Is this a bug? And does anyone know a workaround? Jonathan ----- This message may contain confidential, proprietary, or legally privileged information. No confidentiality or privilege is waived by any transmission to an unintended recipient. If you are not an intended recipient, please notify the sender and delete this message immediately. Any views expressed in this message are those of the sender, not those of KBC Alternative Investment Management, or any affiliate thereof. This message does not create any obligation, contractual or otherwise, on the part of any such entity. It is not an offer (or solicitation of an offer) of, or a recommendation to buy or sell, any financial product. Any prices or other values included in this message are indicative only, and do not necessarily represent current market prices, the prices at which any KBC entity would enter into a transaction or the prices at which similar transactions may be carried on that entity's own books. The information contained in this message is provided "as is", without representations or warranties, express or implied, of any kind. Past performance is not indicative of future returns. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Wed Jul 5 23:18:31 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 5 Jul 2006 14:18:31 -0700 Subject: [IronPython] __slots__ and __str__/__repr__ In-Reply-To: <57124720607051412j38160cebhf9225bfe4274deff@mail.gmail.com> References: <57124720607051229h3e3e6044k39f1a9b7a05320a6@mail.gmail.com> <4039D552ADAB094BB1EA670F3E96214E0445BB7221@df-foxhound-msg.exchange.corp.microsoft.com> <57124720607051412j38160cebhf9225bfe4274deff@mail.gmail.com> Message-ID: <4039D552ADAB094BB1EA670F3E96214E0445BB723C@df-foxhound-msg.exchange.corp.microsoft.com> Cool, keep them coming J We may not get to them all before 1.0 final, but it's always good to know where we're broken and what we need to improve on. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Simon Dahlbacka Sent: Wednesday, July 05, 2006 2:13 PM To: Discussion of IronPython Subject: Re: [IronPython] __slots__ and __str__/__repr__ no, not at all, I just played around at the console trying to find bugs.. :) That said, it probably would suck pretty badly if I was using doctest or something similar.. /S On 7/6/06, Dino Viehland > wrote: Thanks again for the bug report. I've opened bug 797 to track this one http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkItemId=797 Is this currently blocking you? The reason I ask is we're only differing by a couple of things (the property name being the obviously most egregious one) and it'd be nice to have an idea how we should prioritize this. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Simon Dahlbacka Sent: Wednesday, July 05, 2006 12:29 PM To: Discussion of IronPython Subject: [IronPython] __slots__ and __str__/__repr__ CPython2.4.1 >>>class foo(object): ... __slots__ = ["bar"] ... >>>foo.bar >>> f = foo() >>> f.bar Traceback (most recent call last): File "", line 1, in ? AttributeError: bar Ironpython beta8 >>>class foo(object): ... __slots__ = ["bar"] >>>foo.bar >>> f = foo() >>> f.bar Traceback (most recent call last): File , line 0, in ##42 File , line 0, in get_bar##43 AttributeError: '' object has no attribute 'bar' _______________________________________________ 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 Martin.Maly at microsoft.com Wed Jul 5 23:28:48 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Wed, 5 Jul 2006 14:28:48 -0700 Subject: [IronPython] Beta 8 and passing None for nullable arguments In-Reply-To: <716052183E837C44BCAAFEBABBD8A3EF015D568D@london.kbcfp.com> Message-ID: This is actually something that we just fixed today. It will be available in the next release, or prior to that, in the form of source code on CodePlex. Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Hogg, Jonathan Sent: Tuesday, July 04, 2006 2:55 AM To: users at lists.ironpython.com Subject: [IronPython] Beta 8 and passing None for nullable arguments Hi there, With beta 7 I was able to call a (non-Python) method that expected Nullable arguments with either an object of type T or None. As of beta 8 I get an ArgumentType exception using None (expected Nullable, got NoneType). Is this a bug? And does anyone know a workaround? Jonathan ________________________________ This message may contain confidential, proprietary, or legally privileged information. No confidentiality or privilege is waived by any transmission to an unintended recipient. If you are not an intended recipient, please notify the sender and delete this message immediately. Any views expressed in this message are those of the sender, not those of KBC Alternative Investment Management, or any affiliate thereof. This message does not create any obligation, contractual or otherwise, on the part of any such entity. It is not an offer (or solicitation of an offer) of, or a recommendation to buy or sell, any financial product. Any prices or other values included in this message are indicative only, and do not necessarily represent current market prices, the prices at which any KBC entity would enter into a transaction or the prices at which similar transactions may be carried on that entity's own books. The information contained in this message is provided "as is", without representations or warranties, express or implied, of any kind. Past performance is not indicative of future returns. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ernsnat at iit.edu Thu Jul 6 00:48:42 2006 From: ernsnat at iit.edu (Nathan R. Ernst) Date: Wed, 5 Jul 2006 17:48:42 -0500 Subject: [IronPython] Importing embedded .py files In-Reply-To: <4039D552ADAB094BB1EA670F3E96214E0445BB6E53@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <20060705224640.2FAC91BB71@che.dreamhost.com> PEP-302 definitely sounds like what I had in mind (but wasn't quite so eloquently able to put into writing). Dino, et. al., please correct me if I'm wrong, but a PEP-302 based solution to the original problem would involve the installation of an object into sys.path_hooks that would return an importer item capable of loading the specified module from a resource? Reading through the PEP sparked another random thought: Might it be of use to IronPython developers to have .Net consumable interfaces defined for some of the more common Python protocols? While I admit this would likely be of little functional value, it could lend a good deal of declarative value, especially when implementing objects in .Net that intended to be consumed directly by IronPython. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Wednesday, July 05, 2006 11:29 AM To: Discussion of IronPython Subject: Re: [IronPython] Importing embedded .py files I've opened a bug on CodePlex (bug 775 http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkItemId =775) to implement PEP-302 which seems to be the new version of ihooks (it says no one was satisfied w/ ihooks). I've opened it as a post-1.0 bug. From dinov at exchange.microsoft.com Thu Jul 6 01:02:48 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 5 Jul 2006 16:02:48 -0700 Subject: [IronPython] Importing embedded .py files In-Reply-To: <20060705224640.2FAC91BB71@che.dreamhost.com> References: <4039D552ADAB094BB1EA670F3E96214E0445BB6E53@df-foxhound-msg.exchange.corp.microsoft.com> <20060705224640.2FAC91BB71@che.dreamhost.com> Message-ID: <4039D552ADAB094BB1EA670F3E96214E0445BB73A4@df-foxhound-msg.exchange.corp.microsoft.com> I think you're correct on your understanding of PEP-302, but I only looked at it this morning for the first time :) Regarding the interfaces, we actually do a lot of this as we use interfaces internally - both for just providing reasonable functionality as well as providing fast paths rather than doing dictionary lookups. If you look at IronPython\Runtime\Interfaces.cs you'll see that we define a bunch of interfaces, the most interesting probably being: IDynamicObject (implements the result of type(xyz)) ISuperDynamicObject (implements xyz.__class__ = 'abc', as well as dictionary access) ICustomAttributes (think override __getattribute__, but w/ setters & getting the dictionary and more) ICodeFormattable (__repr__) IDescriptor (descriptor protocol, __get__) IDataDescriptor (descriptor protocol, __set__, __delete__) IPythonContainer (__len__, __contains__) ISequence (__add__, __mul__, indexing, and __getslice__) IMutableSequence (__delitem__, __setslice__, __delslice__, and writable indexing) IMapping (get, indexing, __delitem__) IRichComparable (__gt__, __lt__, __le__, __ge__, __eq__, __ne__) IRichEquality (IRichComparable but w/o > and <) IWeakReferencable (__weakref__) These are all public APIs currently. They're not exposed via our IronPython.Hosting namespace which is what we think of the core public API surface so there's a chance we could break you in future versions, but most of these are pretty well baked at this point that we don't expect them to change. Unfortunately I don't think we have much more guidance on using these then that & the documentation in the file. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Nathan R. Ernst Sent: Wednesday, July 05, 2006 3:49 PM To: 'Discussion of IronPython' Subject: Re: [IronPython] Importing embedded .py files PEP-302 definitely sounds like what I had in mind (but wasn't quite so eloquently able to put into writing). Dino, et. al., please correct me if I'm wrong, but a PEP-302 based solution to the original problem would involve the installation of an object into sys.path_hooks that would return an importer item capable of loading the specified module from a resource? Reading through the PEP sparked another random thought: Might it be of use to IronPython developers to have .Net consumable interfaces defined for some of the more common Python protocols? While I admit this would likely be of little functional value, it could lend a good deal of declarative value, especially when implementing objects in .Net that intended to be consumed directly by IronPython. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Wednesday, July 05, 2006 11:29 AM To: Discussion of IronPython Subject: Re: [IronPython] Importing embedded .py files I've opened a bug on CodePlex (bug 775 http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkItemId =775) to implement PEP-302 which seems to be the new version of ihooks (it says no one was satisfied w/ ihooks). I've opened it as a post-1.0 bug. _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From ernsnat at iit.edu Thu Jul 6 01:18:06 2006 From: ernsnat at iit.edu (Nathan R. Ernst) Date: Wed, 5 Jul 2006 18:18:06 -0500 Subject: [IronPython] Importing embedded .py files In-Reply-To: <4039D552ADAB094BB1EA670F3E96214E0445BB73A4@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <20060705231544.3C0071BB66@che.dreamhost.com> Boy, if I read the IronPython source half as much as I read the mailing list, I'd probably be able most of my own questions, and 'wouldn't it be nice ifs...'. :) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Wednesday, July 05, 2006 6:03 PM To: Discussion of IronPython Subject: Re: [IronPython] Importing embedded .py files I think you're correct on your understanding of PEP-302, but I only looked at it this morning for the first time :) Regarding the interfaces, we actually do a lot of this as we use interfaces internally - both for just providing reasonable functionality as well as providing fast paths rather than doing dictionary lookups. If you look at IronPython\Runtime\Interfaces.cs you'll see that we define a bunch of interfaces, the most interesting probably being: IDynamicObject (implements the result of type(xyz)) ISuperDynamicObject (implements xyz.__class__ = 'abc', as well as dictionary access) ICustomAttributes (think override __getattribute__, but w/ setters & getting the dictionary and more) ICodeFormattable (__repr__) IDescriptor (descriptor protocol, __get__) IDataDescriptor (descriptor protocol, __set__, __delete__) IPythonContainer (__len__, __contains__) ISequence (__add__, __mul__, indexing, and __getslice__) IMutableSequence (__delitem__, __setslice__, __delslice__, and writable indexing) IMapping (get, indexing, __delitem__) IRichComparable (__gt__, __lt__, __le__, __ge__, __eq__, __ne__) IRichEquality (IRichComparable but w/o > and <) IWeakReferencable (__weakref__) These are all public APIs currently. They're not exposed via our IronPython.Hosting namespace which is what we think of the core public API surface so there's a chance we could break you in future versions, but most of these are pretty well baked at this point that we don't expect them to change. Unfortunately I don't think we have much more guidance on using these then that & the documentation in the file. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Nathan R. Ernst Sent: Wednesday, July 05, 2006 3:49 PM To: 'Discussion of IronPython' Subject: Re: [IronPython] Importing embedded .py files PEP-302 definitely sounds like what I had in mind (but wasn't quite so eloquently able to put into writing). Dino, et. al., please correct me if I'm wrong, but a PEP-302 based solution to the original problem would involve the installation of an object into sys.path_hooks that would return an importer item capable of loading the specified module from a resource? Reading through the PEP sparked another random thought: Might it be of use to IronPython developers to have .Net consumable interfaces defined for some of the more common Python protocols? While I admit this would likely be of little functional value, it could lend a good deal of declarative value, especially when implementing objects in .Net that intended to be consumed directly by IronPython. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Wednesday, July 05, 2006 11:29 AM To: Discussion of IronPython Subject: Re: [IronPython] Importing embedded .py files I've opened a bug on CodePlex (bug 775 http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkItemId =775) to implement PEP-302 which seems to be the new version of ihooks (it says no one was satisfied w/ ihooks). I've opened it as a post-1.0 bug. _______________________________________________ users mailing list users at lists.ironpython.com http://lists.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 KBjorke at nvidia.com Thu Jul 6 01:45:07 2006 From: KBjorke at nvidia.com (Kevin Bjorke) Date: Wed, 5 Jul 2006 16:45:07 -0700 Subject: [IronPython] Quick questions about connecting to other CLR languages In-Reply-To: <20060705231544.3C0071BB66@che.dreamhost.com> Message-ID: <590FCAE72E27D54CA1EADE7293BB444F04422B0A@hqemmail04.nvidia.com> I'm writing in IP and trying to connect to code written in C# by other people if they have a function wanting a typeof(something) argument, how can I pass that from IP? if they have a templated function blah() how will that appear in IP? as multiple functions, or...? thanks KB ----------------------------------------------------------------------------------- This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. ----------------------------------------------------------------------------------- From dinov at exchange.microsoft.com Thu Jul 6 01:56:05 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 5 Jul 2006 16:56:05 -0700 Subject: [IronPython] Quick questions about connecting to other CLR languages In-Reply-To: <590FCAE72E27D54CA1EADE7293BB444F04422B0A@hqemmail04.nvidia.com> References: <20060705231544.3C0071BB66@che.dreamhost.com> <590FCAE72E27D54CA1EADE7293BB444F04422B0A@hqemmail04.nvidia.com> Message-ID: <4039D552ADAB094BB1EA670F3E96214E04464FD5A1@df-foxhound-msg.exchange.corp.microsoft.com> You can pass a type object from Python directly to the function, and we'll convert it into the CLR type along the way. Alternately you can import clr and then do clr.GetClrType(somePythonType). For example you should be able to pass str, int, bool, etc... through and have it just work. Generic functions are accessed from IronPython using indexers ([]) to specify the type. So you can do: foo.blah[int](3, 4) or foo.blah[str]("3","5") and you can access generic types the same way. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Kevin Bjorke Sent: Wednesday, July 05, 2006 4:45 PM To: Discussion of IronPython Subject: [IronPython] Quick questions about connecting to other CLR languages I'm writing in IP and trying to connect to code written in C# by other people if they have a function wanting a typeof(something) argument, how can I pass that from IP? if they have a templated function blah() how will that appear in IP? as multiple functions, or...? thanks KB ----------------------------------------------------------------------------------- This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. ----------------------------------------------------------------------------------- _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From joesox at gmail.com Thu Jul 6 09:01:08 2006 From: joesox at gmail.com (JoeSox) Date: Thu, 6 Jul 2006 00:01:08 -0700 Subject: [IronPython] Id: 356 unicode throws when creating a Unicode string from an invalid Unicode string (was Re: Importing embedded .py files) In-Reply-To: <4039D552ADAB094BB1EA670F3E96214E0445BB6E7B@df-foxhound-msg.exchange.corp.microsoft.com> References: <785694cd0607041052p61c9a794jd91b59ebde7457fe@mail.gmail.com> <4039D552ADAB094BB1EA670F3E96214E0445BB6E7B@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <785694cd0607060001k18e9e70lb3752b47685aa33f@mail.gmail.com> On 7/5/06, Dino Viehland wrote: > Ahh, excellent! I hadn't seen this mail yet when I wrote my other one, and this is exactly what I wanted to see (the call to str). > Yes, I hoped so. the line before the call to str was.... 221: if isinstance(s, unicode): 222: s = str(s) It looks like I will have to download the VS 2005 June 2006 CTP to see if I can step thru this code any better because I am having trouble understanding what is the exact string value of s at the time of execution. But this confusion may also be caused by my recent pain medication for a kidney stone that is getting surgically removed in the morning. > The only fix I can see for this at this time is supporting 2 different constructors for str & unicode, one which will throw if the conversion fails, and one which won't. > Out of curiousity, would those future conversion evaluations be using IronPython.Runtime.Converter? I was looking at that to see how that worked and I tried the below code and I don't think it converted it correctly (conv=None) but I could be doing something wrong. Conversion conv = new Conversion(); string replacement = Converter.TryConvertToString(655, out conv); string replacement2 = Converter.TryConvertToString(Convert.ToUInt64("3"), out conv); -- Later, Joe From sanxiyn at gmail.com Thu Jul 6 09:23:38 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Thu, 6 Jul 2006 16:23:38 +0900 Subject: [IronPython] Id: 356 unicode throws when creating a Unicode string from an invalid Unicode string (was Re: Importing embedded .py files) In-Reply-To: <785694cd0607060001k18e9e70lb3752b47685aa33f@mail.gmail.com> References: <785694cd0607041052p61c9a794jd91b59ebde7457fe@mail.gmail.com> <4039D552ADAB094BB1EA670F3E96214E0445BB6E7B@df-foxhound-msg.exchange.corp.microsoft.com> <785694cd0607060001k18e9e70lb3752b47685aa33f@mail.gmail.com> Message-ID: <5b0248170607060023q3371473g65673342a67c2c99@mail.gmail.com> 2006/7/6, JoeSox : > 221: if isinstance(s, unicode): > 222: s = str(s) Eh, some Python codes assume "isinstance(s, str)" and "isinstance(s, unicode)" can't be both true. IMO this should be discouraged. For example, one serialization library registers serialization handlers for str and unicode, and raises(!) if a handler is registered twice for the same type. Of course this won't work in IronPython. The assumption also doesn't hold in Jython. str and unicode are functions, not types in Python 2.1, which Jython implements. To test, try type('') == type(u''). Seo Sanghyeon From sanxiyn at gmail.com Thu Jul 6 12:30:04 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Thu, 6 Jul 2006 19:30:04 +0900 Subject: [IronPython] Makefile nitpick Message-ID: <5b0248170607060330o3c6a08ect2a6f5b0d366f0ede@mail.gmail.com> $(CSC) -t:exe -r:../IronPython.dll -t:winexe -define:IRONPYTHON_WINDOW -out:../ipyw.exe -recurse:IronPythonConsole/*.cs has two -t options. Better: $(CSC) -t:winexe -r:../IronPython.dll -define:IRONPYTHON_WINDOW -out:../ipyw.exe -recurse:IronPythonConsole/*.cs Seo Sanghyeon From Martin.Maly at microsoft.com Thu Jul 6 17:27:31 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Thu, 6 Jul 2006 08:27:31 -0700 Subject: [IronPython] Makefile nitpick In-Reply-To: <5b0248170607060330o3c6a08ect2a6f5b0d366f0ede@mail.gmail.com> Message-ID: Great, thanks! will fix! Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Sanghyeon Seo Sent: Thursday, July 06, 2006 3:30 AM To: Discussion of IronPython Subject: [IronPython] Makefile nitpick $(CSC) -t:exe -r:../IronPython.dll -t:winexe -define:IRONPYTHON_WINDOW -out:../ipyw.exe -recurse:IronPythonConsole/*.cs has two -t options. Better: $(CSC) -t:winexe -r:../IronPython.dll -define:IRONPYTHON_WINDOW -out:../ipyw.exe -recurse:IronPythonConsole/*.cs 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 Thu Jul 6 17:52:24 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Thu, 6 Jul 2006 08:52:24 -0700 Subject: [IronPython] Id: 356 unicode throws when creating a Unicode string from an invalid Unicode string (was Re: Importing embedded .py files) In-Reply-To: <785694cd0607060001k18e9e70lb3752b47685aa33f@mail.gmail.com> References: <785694cd0607041052p61c9a794jd91b59ebde7457fe@mail.gmail.com> <4039D552ADAB094BB1EA670F3E96214E0445BB6E7B@df-foxhound-msg.exchange.corp.microsoft.com>, <785694cd0607060001k18e9e70lb3752b47685aa33f@mail.gmail.com> Message-ID: <7AD436E4270DD54A94238001769C22271F1233D86F@DF-GRTDANE-MSG.exchange.corp.microsoft.com> They'd actually use StringOps.Decode (we get there via StringOps.Make)- currently this sees if we have any characters outside of the ASCII range and if so does a decode - and that's what's blowing up. Another interesting data point is that we could also change the way isinstance works. All this is a little scary though - I think it'll be hard to get something that works consistently and seems to make sense, but it's worth trying to investigate and see if we can come up with something that works closer to CPython then what we have now (though we'll probably never be perfect here). ________________________________________ From: users-bounces at lists.ironpython.com On Behalf Of JoeSox Sent: Thursday, July 06, 2006 12:01 AM To: Discussion of IronPython Subject: Re: [IronPython] Id: 356 unicode throws when creating a Unicode string from an invalid Unicode string (was Re: Importing embedded .py files) On 7/5/06, Dino Viehland wrote: > Ahh, excellent! I hadn't seen this mail yet when I wrote my other one, and this is exactly what I wanted to see (the call to str). > Yes, I hoped so. the line before the call to str was.... 221: if isinstance(s, unicode): 222: s = str(s) It looks like I will have to download the VS 2005 June 2006 CTP to see if I can step thru this code any better because I am having trouble understanding what is the exact string value of s at the time of execution. But this confusion may also be caused by my recent pain medication for a kidney stone that is getting surgically removed in the morning. > The only fix I can see for this at this time is supporting 2 different constructors for str & unicode, one which will throw if the conversion fails, and one which won't. > Out of curiousity, would those future conversion evaluations be using IronPython.Runtime.Converter? I was looking at that to see how that worked and I tried the below code and I don't think it converted it correctly (conv=None) but I could be doing something wrong. Conversion conv = new Conversion(); string replacement = Converter.TryConvertToString(655, out conv); string replacement2 = Converter.TryConvertToString(Convert.ToUInt64("3"), out conv); -- Later, Joe _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From jsacksteder at gmail.com Thu Jul 6 18:42:42 2006 From: jsacksteder at gmail.com (jeff sacksteder) Date: Thu, 6 Jul 2006 12:42:42 -0400 Subject: [IronPython] modal dialog example Message-ID: <51c8a7be0607060942n29aa3152ra54c49ee8223b928@mail.gmail.com> I'm have trouble mentally translating the Vb and C# examples I found online. Could someone finish this trivial example of calling a modal dialog and returning the choice that was selected? import clr clr.AddReference('System.Windows.Forms') from System.Windows import Forms class MyMainForm(Forms.Form): def __init__(self): self.Text = 'Main Form' my_button = Forms.Button(Text='Choose one!') class MyDialog(Forms.Form): def __init_(self): self.Text ='Dialog' egg_button = Forms.Button(Text='Eggs') spam_button = Forms.Button(Text='Spam') app = MyMainForm() Forms.Application.Run(app) -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Maly at microsoft.com Thu Jul 6 19:03:05 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Thu, 6 Jul 2006 10:03:05 -0700 Subject: [IronPython] modal dialog example In-Reply-To: <51c8a7be0607060942n29aa3152ra54c49ee8223b928@mail.gmail.com> Message-ID: import clr clr.AddReference ('System.Windows.Forms') from System.Windows import Forms class MyDialog(Forms.Form): def __init__(self): self.Text ='Dialog' egg_button = Forms.Button(Text='Eggs', Visible=True) egg_button.Click += self.OnEgg spam_button = Forms.Button(Text='Spam', Visible=True, Left = 50) spam_button.Click += self.OnSpam print self.Controls.Add(egg_button) print self.Controls.Add(spam_button) def OnEgg(self, *args): self.result = "Eggs" self.DialogResult = Forms.DialogResult.OK self.Close() def OnSpam(self, *args): self.result = "Spam" self.DialogResult = Forms.DialogResult.OK self.Close() class MyMainForm(Forms.Form): def __init__(self): self.Text = 'Main Form' my_button = Forms.Button(Text='Choose one!') my_button.Click += self.OnClick self.Controls.Add(my_button) def OnClick(self, *args): md = MyDialog() if md.ShowDialog() == Forms.DialogResult.OK: print md.result app = MyMainForm() Forms.Application.Run(app) ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of jeff sacksteder Sent: Thursday, July 06, 2006 9:43 AM To: Discussion of IronPython Subject: [IronPython] modal dialog example I'm have trouble mentally translating the Vb and C# examples I found online. Could someone finish this trivial example of calling a modal dialog and returning the choice that was selected? import clr clr.AddReference ('System.Windows.Forms') from System.Windows import Forms class MyMainForm(Forms.Form): def __init__(self): self.Text = 'Main Form' my_button = Forms.Button(Text='Choose one!') class MyDialog(Forms.Form): def __init_(self): self.Text ='Dialog' egg_button = Forms.Button(Text='Eggs') spam_button = Forms.Button(Text='Spam') app = MyMainForm() Forms.Application.Run(app) -------------- next part -------------- An HTML attachment was scrubbed... URL: From glc at well.com Thu Jul 6 23:33:55 2006 From: glc at well.com (Greg Chapman) Date: Thu, 6 Jul 2006 14:33:55 -0700 Subject: [IronPython] str.rfind can raise index errors Message-ID: <001901c6a143$e290a990$08fea8c0@GLC07> Compare: Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> s = 'x' >>> s.rfind('x', 0, 0) -1 IronPython 1.0.60619 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> s = 'x' >>> s.rfind('x', 0, 0) Traceback (most recent call last): File , line 0, in ##57 File , line 0, in RFind##60 File mscorlib, line unknown, in LastIndexOf File mscorlib, line unknown, in LastIndexOf ValueError: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: startIndex It looks like str.rfind needs to avoid calling String.LastIndexOf for empty subranges of the string. From haiboluo at exchange.microsoft.com Fri Jul 7 00:05:38 2006 From: haiboluo at exchange.microsoft.com (Haibo Luo) Date: Thu, 6 Jul 2006 15:05:38 -0700 Subject: [IronPython] str.rfind can raise index errors In-Reply-To: <001901c6a143$e290a990$08fea8c0@GLC07> Message-ID: Thanks for the bug report. I opened one work item in codeplex: http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkItemId=811 -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Greg Chapman Sent: Thursday, July 06, 2006 2:34 PM To: users at lists.ironpython.com Subject: [IronPython] str.rfind can raise index errors Compare: Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> s = 'x' >>> s.rfind('x', 0, 0) -1 IronPython 1.0.60619 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> s = 'x' >>> s.rfind('x', 0, 0) Traceback (most recent call last): File , line 0, in ##57 File , line 0, in RFind##60 File mscorlib, line unknown, in LastIndexOf File mscorlib, line unknown, in LastIndexOf ValueError: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: startIndex It looks like str.rfind needs to avoid calling String.LastIndexOf for empty subranges of the string. _______________________________________________ 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 11 01:38:48 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 10 Jul 2006 16:38:48 -0700 Subject: [IronPython] The Path to 1.0 Message-ID: <7AD436E4270DD54A94238001769C2227231D63D0CD@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Hello IronPython community, As we drive towards our 1.0 release we've decided to have one more beta release before RC1 - leaving us in the single digits at 9 betas. This extra release will ensure we deliver a high quality 1.0 that fixes all of the top-issues that remain in IronPython. Currently we're planning to release the final beta later this week with the RC coming 2-3 weeks after beta 9. We've been actively triaging the remaining work items for IronPython 1.0 and have set the Planned for Release field appropriately on the CodePlex issue tracker (http://www.codeplex.com/WorkItem/List.aspx?ProjectName=IronPython). Currently we are working from high priority work items (all of which will be fixed for 1.0 final) and working down from there to the medium and low priority work items. If there is an issue reported on CodePlex that is blocking you and it's set to either 1.01 Alpha or has a priority lower than High then there is a chance this issue will not be fixed for 1.0 final. Our goal for 1.0 is to release a high quality release that accurately represents the Python language semantics and provides a solid support for building applications based on .NET. If you see issues or have comments please let us know. Additionally as new bugs come in we will triage those and attempt to set the release and priority appropriately. If you could let us know the importance to you of a reported bug it could assist us in making the right call to get a high quality IronPython 1.0. As always thank you for your feedback! From sanxiyn at gmail.com Tue Jul 11 08:28:27 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Tue, 11 Jul 2006 15:28:27 +0900 Subject: [IronPython] type.__call__ Message-ID: <5b0248170607102328u66594bc9sd799ab7995cf6b3c@mail.gmail.com> Okay, I admit I have never imagined Python code like this. # test.py class MetaClass(type): def __call__(self, *args): print args class Class(object): __metaclass__ = MetaClass Class(1, 2, 3) Found while trying to run SQLAlchemy (http://sqlalchemy.org/), a Python ORM library. * * * There also seems to be a strange import bug, but I couldn't reduce it. How to reproduce: import sqlalchemy Workaround. Swapping following two lines seem to "fix" this with no ill effect: from sqlalchemy import util import util as mapperutil To: import util as mapperutil from sqlalchemy import util Seo Sanghyeon From sanxiyn at gmail.com Tue Jul 11 11:46:23 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Tue, 11 Jul 2006 18:46:23 +0900 Subject: [IronPython] NPE inside IronPython.Compiler Message-ID: <5b0248170607110246r2ddf8641i273c5999f82e22b@mail.gmail.com> Following code, reduced from MoinMoin.util.lock, causes NPE inside IronPython.Compiler. MoinMoin (http://moinmoin.wikiwikiweb.de/) is a popular wiki engine written in Python. # lock.py class WriteLock: def acquire(self): try: result = self.lock.acquire() finally: if result: return result else: self.lock.release() Seo Sanghyeon From Brian.Rowe at bwater.com Tue Jul 11 15:04:30 2006 From: Brian.Rowe at bwater.com (Brian Rowe) Date: Tue, 11 Jul 2006 09:04:30 -0400 Subject: [IronPython] Modules available for IronPython? Message-ID: <51443EA36EAFAB418F91F4B902CC8AA417D724@MAILA.internal.bwater.com> What standard Python modules are available in IronPython? Is there a process for adding missing libraries to the base distribution or is it left as a user exercise to add them from the standard Python distribution? ===== Brian Rowe Bridgewater Associates 203 291 2849 ---------------------------------------- This message is intended exclusively for the individual(s) or entity to which it is addressed. It may contain information that is proprietary, privileged or confidential or otherwise legally exempt from disclosure. If you are not the named addressee, you are not authorized to read, print, retain, copy or disseminate this message or any part of it. If you have received this message in error, please notify the sender immediately by e-mail and delete all copies of the message. From fuzzyman at voidspace.org.uk Tue Jul 11 16:30:35 2006 From: fuzzyman at voidspace.org.uk (Fuzzyman) Date: Tue, 11 Jul 2006 15:30:35 +0100 Subject: [IronPython] Modules available for IronPython? In-Reply-To: <51443EA36EAFAB418F91F4B902CC8AA417D724@MAILA.internal.bwater.com> References: <51443EA36EAFAB418F91F4B902CC8AA417D724@MAILA.internal.bwater.com> Message-ID: <44B3B60B.6090206@voidspace.org.uk> Brian Rowe wrote: >What standard Python modules are available in IronPython? Is there a process for adding missing libraries to the base distribution or is it left as a user exercise to add them from the standard Python distribution? > > If you add the Python standard library to your sys.path, you will find that the vast majority of it works. If you find modules (or parts of modules) that don't work, and aren't recorded on the codeplex bug tracker, then report them here and they will be scheduled to be fixed 'some time'. I *think* that is a basically correct summation of the situation. Some parts of the standard library are implemented in C and *may* never work with IronPython, although Seo has (had ?) something in progress that may resolve that. All the best, Fuzzyman http://www.voidspace.org.uk/python/index.shtml > ===== >Brian Rowe >Bridgewater Associates >203 291 2849 > > > >---------------------------------------- > >This message is intended exclusively for the individual(s) or entity to which it is addressed. It may contain information that is proprietary, privileged or confidential or otherwise legally exempt from disclosure. If you are not the named addressee, you are not authorized to read, print, retain, copy or disseminate this message or any part of it. If you have received this message in error, please notify the sender immediately by e-mail and delete all copies of the message. > >_______________________________________________ >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 11 17:24:16 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 11 Jul 2006 08:24:16 -0700 Subject: [IronPython] type.__call__ In-Reply-To: <5b0248170607102328u66594bc9sd799ab7995cf6b3c@mail.gmail.com> References: <5b0248170607102328u66594bc9sd799ab7995cf6b3c@mail.gmail.com> Message-ID: <7AD436E4270DD54A94238001769C22272476945FFE@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Awesome, thanks for reporting this, it looks like we need to special case overriding virtuals w/ ICallerContext and deal w/ the param args as well. I've opened CodePlex bug #871 for this (http://www.codeplex.com/WorkItem/List.aspx?ProjectName=IronPython). -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Sanghyeon Seo Sent: Monday, July 10, 2006 11:28 PM To: Discussion of IronPython Subject: [IronPython] type.__call__ Okay, I admit I have never imagined Python code like this. # test.py class MetaClass(type): def __call__(self, *args): print args class Class(object): __metaclass__ = MetaClass Class(1, 2, 3) Found while trying to run SQLAlchemy (http://sqlalchemy.org/), a Python ORM library. * * * There also seems to be a strange import bug, but I couldn't reduce it. How to reproduce: import sqlalchemy Workaround. Swapping following two lines seem to "fix" this with no ill effect: from sqlalchemy import util import util as mapperutil To: import util as mapperutil from sqlalchemy import util 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 11 17:26:57 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 11 Jul 2006 08:26:57 -0700 Subject: [IronPython] NPE inside IronPython.Compiler In-Reply-To: <5b0248170607110246r2ddf8641i273c5999f82e22b@mail.gmail.com> References: <5b0248170607110246r2ddf8641i273c5999f82e22b@mail.gmail.com> Message-ID: <7AD436E4270DD54A94238001769C22272476945FFF@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Thanks, That one's interesting, I'm actually a little surprised we don't see it anywhere in the test suite (it would seem any try/finally w/ a return should hit it, maybe those just aren't very frequent). I've opened bug 872 for this. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Sanghyeon Seo Sent: Tuesday, July 11, 2006 2:46 AM To: Discussion of IronPython Subject: [IronPython] NPE inside IronPython.Compiler Following code, reduced from MoinMoin.util.lock, causes NPE inside IronPython.Compiler. MoinMoin (http://moinmoin.wikiwikiweb.de/) is a popular wiki engine written in Python. # lock.py class WriteLock: def acquire(self): try: result = self.lock.acquire() finally: if result: return result else: self.lock.release() 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 11 17:33:52 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 11 Jul 2006 08:33:52 -0700 Subject: [IronPython] Modules available for IronPython? In-Reply-To: <44B3B60B.6090206@voidspace.org.uk> References: <51443EA36EAFAB418F91F4B902CC8AA417D724@MAILA.internal.bwater.com> <44B3B60B.6090206@voidspace.org.uk> Message-ID: <7AD436E4270DD54A94238001769C22272476946003@DF-GRTDANE-MSG.exchange.corp.microsoft.com> That's a pretty good explanation, but when speaking of standard modules a distinction needs to be made between the built-in modules and the standard modules that are written in Python. For the built-in modules we typically write these, and if you let us know which owes you need it'll help us prioritize them for the future. Sometimes it takes us a while (e.g. socket was very popular, and Seo wrote his own socket module rather than wait for us). For the standard library modules our goal is actually to support it on IronPython. If you download CPython you can copy it's lib directory to IronPython's and start using all of those standard modules. We test IronPython against the CPython regression suite and modules so we try and make sure these work. This page http://www.codeplex.com/Wiki/View.aspx?ProjectName=IronPython&title=Regression%20Tests on CodePlex captures the state of the regression suite and is fairly up to date. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Fuzzyman Sent: Tuesday, July 11, 2006 7:31 AM To: Discussion of IronPython Subject: Re: [IronPython] Modules available for IronPython? Brian Rowe wrote: >What standard Python modules are available in IronPython? Is there a process for adding missing libraries to the base distribution or is it left as a user exercise to add them from the standard Python distribution? > > If you add the Python standard library to your sys.path, you will find that the vast majority of it works. If you find modules (or parts of modules) that don't work, and aren't recorded on the codeplex bug tracker, then report them here and they will be scheduled to be fixed 'some time'. I *think* that is a basically correct summation of the situation. Some parts of the standard library are implemented in C and *may* never work with IronPython, although Seo has (had ?) something in progress that may resolve that. All the best, Fuzzyman http://www.voidspace.org.uk/python/index.shtml > ===== >Brian Rowe >Bridgewater Associates >203 291 2849 > > > >---------------------------------------- > >This message is intended exclusively for the individual(s) or entity to which it is addressed. It may contain information that is proprietary, privileged or confidential or otherwise legally exempt from disclosure. If you are not the named addressee, you are not authorized to read, print, retain, copy or disseminate this message or any part of it. If you have received this message in error, please notify the sender immediately by e-mail and delete all copies of the message. > >_______________________________________________ >users mailing list >users at lists.ironpython.com >http://lists.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 Brian.Rowe at bwater.com Tue Jul 11 20:49:12 2006 From: Brian.Rowe at bwater.com (Brian Rowe) Date: Tue, 11 Jul 2006 14:49:12 -0400 Subject: [IronPython] Modules available for IronPython? Message-ID: <51443EA36EAFAB418F91F4B902CC8AA41CC0FA@MAILA.internal.bwater.com> Okay, thanks. I have experience in both Python and .NET, so IronPython seems like a natural extension. My concern is that common Pythonic solutions and patterns that I'm familiar with will not work based on lack of support for built-in libraries. Specifically, I'm referring to modules like os and string which fail to import. Are you saying that I can drop in the CPython implementations of these and they will work? On a separate thread, I was surprised that there is no direct mapping between a Python list and the IList interface, even though such a mapping exists for string. In general, what is the logic behind the mappings and is the complete list documented? -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com]On Behalf Of Dino Viehland Sent: Tuesday, July 11, 2006 11:34 AM To: Discussion of IronPython Subject: Re: [IronPython] Modules available for IronPython? That's a pretty good explanation, but when speaking of standard modules a distinction needs to be made between the built-in modules and the standard modules that are written in Python. For the built-in modules we typically write these, and if you let us know which owes you need it'll help us prioritize them for the future. Sometimes it takes us a while (e.g. socket was very popular, and Seo wrote his own socket module rather than wait for us). For the standard library modules our goal is actually to support it on IronPython. If you download CPython you can copy it's lib directory to IronPython's and start using all of those standard modules. We test IronPython against the CPython regression suite and modules so we try and make sure these work. This page http://www.codeplex.com/Wiki/View.aspx?ProjectName=IronPython&title=Regression%20Tests on CodePlex captures the state of the regression suite and is fairly up to date. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Fuzzyman Sent: Tuesday, July 11, 2006 7:31 AM To: Discussion of IronPython Subject: Re: [IronPython] Modules available for IronPython? Brian Rowe wrote: >What standard Python modules are available in IronPython? Is there a process for adding missing libraries to the base distribution or is it left as a user exercise to add them from the standard Python distribution? > > If you add the Python standard library to your sys.path, you will find that the vast majority of it works. If you find modules (or parts of modules) that don't work, and aren't recorded on the codeplex bug tracker, then report them here and they will be scheduled to be fixed 'some time'. I *think* that is a basically correct summation of the situation. Some parts of the standard library are implemented in C and *may* never work with IronPython, although Seo has (had ?) something in progress that may resolve that. All the best, Fuzzyman http://www.voidspace.org.uk/python/index.shtml > ===== >Brian Rowe >Bridgewater Associates >203 291 2849 > > > >---------------------------------------- > >This message is intended exclusively for the individual(s) or entity to which it is addressed. It may contain information that is proprietary, privileged or confidential or otherwise legally exempt from disclosure. If you are not the named addressee, you are not authorized to read, print, retain, copy or disseminate this message or any part of it. If you have received this message in error, please notify the sender immediately by e-mail and delete all copies of the message. > >_______________________________________________ >users mailing list >users at lists.ironpython.com >http://lists.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 ---------------------------------------- This message is intended exclusively for the individual(s) or entity to which it is addressed. It may contain information that is proprietary, privileged or confidential or otherwise legally exempt from disclosure. If you are not the named addressee, you are not authorized to read, print, retain, copy or disseminate this message or any part of it. If you have received this message in error, please notify the sender immediately by e-mail and delete all copies of the message. From t-bruch at microsoft.com Tue Jul 11 22:06:55 2006 From: t-bruch at microsoft.com (Bruce Christensen) Date: Tue, 11 Jul 2006 13:06:55 -0700 Subject: [IronPython] Modules available for IronPython? In-Reply-To: <51443EA36EAFAB418F91F4B902CC8AA41CC0FA@MAILA.internal.bwater.com> References: <51443EA36EAFAB418F91F4B902CC8AA41CC0FA@MAILA.internal.bwater.com> Message-ID: <3581AA168D87A2479D88EA319BDF7D32D2B002@RED-MSG-80.redmond.corp.microsoft.com> Yes, you can drop in the CPython libraries, and they'll work (with some exceptions, which Dino noted below). For example: C:\Ip\IronPython>set IRONPYTHONPATH=C:\Python24\Lib C:\Ip\IronPython>ipy IronPython 1.0.2383 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import os.path >>> import string >>> string.join(os.path.split(os.path.realpath(os.curdir)), "****") 'C:\\Ip****IronPython' >>> --Bruce -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Brian Rowe Sent: Tuesday, July 11, 2006 11:49 AM To: Discussion of IronPython Subject: Re: [IronPython] Modules available for IronPython? Okay, thanks. I have experience in both Python and .NET, so IronPython seems like a natural extension. My concern is that common Pythonic solutions and patterns that I'm familiar with will not work based on lack of support for built-in libraries. Specifically, I'm referring to modules like os and string which fail to import. Are you saying that I can drop in the CPython implementations of these and they will work? On a separate thread, I was surprised that there is no direct mapping between a Python list and the IList interface, even though such a mapping exists for string. In general, what is the logic behind the mappings and is the complete list documented? -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com]On Behalf Of Dino Viehland Sent: Tuesday, July 11, 2006 11:34 AM To: Discussion of IronPython Subject: Re: [IronPython] Modules available for IronPython? That's a pretty good explanation, but when speaking of standard modules a distinction needs to be made between the built-in modules and the standard modules that are written in Python. For the built-in modules we typically write these, and if you let us know which owes you need it'll help us prioritize them for the future. Sometimes it takes us a while (e.g. socket was very popular, and Seo wrote his own socket module rather than wait for us). For the standard library modules our goal is actually to support it on IronPython. If you download CPython you can copy it's lib directory to IronPython's and start using all of those standard modules. We test IronPython against the CPython regression suite and modules so we try and make sure these work. This page http://www.codeplex.com/Wiki/View.aspx?ProjectName=IronPython&title=Regr ession%20Tests on CodePlex captures the state of the regression suite and is fairly up to date. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Fuzzyman Sent: Tuesday, July 11, 2006 7:31 AM To: Discussion of IronPython Subject: Re: [IronPython] Modules available for IronPython? Brian Rowe wrote: >What standard Python modules are available in IronPython? Is there a process for adding missing libraries to the base distribution or is it left as a user exercise to add them from the standard Python distribution? > > If you add the Python standard library to your sys.path, you will find that the vast majority of it works. If you find modules (or parts of modules) that don't work, and aren't recorded on the codeplex bug tracker, then report them here and they will be scheduled to be fixed 'some time'. I *think* that is a basically correct summation of the situation. Some parts of the standard library are implemented in C and *may* never work with IronPython, although Seo has (had ?) something in progress that may resolve that. All the best, Fuzzyman http://www.voidspace.org.uk/python/index.shtml > ===== >Brian Rowe >Bridgewater Associates >203 291 2849 > > > >---------------------------------------- > >This message is intended exclusively for the individual(s) or entity to which it is addressed. It may contain information that is proprietary, privileged or confidential or otherwise legally exempt from disclosure. If you are not the named addressee, you are not authorized to read, print, retain, copy or disseminate this message or any part of it. If you have received this message in error, please notify the sender immediately by e-mail and delete all copies of the message. > >_______________________________________________ >users mailing list >users at lists.ironpython.com >http://lists.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 ---------------------------------------- This message is intended exclusively for the individual(s) or entity to which it is addressed. It may contain information that is proprietary, privileged or confidential or otherwise legally exempt from disclosure. If you are not the named addressee, you are not authorized to read, print, retain, copy or disseminate this message or any part of it. If you have received this message in error, please notify the sender immediately by e-mail and delete all copies of the message. _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From sanxiyn at gmail.com Wed Jul 12 03:07:24 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Wed, 12 Jul 2006 10:07:24 +0900 Subject: [IronPython] type.__call__ In-Reply-To: <5b0248170607102328u66594bc9sd799ab7995cf6b3c@mail.gmail.com> References: <5b0248170607102328u66594bc9sd799ab7995cf6b3c@mail.gmail.com> Message-ID: <5b0248170607111807p37a68da1p100ff95117aa147c@mail.gmail.com> Can anyone reproduce this import bug? SQLAlchemy 0.2.5 release should do. 2006/7/11, Sanghyeon Seo : > There also seems to be a strange import bug, but I couldn't reduce it. > > How to reproduce: > > import sqlalchemy > > Workaround. Swapping following two lines seem to "fix" this with no ill effect: > > from sqlalchemy import util > import util as mapperutil > > To: > > import util as mapperutil > from sqlalchemy import util > > Seo Sanghyeon From luismg at gmx.net Wed Jul 12 05:09:54 2006 From: luismg at gmx.net (Luis M. Gonzalez) Date: Wed, 12 Jul 2006 00:09:54 -0300 Subject: [IronPython] speed Message-ID: <002b01c6a560$a7856ae0$c51ce818@luis> Hi everyone, I'd like to ask you a question about Ironpython's speed and performance: I imagine that so far, you've been concentrated in completeness and compatibility more than performance, and I guess you'll address this issue after verion 1.0. However, and although you claimed that Ironpython is faster than cpython, I see cases where it is slower by a large margin. For example, the script below is up to 21x slower than cpython. My question is: what are your expectations regarding ironpython's speed in the future? According to your experience so far, are you confident that it will match or surpass cpython's? Where do you think it will be better and where it will be worse? script ----------------------------- import time def test(): start= time.clock() z=[] x=range(1000000) for i in range(1000000): if i % 2: x[i] = 10 else: x[i] = "a string" for i in x: if type(i)==str: z.append(i.upper()) else: z.append(i*3) end= time.clock() - start print end test() ----------------------------------- end script Regards, Luis -------------- next part -------------- An HTML attachment was scrubbed... URL: From f.cadier at free.fr Wed Jul 12 11:02:40 2006 From: f.cadier at free.fr (=?ISO-8859-1?Q?Fr=E9d=E9ric_Cadier?=) Date: Wed, 12 Jul 2006 11:02:40 +0200 Subject: [IronPython] Running IronPython code from C# Message-ID: <44B4BAB0.2070601@free.fr> Hi everyone, I hope I won't be too annoying with a newbie question... but I'm wondering how to run IP code from C# : I would for example define a class MyClass in myclass.py, and want to instanciate it from some C# code. Can someone help me ? Thank you, Fr?d?ric Cadier From eyvind.axelsen at profdoc.no Wed Jul 12 14:07:08 2006 From: eyvind.axelsen at profdoc.no (Eyvind Axelsen) Date: Wed, 12 Jul 2006 14:07:08 +0200 Subject: [IronPython] Running IronPython code from C# In-Reply-To: <44B4BAB0.2070601@free.fr> Message-ID: 1 Add a reference to IronPython.dll in your project 2 Instantiate the python engine: IronPython.Hosting.PythonEngine pe = new IronPython.Hosting.PythonEngine(); 3 Run your code: string myCode = "some python code here"; pe.Execute(myCode); HTH, Eyvind. -----Opprinnelig melding----- Fra: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] P? vegne av Fr?d?ric Cadier Sendt: 12. juli 2006 11:03 Til: users at lists.ironpython.com Emne: [IronPython] Running IronPython code from C# Hi everyone, I hope I won't be too annoying with a newbie question... but I'm wondering how to run IP code from C# : I would for example define a class MyClass in myclass.py, and want to instanciate it from some C# code. Can someone help me ? Thank you, Fr?d?ric Cadier _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From f.cadier at free.fr Wed Jul 12 14:16:28 2006 From: f.cadier at free.fr (=?ISO-8859-1?Q?Fr=E9d=E9ric_Cadier?=) Date: Wed, 12 Jul 2006 14:16:28 +0200 Subject: [IronPython] Running IronPython code from C# In-Reply-To: References: Message-ID: <44B4E81C.4090303@free.fr> Thanks Eyvind, but this forces me to transfer my IP code in some C# strings ! What i want is being able to use the assembly generated from my ip scripts (using the language service of the VS20005 SDK) and then use it in my C# code... Eyvind Axelsen a ?crit : > 1 Add a reference to IronPython.dll in your project > > 2 Instantiate the python engine: > > IronPython.Hosting.PythonEngine pe = new IronPython.Hosting.PythonEngine(); > > 3 Run your code: > > string myCode = "some python code here"; > pe.Execute(myCode); > > HTH, > > Eyvind. > > -----Opprinnelig melding----- > Fra: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] P? vegne av Fr?d?ric Cadier > Sendt: 12. juli 2006 11:03 > Til: users at lists.ironpython.com > Emne: [IronPython] Running IronPython code from C# > > Hi everyone, > > I hope I won't be too annoying with a newbie question... but I'm > wondering how to run IP code from C# : I would for example define a > class MyClass in myclass.py, and want to instanciate it from some C# code. > > Can someone help me ? > > Thank you, > Fr?d?ric Cadier > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.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 joesox at gmail.com Wed Jul 12 15:49:28 2006 From: joesox at gmail.com (JoeSox) Date: Wed, 12 Jul 2006 06:49:28 -0700 Subject: [IronPython] Running IronPython code from C# In-Reply-To: <44B4E81C.4090303@free.fr> References: <44B4E81C.4090303@free.fr> Message-ID: <785694cd0607120649w3f0f0d0fhc4f0e841fc027ed4@mail.gmail.com> On 7/12/06, Fr?d?ric Cadier wrote: > Thanks Eyvind, > > but this forces me to transfer my IP code in some C# strings ! What i > want is being able to use the assembly generated from my ip scripts > (using the language service of the VS20005 SDK) and then use it in my C# > code... Do you mean something like...? Engine1.AddToPath("E:\\Myscriptfolder"); cn_Engine1.Execute("import myscript"); cn_Engine1.Execute("m=myClass()"); cn_Engine1.Execute("m.mydef()"); Or do you mean how do you embed your files and compile a C# .dll? -- Later, Joe From joesox at gmail.com Wed Jul 12 15:51:16 2006 From: joesox at gmail.com (JoeSox) Date: Wed, 12 Jul 2006 06:51:16 -0700 Subject: [IronPython] Running IronPython code from C# In-Reply-To: <785694cd0607120649w3f0f0d0fhc4f0e841fc027ed4@mail.gmail.com> References: <44B4E81C.4090303@free.fr> <785694cd0607120649w3f0f0d0fhc4f0e841fc027ed4@mail.gmail.com> Message-ID: <785694cd0607120651h5dd9e1dre4862fbcf9e50cd8@mail.gmail.com> On 7/12/06, JoeSox wrote: > On 7/12/06, Fr?d?ric Cadier wrote: > > Thanks Eyvind, > > > > but this forces me to transfer my IP code in some C# strings ! What i > > want is being able to use the assembly generated from my ip scripts > > (using the language service of the VS20005 SDK) and then use it in my C# > > code... > > Do you mean something like...? > > Engine1.AddToPath("E:\\Myscriptfolder"); > cn_Engine1.Execute("import myscript"); > cn_Engine1.Execute("m=myClass()"); > cn_Engine1.Execute("m.mydef()"); > > Or do you mean how do you embed your files and compile a C# .dll? > -- > Later, Joe Of course "cn_Engine1" is a typo. I just learned I need to be in a meeting in ten minutes so I pressed send to early. Later, Joe From sanxiyn at gmail.com Wed Jul 12 15:52:12 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Wed, 12 Jul 2006 22:52:12 +0900 Subject: [IronPython] Running IronPython code from C# In-Reply-To: <44B4BAB0.2070601@free.fr> References: <44B4BAB0.2070601@free.fr> Message-ID: <5b0248170607120652n32febcbdxb0225fca986fe221@mail.gmail.com> 2006/7/12, Fr?d?ric Cadier : > I hope I won't be too annoying with a newbie question... but I'm > wondering how to run IP code from C# : I would for example define a > class MyClass in myclass.py, and want to instanciate it from some C# code. I believe this (defining CLS type in IronPython) is currently not possible, and it isn't planned for 1.0. That doesn't mean it won't be possible forever though. Seo Sanghyeon From f.cadier at free.fr Wed Jul 12 15:53:04 2006 From: f.cadier at free.fr (=?ISO-8859-1?Q?Fr=E9d=E9ric_Cadier?=) Date: Wed, 12 Jul 2006 15:53:04 +0200 Subject: [IronPython] Running IronPython code from C# In-Reply-To: <785694cd0607120649w3f0f0d0fhc4f0e841fc027ed4@mail.gmail.com> References: <44B4E81C.4090303@free.fr> <785694cd0607120649w3f0f0d0fhc4f0e841fc027ed4@mail.gmail.com> Message-ID: <44B4FEC0.3000900@free.fr> The embedded solution... is there a mean ? Thanks JoeSox a ?crit : > On 7/12/06, Fr?d?ric Cadier wrote: > >> Thanks Eyvind, >> >> but this forces me to transfer my IP code in some C# strings ! What i >> want is being able to use the assembly generated from my ip scripts >> (using the language service of the VS20005 SDK) and then use it in my C# >> code... >> > > Do you mean something like...? > > Engine1.AddToPath("E:\\Myscriptfolder"); > cn_Engine1.Execute("import myscript"); > cn_Engine1.Execute("m=myClass()"); > cn_Engine1.Execute("m.mydef()"); > > Or do you mean how do you embed your files and compile a C# .dll? > -- > Later, Joe > _______________________________________________ > 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 f.cadier at free.fr Wed Jul 12 16:03:40 2006 From: f.cadier at free.fr (=?ISO-8859-1?Q?Fr=E9d=E9ric_Cadier?=) Date: Wed, 12 Jul 2006 16:03:40 +0200 Subject: [IronPython] Running IronPython code from C# In-Reply-To: <5b0248170607120652n32febcbdxb0225fca986fe221@mail.gmail.com> References: <44B4BAB0.2070601@free.fr> <5b0248170607120652n32febcbdxb0225fca986fe221@mail.gmail.com> Message-ID: <44B5013C.2000000@free.fr> I had something working using IronPython.Runtime.OldClass and IronPython.Runtime.OldInstance, but I don't even understand what i've done... First, my IP script "ClassIP.py", defining a small class : class MyClass: def __init__ (self, text): self.text = text def test(self): return "Test " + self.text And then a form with one TextBox in C# : public Form1() { InitializeComponent(); new ClassIP().Initialize(); IronPython.Runtime.OldInstance current = (IronPython.Runtime.OldInstance) ((IronPython.Runtime.OldClass)ClassIP.MyClass).Call("from C# !"); IronPython.Runtime.Method currentTest = (IronPython.Runtime.Method)current.__class__.__dict__["test"]; textBox1.Text = (string) currentTest.Call(current); } Is this something meaningful for you ? Fr?d?ric Cadier Sanghyeon Seo a ?crit : > 2006/7/12, Fr?d?ric Cadier : > >> I hope I won't be too annoying with a newbie question... but I'm >> wondering how to run IP code from C# : I would for example define a >> class MyClass in myclass.py, and want to instanciate it from some C# code. >> > > I believe this (defining CLS type in IronPython) is currently not > possible, and it isn't planned for 1.0. That doesn't mean it won't be > possible forever though. > > Seo Sanghyeon > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ryan at acceleration.net Wed Jul 12 16:18:31 2006 From: ryan at acceleration.net (Ryan Davis) Date: Wed, 12 Jul 2006 10:18:31 -0400 Subject: [IronPython] Running IronPython code from C# In-Reply-To: <44B4E81C.4090303@free.fr> References: <44B4E81C.4090303@free.fr> Message-ID: <44B504B7.2000109@acceleration.net> You can keep your IP code in their own files, and then read those files into strings with C#, which makes it not quite as ugly. Still not as nice as being able to reference a dll, but not so bad as embedding in C#. Ryan Davis Acceleration.net Director of Programming Services 2831 NW 41st street, suite B Gainesville, FL 32606 Office: 352-335-6500 x 124 Fax: 352-335-6506 Fr?d?ric Cadier wrote: > Thanks Eyvind, > > but this forces me to transfer my IP code in some C# strings ! What i > want is being able to use the assembly generated from my ip scripts > (using the language service of the VS20005 SDK) and then use it in my C# > code... > > Eyvind Axelsen a ?crit : > >> 1 Add a reference to IronPython.dll in your project >> >> 2 Instantiate the python engine: >> >> IronPython.Hosting.PythonEngine pe = new IronPython.Hosting.PythonEngine(); >> >> 3 Run your code: >> >> string myCode = "some python code here"; >> pe.Execute(myCode); >> >> HTH, >> >> Eyvind. >> >> -----Opprinnelig melding----- >> Fra: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] P? vegne av Fr?d?ric Cadier >> Sendt: 12. juli 2006 11:03 >> Til: users at lists.ironpython.com >> Emne: [IronPython] Running IronPython code from C# >> >> Hi everyone, >> >> I hope I won't be too annoying with a newbie question... but I'm >> wondering how to run IP code from C# : I would for example define a >> class MyClass in myclass.py, and want to instanciate it from some C# code. >> >> Can someone help me ? >> >> Thank you, >> Fr?d?ric Cadier >> _______________________________________________ >> users mailing list >> users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> _______________________________________________ >> users mailing list >> users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> >> >> >> > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From t-bruch at microsoft.com Wed Jul 12 18:31:44 2006 From: t-bruch at microsoft.com (Bruce Christensen) Date: Wed, 12 Jul 2006 09:31:44 -0700 Subject: [IronPython] type.__call__ In-Reply-To: <5b0248170607111807p37a68da1p100ff95117aa147c@mail.gmail.com> References: <5b0248170607102328u66594bc9sd799ab7995cf6b3c@mail.gmail.com> <5b0248170607111807p37a68da1p100ff95117aa147c@mail.gmail.com> Message-ID: <3581AA168D87A2479D88EA319BDF7D32D9BED4@RED-MSG-80.redmond.corp.microsoft.com> I can verify that importing SQLAlchemy 0.2.5 doesn't work: C:\Ip\IronPython\External\Regress\Python24\Lib>ipy IronPython 1.0.2383 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import sys, os.path >>> sys.path.append(os.path.realpath(os.path.join(os.path.curdir, 'site-packages '))) >>> >>> >>> >>> import sqlalchemy Traceback (most recent call last): File , line 0, in ##73 File , line 0, in __import__##4 File C:\Ip\IronPython\External\Regress\Python24\Lib\site-packages\sqlalchemy\ __init__.py, line 7, in Initialize File , line 0, in __import__##4 File C:\Ip\IronPython\External\Regress\Python24\Lib\site-packages\sqlalchemy\ types.py, line 14, in Initialize File , line 0, in __import__##4 File C:\Ip\IronPython\External\Regress\Python24\Lib\site-packages\sqlalchemy\ util.py, line 205, in Initialize SystemError: Method 'GetDict' on type 'IronPython.NewTypes.System.Object_6_8_11' from assembly 'snippets1, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null ' is overriding a method that has been overridden. >>> However, it seems like this may be a different bug than the one that you're talking about. The one above is actually a problem related to deriving from classes with __slots__. I've filed CodePlex bug 901 on this (http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkI temId=901). --Bruce -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Sanghyeon Seo Sent: Tuesday, July 11, 2006 6:07 PM To: Discussion of IronPython Subject: Re: [IronPython] type.__call__ Can anyone reproduce this import bug? SQLAlchemy 0.2.5 release should do. 2006/7/11, Sanghyeon Seo : > There also seems to be a strange import bug, but I couldn't reduce it. > > How to reproduce: > > import sqlalchemy > > Workaround. Swapping following two lines seem to "fix" this with no ill effect: > > from sqlalchemy import util > import util as mapperutil > > To: > > import util as mapperutil > from sqlalchemy import util > > 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 Wed Jul 12 18:46:00 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 12 Jul 2006 09:46:00 -0700 Subject: [IronPython] Modules available for IronPython? In-Reply-To: <51443EA36EAFAB418F91F4B902CC8AA41CC0FA@MAILA.internal.bwater.com> References: <51443EA36EAFAB418F91F4B902CC8AA41CC0FA@MAILA.internal.bwater.com> Message-ID: <7AD436E4270DD54A94238001769C222725D9E39EAB@DF-GRTDANE-MSG.exchange.corp.microsoft.com> To answer your 2nd question: What mapping are you referring to in particular? Our List class does implement both IList and IList so it should pass through to anything that takes one of those. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Brian Rowe Sent: Tuesday, July 11, 2006 11:49 AM To: Discussion of IronPython Subject: Re: [IronPython] Modules available for IronPython? Okay, thanks. I have experience in both Python and .NET, so IronPython seems like a natural extension. My concern is that common Pythonic solutions and patterns that I'm familiar with will not work based on lack of support for built-in libraries. Specifically, I'm referring to modules like os and string which fail to import. Are you saying that I can drop in the CPython implementations of these and they will work? On a separate thread, I was surprised that there is no direct mapping between a Python list and the IList interface, even though such a mapping exists for string. In general, what is the logic behind the mappings and is the complete list documented? -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com]On Behalf Of Dino Viehland Sent: Tuesday, July 11, 2006 11:34 AM To: Discussion of IronPython Subject: Re: [IronPython] Modules available for IronPython? That's a pretty good explanation, but when speaking of standard modules a distinction needs to be made between the built-in modules and the standard modules that are written in Python. For the built-in modules we typically write these, and if you let us know which owes you need it'll help us prioritize them for the future. Sometimes it takes us a while (e.g. socket was very popular, and Seo wrote his own socket module rather than wait for us). For the standard library modules our goal is actually to support it on IronPython. If you download CPython you can copy it's lib directory to IronPython's and start using all of those standard modules. We test IronPython against the CPython regression suite and modules so we try and make sure these work. This page http://www.codeplex.com/Wiki/View.aspx?ProjectName=IronPython&title=Regression%20Tests on CodePlex captures the state of the regression suite and is fairly up to date. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Fuzzyman Sent: Tuesday, July 11, 2006 7:31 AM To: Discussion of IronPython Subject: Re: [IronPython] Modules available for IronPython? Brian Rowe wrote: >What standard Python modules are available in IronPython? Is there a process for adding missing libraries to the base distribution or is it left as a user exercise to add them from the standard Python distribution? > > If you add the Python standard library to your sys.path, you will find that the vast majority of it works. If you find modules (or parts of modules) that don't work, and aren't recorded on the codeplex bug tracker, then report them here and they will be scheduled to be fixed 'some time'. I *think* that is a basically correct summation of the situation. Some parts of the standard library are implemented in C and *may* never work with IronPython, although Seo has (had ?) something in progress that may resolve that. All the best, Fuzzyman http://www.voidspace.org.uk/python/index.shtml > ===== >Brian Rowe >Bridgewater Associates >203 291 2849 > > > >---------------------------------------- > >This message is intended exclusively for the individual(s) or entity to which it is addressed. It may contain information that is proprietary, privileged or confidential or otherwise legally exempt from disclosure. If you are not the named addressee, you are not authorized to read, print, retain, copy or disseminate this message or any part of it. If you have received this message in error, please notify the sender immediately by e-mail and delete all copies of the message. > >_______________________________________________ >users mailing list >users at lists.ironpython.com >http://lists.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 ---------------------------------------- This message is intended exclusively for the individual(s) or entity to which it is addressed. It may contain information that is proprietary, privileged or confidential or otherwise legally exempt from disclosure. If you are not the named addressee, you are not authorized to read, print, retain, copy or disseminate this message or any part of it. If you have received this message in error, please notify the sender immediately by e-mail and delete all copies of the message. _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From miguel at ximian.com Wed Jul 12 20:30:14 2006 From: miguel at ximian.com (Miguel de Icaza) Date: Wed, 12 Jul 2006 14:30:14 -0400 Subject: [IronPython] IronPython Console on Unix. In-Reply-To: <44B5013C.2000000@free.fr> References: <44B4BAB0.2070601@free.fr> <5b0248170607120652n32febcbdxb0225fca986fe221@mail.gmail.com> <44B5013C.2000000@free.fr> Message-ID: <1152729014.12777.96.camel@erandi.cam.novell.com> Hello, Something in IronPython is now looking for Control-z, which is fine on Windows, but on Unix, Control-Z stands for "suspend application". In Unix, the end-of-file descriptor is control-d; Am not sure why the code is actually looking for a Control-Z, while it could be checking whether there is input available instead. miguel. From t-clacul at microsoft.com Wed Jul 12 20:48:43 2006 From: t-clacul at microsoft.com (Lee Culver) Date: Wed, 12 Jul 2006 11:48:43 -0700 Subject: [IronPython] Getting a call stack from an exception? Message-ID: <529C8DA84B5B364FB86BB4DC8707508B018F6F54@RED-MSG-80.redmond.corp.microsoft.com> I would like to print out a call stack from an exception object, much like what the IronPython console does when an exception goes uncaught. I have tried doing something like this: try: ... #something that causes an exception except Exception, e: print e But, like python, this only prints out the message given to it. I have also tried this: print e.clsException print e.clsException.StackTrace But these print out the stack trace which includes the IronPython library c# code as well. Is there a way to get the stack trace which only contains the python call stack (like the one the console uses)? Thanks -Lee -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Wed Jul 12 20:53:47 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 12 Jul 2006 11:53:47 -0700 Subject: [IronPython] Getting a call stack from an exception? In-Reply-To: <529C8DA84B5B364FB86BB4DC8707508B018F6F54@RED-MSG-80.redmond.corp.microsoft.com> References: <529C8DA84B5B364FB86BB4DC8707508B018F6F54@RED-MSG-80.redmond.corp.microsoft.com> Message-ID: <7AD436E4270DD54A94238001769C222725D9E39FCA@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Tracebacks are the correct way to do this, I recommend you install the standard Python library against IronPython to make this really useful - then you can do import traceback and use its handy functions (otherwise you'll be walking the traceback list in sys.exc_info() which won't be much fun). From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Lee Culver Sent: Wednesday, July 12, 2006 11:49 AM To: Discussion of IronPython Subject: [IronPython] Getting a call stack from an exception? I would like to print out a call stack from an exception object, much like what the IronPython console does when an exception goes uncaught. I have tried doing something like this: try: ... #something that causes an exception except Exception, e: print e But, like python, this only prints out the message given to it. I have also tried this: print e.clsException print e.clsException.StackTrace But these print out the stack trace which includes the IronPython library c# code as well. Is there a way to get the stack trace which only contains the python call stack (like the one the console uses)? Thanks -Lee -------------- next part -------------- An HTML attachment was scrubbed... URL: From t-clacul at microsoft.com Wed Jul 12 20:57:12 2006 From: t-clacul at microsoft.com (Lee Culver) Date: Wed, 12 Jul 2006 11:57:12 -0700 Subject: [IronPython] Getting a call stack from an exception? In-Reply-To: <7AD436E4270DD54A94238001769C222725D9E39FCA@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <529C8DA84B5B364FB86BB4DC8707508B018F6F6D@RED-MSG-80.redmond.corp.microsoft.com> Yikes. I was hoping for a way to do it in pure IronPython. Thanks though. ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Wednesday, July 12, 2006 11:54 AM To: Discussion of IronPython Subject: Re: [IronPython] Getting a call stack from an exception? Tracebacks are the correct way to do this, I recommend you install the standard Python library against IronPython to make this really useful - then you can do import traceback and use its handy functions (otherwise you'll be walking the traceback list in sys.exc_info() which won't be much fun). From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Lee Culver Sent: Wednesday, July 12, 2006 11:49 AM To: Discussion of IronPython Subject: [IronPython] Getting a call stack from an exception? I would like to print out a call stack from an exception object, much like what the IronPython console does when an exception goes uncaught. I have tried doing something like this: try: ... #something that causes an exception except Exception, e: print e But, like python, this only prints out the message given to it. I have also tried this: print e.clsException print e.clsException.StackTrace But these print out the stack trace which includes the IronPython library c# code as well. Is there a way to get the stack trace which only contains the python call stack (like the one the console uses)? Thanks -Lee -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex at syzmk.com Wed Jul 12 22:37:14 2006 From: alex at syzmk.com (Alex Henderson) Date: Thu, 13 Jul 2006 08:37:14 +1200 Subject: [IronPython] Getting a call stack from an exception? In-Reply-To: <529C8DA84B5B364FB86BB4DC8707508B018F6F6D@RED-MSG-80.redmond.corp.microsoft.com> Message-ID: <018901c6a5f2$f5a110c0$6701a8c0@tokai> I would be interested to know how you get on with this problem Lee - I've got the same issue myself. Chez, - Alex _____ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Lee Culver Sent: Thursday, 13 July 2006 6:57 a.m. To: Discussion of IronPython Subject: Re: [IronPython] Getting a call stack from an exception? Yikes. I was hoping for a way to do it in pure IronPython. Thanks though. _____ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Wednesday, July 12, 2006 11:54 AM To: Discussion of IronPython Subject: Re: [IronPython] Getting a call stack from an exception? Tracebacks are the correct way to do this, I recommend you install the standard Python library against IronPython to make this really useful - then you can do import traceback and use its handy functions (otherwise you'll be walking the traceback list in sys.exc_info() which won't be much fun). From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Lee Culver Sent: Wednesday, July 12, 2006 11:49 AM To: Discussion of IronPython Subject: [IronPython] Getting a call stack from an exception? I would like to print out a call stack from an exception object, much like what the IronPython console does when an exception goes uncaught. I have tried doing something like this: try: . #something that causes an exception except Exception, e: print e But, like python, this only prints out the message given to it. I have also tried this: print e.clsException print e.clsException.StackTrace But these print out the stack trace which includes the IronPython library c# code as well. Is there a way to get the stack trace which only contains the python call stack (like the one the console uses)? Thanks -Lee -------------- next part -------------- An HTML attachment was scrubbed... URL: From t-clacul at microsoft.com Wed Jul 12 22:39:28 2006 From: t-clacul at microsoft.com (Lee Culver) Date: Wed, 12 Jul 2006 13:39:28 -0700 Subject: [IronPython] Getting a call stack from an exception? In-Reply-To: <018901c6a5f2$f5a110c0$6701a8c0@tokai> Message-ID: <529C8DA84B5B364FB86BB4DC8707508B018F70BB@RED-MSG-80.redmond.corp.microsoft.com> I'm probably going to just reimplement the functionality in pure IP. If I get anywhere with it I'll post it up here. ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Alex Henderson Sent: Wednesday, July 12, 2006 1:37 PM To: 'Discussion of IronPython' Subject: Re: [IronPython] Getting a call stack from an exception? I would be interested to know how you get on with this problem Lee - I've got the same issue myself. Chez, - Alex ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Lee Culver Sent: Thursday, 13 July 2006 6:57 a.m. To: Discussion of IronPython Subject: Re: [IronPython] Getting a call stack from an exception? Yikes. I was hoping for a way to do it in pure IronPython. Thanks though. ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Wednesday, July 12, 2006 11:54 AM To: Discussion of IronPython Subject: Re: [IronPython] Getting a call stack from an exception? Tracebacks are the correct way to do this, I recommend you install the standard Python library against IronPython to make this really useful - then you can do import traceback and use its handy functions (otherwise you'll be walking the traceback list in sys.exc_info() which won't be much fun). From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Lee Culver Sent: Wednesday, July 12, 2006 11:49 AM To: Discussion of IronPython Subject: [IronPython] Getting a call stack from an exception? I would like to print out a call stack from an exception object, much like what the IronPython console does when an exception goes uncaught. I have tried doing something like this: try: ... #something that causes an exception except Exception, e: print e But, like python, this only prints out the message given to it. I have also tried this: print e.clsException print e.clsException.StackTrace But these print out the stack trace which includes the IronPython library c# code as well. Is there a way to get the stack trace which only contains the python call stack (like the one the console uses)? Thanks -Lee -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Wed Jul 12 22:46:55 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 12 Jul 2006 13:46:55 -0700 Subject: [IronPython] Getting a call stack from an exception? In-Reply-To: <529C8DA84B5B364FB86BB4DC8707508B018F70BB@RED-MSG-80.redmond.corp.microsoft.com> References: <018901c6a5f2$f5a110c0$6701a8c0@tokai> <529C8DA84B5B364FB86BB4DC8707508B018F70BB@RED-MSG-80.redmond.corp.microsoft.com> Message-ID: <7AD436E4270DD54A94238001769C222725D9E3A0AF@DF-GRTDANE-MSG.exchange.corp.microsoft.com> It shouldn't be too hard to just get the line numbers & filenames - the nice thing that the standard traceback.py file gives you is it can get the lines of source code and include it in the displayed call stack as well. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Lee Culver Sent: Wednesday, July 12, 2006 1:39 PM To: Discussion of IronPython Subject: Re: [IronPython] Getting a call stack from an exception? I'm probably going to just reimplement the functionality in pure IP. If I get anywhere with it I'll post it up here. ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Alex Henderson Sent: Wednesday, July 12, 2006 1:37 PM To: 'Discussion of IronPython' Subject: Re: [IronPython] Getting a call stack from an exception? I would be interested to know how you get on with this problem Lee - I've got the same issue myself. Chez, - Alex ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Lee Culver Sent: Thursday, 13 July 2006 6:57 a.m. To: Discussion of IronPython Subject: Re: [IronPython] Getting a call stack from an exception? Yikes. I was hoping for a way to do it in pure IronPython. Thanks though. ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Wednesday, July 12, 2006 11:54 AM To: Discussion of IronPython Subject: Re: [IronPython] Getting a call stack from an exception? Tracebacks are the correct way to do this, I recommend you install the standard Python library against IronPython to make this really useful - then you can do import traceback and use its handy functions (otherwise you'll be walking the traceback list in sys.exc_info() which won't be much fun). From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Lee Culver Sent: Wednesday, July 12, 2006 11:49 AM To: Discussion of IronPython Subject: [IronPython] Getting a call stack from an exception? I would like to print out a call stack from an exception object, much like what the IronPython console does when an exception goes uncaught. I have tried doing something like this: try: ... #something that causes an exception except Exception, e: print e But, like python, this only prints out the message given to it. I have also tried this: print e.clsException print e.clsException.StackTrace But these print out the stack trace which includes the IronPython library c# code as well. Is there a way to get the stack trace which only contains the python call stack (like the one the console uses)? Thanks -Lee -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Thu Jul 13 00:26:51 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 12 Jul 2006 15:26:51 -0700 Subject: [IronPython] IronPython 1.0 Beta 9 Message-ID: <7AD436E4270DD54A94238001769C222725D9E3A183@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Hello IronPython Community, We have just released IronPython 1.0 Beta 9. This release focuses primarily on fixing bugs resolving around compatibility with CPython, finalizing the public API surface, and improving the new method binder. There's also some significant performance improvements as well as the runtime support required to use the pickle module. One of the most significant changes is the final updates to the hosting API. The hosting APIs have removed the concept of a ModuleScope and replaced it with a normal dictionary. Here is a sample of how you can use the new hosting APIs: EngineOptions engineOptions = new EngineOptions(); engineOptions.ShowClrExceptions = true; // do some customization PythonEngine engine = new PythonEngine(engineOptions); Dictionary globals = new Dictionary(); globals["x"] = 1; // set a global variable EngineModule module = engine.CreateModule("MyModule", globals, true); module.Globals["y"] = 2; // set another global variable Dictionary locals = new Dictionary(); locals["z"] = 3; // set a local variable engine.Compile("result = x+y+z").Execute(module, locals); Console.WriteLine(engine.EvaluateAs("result", module, locals)); We've also added new PythonEngine.CreateMethod and PythonEngine.CreateLambda methods. These allow you to bind either a set of Python statements or a single expression to a delegate. The parameters of the delegate are exposed to the Python code, and the delegate can be re-bound to different modules at runtime providing a quick way to provide different inputs to your cached Python code. Finally we've introduced a change to the clr.Reference type for passing values to reference and out parameters. This type is now a generic type that you instantiate like any other (e.g. clr.Reference[int]). It contains a Value property that is strongly typed and can be used for picking overloads amongst multiple out/ref parameters. You can download the release from: http://www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=IronPython&ReleaseId=97 We'd like to thank everyone in the community for your bug reports and suggestions that helped make this a better release: Andrzej Krzywda, Brandon Furtwangler, cbrochu, Davy Mitchell, Greg Chapman, Paparipote, JesseK, Jonathan Jacobs, J?rgen Stenarson, Keith J. Farmer, Michael Foord, mfenniak, py_sunil, Seo Sanghyeon, sharerj, Syzmon Kobalczyk. Thanks and keep in touch, The IronPython Team More complete list of changes and bug fixes: ============================================ CodePlex 522 - Inheritance Cycle Not Detected. Renamed IronPythonConsole to ipy and IronPythonWindow to ipyw AST no longer exposes public fields Bugfix 341 - Unify code in ReflectedPackage and ReflectedAssembly Bugfix 351 -Regex: back-matching of groups is not translated into .NET Regex correctly Bugfix 354 - Behavior of globals incompatible with CPython Bugfix 443 - keyword confusion on list.__init__ Bugfix 448 - Runtime error accessing members of collection objects (e.g., Folders) in Outlook Object Model Bugfix 520 - Lists compare against Tuple's Cleaned up code formatting Bugfix 444 - Binding: Cannot override a method with an out parameter CodeDom array handling fixed PythonEngine.Execute can take filename for improved debugging Bugfix: AssertionError runs input through String.Format mishandling { and } -X:PassExceptions added for improved debugging under the debugger Removed file.isatty API because we can't properly implement it Force test_assert to run in a new console w/o optimizations Bugfix: CodePlex 350 - We allow calling a constructor with incorrect number of arguments enforce only strings are returned from __hex__/__oct__ Bugfix 537 - Passing function to form.Invoke raised null reference exception in Ops.GetDelegate. We throw TypeError with a good exception message Bugfix 551 - SystemError exception on dir(class.function). This already works Bugfix 561 - Empty module includes None. DictionaryUnionEnumerator was not moving to the next enumerator correctly. Also added asserts so that users of DictionaryUnionEnumerator cannot call Current without first calling MoveNext. Bugfix 562 - getattr(object(), None) complains that we don't have that attribute. SymbolTable.StringToId should throw for null input Bugfix 564 - Issue in method list.__init__ Fixed missing methods on NoneType Improved -X:ILDebug command line option Bugfix: del builtinTypeInstance.__class__ should throw TypeError, but del builtinTypeInstance.__anyotherattribute__ should throw an AttributeError Bugfix - 'mystr'.{encode|decode}('raw_unicode_escape') now works with underscores as well as dashes Bugfix - _codecs.raw_unicode_escape_{encode|decode} is no longer unimplemented Bugfix: Dictionary returns invalid data instead of throwing an exception if its enumerated without calling MoveNext first. Bugfix 452 - Reconsider the current default of __repr__ for .NET objects Bugfix 453 - Different behaviour with locale module (Cpython vs IronPython) Bugfix 519 - chr != System.Char Bugfix - Entering a comment line in the interactive console causes an exception Bugfix 355 - Consider routing console output via the SystemState Bugfix 567 - co_flags doesn't work with compile Bugfix 577 - import problem Bugfix 606 - Missing __hash__ on builtin types Bugfix 623 - Warnings when compiled w/ Mono Bugfix - Method Binder: pass None to methods asking for params array Bugfix 619 - Private explicit interface implementation methods can clober public methods when there are a lot of the explicit interface implementation methods Tutorial Update: Added a 7th Tutorial describing how to use Python standard library in IronPython Bugfix 605 - IronPython incorrectly allows assignment to readonly fields Bugfix - Assert when evaluating __init__, and __dict__ incorrectly resolves to __builtins__.__dict__ Bugfix - Inconsistency in attribute access checks (AttributeError vs TypeError, permitted vs disallowed) between CPython and IronPython Bugfix: isinstance doesn't use __class__ and __bases__ correctly Bugfix - expand method was not dealing with \g<> properly Bugfix - start and end methods were not returning the corrent index for 'None' group matches Bugfix - methods dealing with groups now throw an index error when a group cannot be found Bugfix 462 - Explicit interface properties are always getting long-names Bugfix 676 - implement datetime.datetime (test_datetime not yet enabled) Bugfix - 677 - set().add(None) returns set that NoneType Bugfix - globals() and locals caused StackOverflowException. Bugfix - Inconsistency in treating int and long as dictionary key from Cpython Python2.5 other language feature addition: str.partition/rpartition, str.startswith()/str.endswith() Bugfix - uncomment line 48 of sbs_simple_compare.py and make it pass Bugfix - MethodBinder: expect TypeError (not OverflowError) when pass Decimal.MinVaule to Int32 arg Bugfix - Method Binder: passing extensible int with negative number where UInt32 is asked Bugfix - Method Binder: how to treat Nullable as parameter type? same as int? Python 2.5 other language features : any/all FxCop cleanup on primary public API surface (IronPython.Hosting, IronPython.Compiler.*, IronPython.CodeDom, IronPython.Exceptions) Bugfix - Binding: Document and cleanup conversions / binding rules Bugfix - Method Binder: choose between ref int32 and (int32, defaultvalue/params array) decimal operator on BigInteger CodeGen emits calls to ConvertToXXX directly where available, rather than via ConvertToValueType Many of the ConvertToXXX are now generated (cases without fast paths and __xxx__ fallbacks) Enum conversion is gone TryConvertFromNull is gone (never used) ConvertToBigInteger generated TryConvertXXX marked internal, those not used are not generated and new comment says "do not use" The generated ConvertToXXX have the first "if" check for the target type. int() now takes decimal parameter, yielding int or long whichever fits Python 2.5 min/max feature updates Codeplex 789 - derived class iterator is not called Misc. tutorial improvements Bugfix: issues with list.__rmul__ Bugfix: 544 - Calling method's w/ arguments from C# Bugfix: 779 - Nested types aren't visble w/o importing clr Bugfix: 766 - CLR methods are visible on some builtin types even if clr module isn't imported Bugfix: 777 - Bad exception thrown when doing tuple-style assignment from None Bugfix: 794 - .ctors and __new__ should support __overloads__ Bugfix: 438 - os functions raise wrong exception types Bugfix: 774 - Cannot compare sets using cmp in IronPython Bugfix: 696 - -X:MTA yields ArgumentOutOfRangeException Conversion cleanup, SuperConsole removed from ipyw.exe Performance improvement: Changed Uninitialized to be a singleton class. In lined uninitialized checks for local variables. Names are passed by string to CheckInitializedOrBuiltin. GetBuiltinOrThrow is inlined into the body of CheckInitializedOrBuiltin. ModuleScope removed in favor of IDictionary EngineOptions and CompiledCode being added/moved to the IronPython.Hosting namespace Added new CompiledCode.Execute method PythonEngine.ExecuteFileOptimized has been broken up into PythonEngine.CreateOptimziedModule and OptimizedEngineModule.Execute Renamed __overloads__ to just Overloads Bugfix: clr.Reference shouldn't convert to boolean and should handle ValueTypes Disabling conversion to IEnumerator, enabling IEnumerable Many test coverage improvements for method binding Bugfix: 780 - Make Array Str & repr identical (both dispay repr) Bugfix: 810 - builtin function len thows wrong exception Bugfix: 811 - str.rfind can raise index errors Bugfix 813 - Builtin eval with dict subclass as locals does not work as in CPython 2.4: Bugfix 1103 - test_descr: Two more mro inconsistencies Method Binder: pass in clr.Reference(100) when overloads ask for "ref Int32" and "ref object" - clr.Reference replaced with clr.Reference[T] Confusing exception when constructing generic type incorrectly From joesox at gmail.com Thu Jul 13 01:27:14 2006 From: joesox at gmail.com (JoeSox) Date: Wed, 12 Jul 2006 16:27:14 -0700 Subject: [IronPython] SetGlobal and GetGlobal in IPbeta 9 Message-ID: <785694cd0607121627w3f5d0455o6021f0191e8204de@mail.gmail.com> Sorry, I am now confused. I don't understand how I need to update my implementation of PythonEngine.SetGlobal and GetGlobal I looked around in beta 9 and figured I probably figure it out faster by posting here. And I am also wondering if I am going to lose some scope. I have a bunch of C# methods that look like this: public static List get_analogous_concepts(string textnode) { try { cn_pe.SetStandardOutput(new ConceptNetUtils.IPEWrapper.IPEStreamWrapper(IPEWrapper.IPEStreamWrapper.IPEngineResponse)); IronPython.Runtime.SymbolId textnode_SymbolId = (SymbolId)"textnode"; cn_pe.SetGlobal(textnode_SymbolId, textnode); IronPython.Runtime.SymbolId r_SymbolId = (SymbolId)"r"; cn_pe.ExecuteToConsole("r={}"); cn_pe.ExecuteToConsole("r=c.get_analogous_concepts(textnode.encode('ascii','strict').strip())"); return (List)cn_pe.GetGlobal(r_SymbolId); } catch (Exception ex) { MessageBox.Show(ex.ToString(), ex.Message); //return ex.Message; return List.MakeEmptyList(4); } } Do I need to use cn_pe.DefaultModule.Globals now? And if so, how? Thanks -- Later, Joe From dinov at exchange.microsoft.com Thu Jul 13 01:29:34 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 12 Jul 2006 16:29:34 -0700 Subject: [IronPython] IronPython Console on Unix. In-Reply-To: <1152729014.12777.96.camel@erandi.cam.novell.com> References: <44B4BAB0.2070601@free.fr> <5b0248170607120652n32febcbdxb0225fca986fe221@mail.gmail.com> <44B5013C.2000000@free.fr> <1152729014.12777.96.camel@erandi.cam.novell.com> Message-ID: <7AD436E4270DD54A94238001769C222725D9E3A1F6@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Thanks for the bug report Miguel. I think the reason we're doing this today is because we're using Console.ReadKey which returns the raw key info instead of EOF when there's no input available. I've opened CodePlex bug 904 to track the issue (http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkItemId=904). Just to get your Unix input on this: Would us checking Environment.OSVersion.Platform and switch from Ctrl-Z to Ctrl-D for Unix sound ok to you? The reason I ask is we don't have Environment.EndOfFileDescriptor :). -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Miguel de Icaza Sent: Wednesday, July 12, 2006 11:30 AM To: Discussion of IronPython Subject: [IronPython] IronPython Console on Unix. Hello, Something in IronPython is now looking for Control-z, which is fine on Windows, but on Unix, Control-Z stands for "suspend application". In Unix, the end-of-file descriptor is control-d; Am not sure why the code is actually looking for a Control-Z, while it could be checking whether there is input available instead. miguel. _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From joesox at gmail.com Thu Jul 13 01:37:15 2006 From: joesox at gmail.com (JoeSox) Date: Wed, 12 Jul 2006 16:37:15 -0700 Subject: [IronPython] SetGlobal and GetGlobal in IPbeta 9 In-Reply-To: <785694cd0607121627w3f5d0455o6021f0191e8204de@mail.gmail.com> References: <785694cd0607121627w3f5d0455o6021f0191e8204de@mail.gmail.com> Message-ID: <785694cd0607121637xbbdd346q5e66edd926d49b7e@mail.gmail.com> Ok, I am looking over the release notes one more time, and it looks like I need to create a Dictionary to store all of the globals? Do I need to also create a EngineModule? This is why I am getting confused. Thanks On 7/12/06, JoeSox wrote: > Sorry, I am now confused. I don't understand how I need to update my > implementation of PythonEngine.SetGlobal and GetGlobal From Shri.Borde at microsoft.com Thu Jul 13 01:52:35 2006 From: Shri.Borde at microsoft.com (Shri Borde) Date: Wed, 12 Jul 2006 16:52:35 -0700 Subject: [IronPython] SetGlobal and GetGlobal in IPbeta 9 In-Reply-To: <785694cd0607121637xbbdd346q5e66edd926d49b7e@mail.gmail.com> Message-ID: <50B69702CA6E6D4E849D30CD4989AB8E20986BAD7C@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Hi Joe, The model for the hostig APIs is that a module (represented by EngineModule) is basically an IDictionary, just like in Python (for the most part). The user can create a IDictionary if she wants a customized implementation of a dictionary. This will allow the user to override reads and writes to the dictionary and implement logging, lazy lookup etc. For simple scenarios, the simpler overloads of PythonEngine.CreateModule create an Dictionary for you. We also removed the requirement of using SymbolIDs to simplify the API. Instead, we translate to SymbolIDs under the hood. All the properties of the DefaultModule are also exposed directly on the PythonEngine for ease of use. So your code can be adapted as such: public static List get_analogous_concepts(string textnode) { try { cn_pe.SetStandardOutput(new ConceptNetUtils.IPEWrapper.IPEStreamWrapper(IPEWrapper.IPEStreamWrapper.IPEngineResponse)); cn_pe.Global["textnode"] = textnode); cn_pe.ExecuteToConsole("r={}"); cn_pe.ExecuteToConsole("r=c.get_analogous_concepts(textnode.encode('ascii','strict').strip())"); return (List)cn_pe.Globals["r"]; } catch (Exception ex) { MessageBox.Show(ex.ToString(), ex.Message); //return ex.Message; return List.MakeEmptyList(4); } } Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of JoeSox Sent: Wednesday, July 12, 2006 4:37 PM To: Discussion of IronPython Subject: Re: [IronPython] SetGlobal and GetGlobal in IPbeta 9 Ok, I am looking over the release notes one more time, and it looks like I need to create a Dictionary to store all of the globals? Do I need to also create a EngineModule? This is why I am getting confused. Thanks On 7/12/06, JoeSox wrote: > Sorry, I am now confused. I don't understand how I need to update my > implementation of PythonEngine.SetGlobal and GetGlobal _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From joesox at gmail.com Thu Jul 13 02:09:53 2006 From: joesox at gmail.com (JoeSox) Date: Wed, 12 Jul 2006 17:09:53 -0700 Subject: [IronPython] SetGlobal and GetGlobal in IPbeta 9 In-Reply-To: <50B69702CA6E6D4E849D30CD4989AB8E20986BAD7C@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <785694cd0607121637xbbdd346q5e66edd926d49b7e@mail.gmail.com> <50B69702CA6E6D4E849D30CD4989AB8E20986BAD7C@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <785694cd0607121709s2e5eb03csfcffd0ef3b6c5285@mail.gmail.com> Ah, perfect! I didn't see the cn_pe.Globals IDictionary. Now I get it. Thanks --Joe On 7/12/06, Shri Borde wrote: > Hi Joe, > > The model for the hostig APIs is that a module (represented by EngineModule) is basically an IDictionary, just like in Python (for the most part). > > The user can create a IDictionary if she wants a customized implementation of a dictionary. This will allow the user to override reads and writes to the dictionary and implement logging, lazy lookup etc. For simple scenarios, the simpler overloads of PythonEngine.CreateModule create an Dictionary for you. > > We also removed the requirement of using SymbolIDs to simplify the API. Instead, we translate to SymbolIDs under the hood. > > All the properties of the DefaultModule are also exposed directly on the PythonEngine for ease of use. From joesox at gmail.com Thu Jul 13 03:18:45 2006 From: joesox at gmail.com (JoeSox) Date: Wed, 12 Jul 2006 18:18:45 -0700 Subject: [IronPython] Speed test In-Reply-To: <4039D552ADAB094BB1EA670F3E96214E03DBCDC88F@df-foxhound-msg.exchange.corp.microsoft.com> References: <785694cd0604191526u76be05aclc796996a4cc15229@mail.gmail.com> <4039D552ADAB094BB1EA670F3E96214E0285827E@df-foxhound-msg.exchange.corp.microsoft.com> <785694cd0604192227yd8831ceg2315cf4459c578da@mail.gmail.com> <785694cd0604201028r60484797r4622ea4cc506b8a@mail.gmail.com> <785694cd0606202121p540ad9k39d9dc6cc2038f86@mail.gmail.com> <4039D552ADAB094BB1EA670F3E96214E03DBCDC88F@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <785694cd0607121818r3be5d2cy5199e29e51d1c728@mail.gmail.com> Just fyi, here is my beta9 run of the speed test using the two files referenced below. The sum was 0.60 seconds, which is the second highest out of the tested beta4 thru beta9. Also, after fixing my project to work under beta9, it has also slowed down. With beta8 loading ConceptNet's default of 348,000 predicates into the semantic network took an average of 151 seconds. Beta9's (after two runs on my 2.2ghz AMD, 512 ram laptop) averaged about 191.223493 seconds. So that would be the only request from me, before 1.0 release, is to see some speed improvements that resembled beta5 and beta6's performance. But I understand the challenges in that and probably only a small amount of us developing IronPython projects have such a request. :) IronPython 1.0.60712 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import sys,time >>> sys.path.append('E:\\') >>> import CNUDB >>> cn=CNUDB.ConceptNetDB() >>> cn.test('E:\\machine_All.txt') ('-- test took', '0.38', 'seconds. --\n') >>> cn.test('E:\\machine_All.txt') ('-- test took', '0.06', 'seconds. --\n') >>> cn.test('E:\\machine_All.txt') ('-- test took', '0.05', 'seconds. --\n') >>> cn.test('E:\\machine_All.txt') ('-- test took', '0.05', 'seconds. --\n') >>> cn.test('E:\\machine_All.txt') ('-- test took', '0.06', 'seconds. --\n') >>> sum = .60 > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of JoeSox > Sent: Tuesday, June 20, 2006 9:21 PM > To: Discussion of IronPython > Subject: Re: [IronPython] Speed test > > Just for kicks and giggles (not sure if its helpful but it is interesting, at least to me) here is a speed test using beta4 thru beta8, I ran them one after the other and posted the results below. > But a short recap revealed that beta5 and 6 ran the fastest using IronPythonConsole.exe. I am not really sure why beta7 and 8 finished with slower times. > > beta4 sum = .82 > beta5 sum = .38 > beta6 sum = .38 > beta7 sum = .57 > beta8 sum = .43 > > IDLE 1.1.2 sum = .14 > Wing IDE 2.1 sum = .24 > > > >>On 4/19/06, Dino Viehland wrote: > >> > >>> I've opened a bug in our internal database to track the issue. > I'm not sure when we'll get to looking at it just yet as it may be somewhat of an involved investigation. But at least we won't forget about it. > >>> > >>> If you could give us something that was nice and self contained > then we might be able to get to it sooner. > >>> > >> > >> > >>Ok great. I think this will work. Here are the two files you will need: > >>http://joeswammi.com/projects/CNUDB.py > >>http://joeswammi.com/projects/machine_All.txt From sanxiyn at gmail.com Thu Jul 13 05:13:36 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Thu, 13 Jul 2006 12:13:36 +0900 Subject: [IronPython] IronPython 1.0 Beta 9 on Mono Message-ID: <5b0248170607122013v35a77d5eh636b9ab79c50915f@mail.gmail.com> A long-standing issue regarding source code encoding declaration was fixed recently. Mono bug #78714, revision 62079. There was a Mono bug preventing class definition to work on console, or in snippet mode. I wrongly reported it as an IronPython bug in March. This is finally fixed. Mono bug #78253, revision 62369. http://lists.ironpython.com/pipermail/users-ironpython.com/2006-March/001928.html Socket.SendTimeout and Socket.ReceiveTimeout used by IronPython socket module are now implemented. I mentioned these were not implemented in the last report. Mono revision 62157. http://lists.ironpython.com/pipermail/users-ironpython.com/2006-June/002634.html IronPython nt module now uses Marshal.GetHRForException method which is not yet implemented in Mono. I filed Mono bug #78839 for this and linked a patch that fixes the problem for me. After applying a patch for #78839, IronPython 1.0 Beta 9 works nicely with Mono.It passes my informal battery of tests which you can get here. I must automate running this... http://sparcs.kaist.ac.kr/~tinuviel/fepy/example/ Again, many thanks to hard-working Mono team, in addition to incredible IronPython team. Seo Sanghyeon From xmlhacker at gmail.com Thu Jul 13 05:37:29 2006 From: xmlhacker at gmail.com (M. David Peterson) Date: Wed, 12 Jul 2006 21:37:29 -0600 Subject: [IronPython] IronPython 1.0 Beta 9 on Mono In-Reply-To: <5b0248170607122013v35a77d5eh636b9ab79c50915f@mail.gmail.com> References: <5b0248170607122013v35a77d5eh636b9ab79c50915f@mail.gmail.com> Message-ID: Very cool! Thanks Seo > http://www.oreillynet.com/windows/blog/2006/07/building_ironpython_beta_9_on_1.html On 7/12/06, Sanghyeon Seo wrote: > > A long-standing issue regarding source code encoding declaration was > fixed recently. Mono bug #78714, revision 62079. > > There was a Mono bug preventing class definition to work on console, > or in snippet mode. I wrongly reported it as an IronPython bug in > March. This is finally fixed. Mono bug #78253, revision 62369. > > http://lists.ironpython.com/pipermail/users-ironpython.com/2006-March/001928.html > > Socket.SendTimeout and Socket.ReceiveTimeout used by IronPython socket > module are now implemented. I mentioned these were not implemented in > the last report. Mono revision 62157. > > http://lists.ironpython.com/pipermail/users-ironpython.com/2006-June/002634.html > > IronPython nt module now uses Marshal.GetHRForException method which > is not yet implemented in Mono. I filed Mono bug #78839 for this and > linked a patch that fixes the problem for me. > > After applying a patch for #78839, IronPython 1.0 Beta 9 works nicely > with Mono.It passes my informal battery of tests which you can get > here. I must automate running this... > http://sparcs.kaist.ac.kr/~tinuviel/fepy/example/ > > Again, many thanks to hard-working Mono team, in addition to > incredible IronPython team. > > Seo Sanghyeon > _______________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Thu Jul 13 05:49:18 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 12 Jul 2006 20:49:18 -0700 Subject: [IronPython] OsCon? Message-ID: <7AD436E4270DD54A94238001769C222725D9E3A327@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Is anyone out there on the mailing list going to OsCon? Maybe we could all meet up for lunch or dinner some day or night? I'll be arriving in Portland Tuesday night and am planning on leaving Friday night. There will be several other people from the team there as well, I'll let them speak for their schedules. I have no specific plans other than enjoying OsCon, and I've heard a restaurant called Hurley's is the best food in the world (though pricey), so I'm basically open. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sanxiyn at gmail.com Thu Jul 13 07:02:38 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Thu, 13 Jul 2006 14:02:38 +0900 Subject: [IronPython] RE_Match.start with named group Message-ID: <5b0248170607122202w54cbdbe4p5517f5852d3702e3@mail.gmail.com> # test.py import re match = re.match(r'(?Ptest)', 'test') print match.span('test') print match.start('test') print match.end('test') Only the second print raises. This is trivial to fix. At re.cs line 552: -public int Start(int group) { +public int Start(object group) { Seo Sanghyeon From sanxiyn at gmail.com Thu Jul 13 08:11:45 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Thu, 13 Jul 2006 15:11:45 +0900 Subject: [IronPython] unicodedata for IronPython Message-ID: <5b0248170607122311w6d2900a6o2b4ca6ac25511db9@mail.gmail.com> For my needs, I hastily wrapped System.Globalization.CharUnicodeInfo to implement unicodedata module. If you have similar needs, you may find it helpful. Currently implemented: decimal, digit, numeric, category. http://sparcs.kaist.ac.kr/~tinuviel/fepy/lib/unicodedata.py Seo Sanghyeon From sanxiyn at gmail.com Thu Jul 13 08:23:41 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Thu, 13 Jul 2006 15:23:41 +0900 Subject: [IronPython] IronPython 1.0 Beta 9 on Mono In-Reply-To: <5b0248170607122013v35a77d5eh636b9ab79c50915f@mail.gmail.com> References: <5b0248170607122013v35a77d5eh636b9ab79c50915f@mail.gmail.com> Message-ID: <5b0248170607122323h7bdf7b23p7765ba9e695b0147@mail.gmail.com> 2006/7/13, Sanghyeon Seo : > IronPython nt module now uses Marshal.GetHRForException method which > is not yet implemented in Mono. I filed Mono bug #78839 for this and > linked a patch that fixes the problem for me. Fixed in Mono revision 62550. That was fast. Seo Sanghyeon From sanxiyn at gmail.com Thu Jul 13 08:26:26 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Thu, 13 Jul 2006 15:26:26 +0900 Subject: [IronPython] "IronPython on Mono" report archive Message-ID: <5b0248170607122326r3da7fd7fhc59c08c50e4969db@mail.gmail.com> I created a simple webpage to link to my "IronPython on Mono" posts. http://sparcs.kaist.ac.kr/~tinuviel/fepy/doc/ironpython-mono-report.html Can't believe I have done this crazy job for 6 months now. :-) I reorganized my directory a little and renamed "howto" to "doc", so old SimpleHTTPServer howto is now found at: http://sparcs.kaist.ac.kr/~tinuviel/fepy/doc/simplehttpserver-ironpython-mono-howto.html That's all. Seo Sanghyeon From vagmi.mudumbai at gmail.com Thu Jul 13 08:30:01 2006 From: vagmi.mudumbai at gmail.com (Vagmi Mudumbai) Date: Thu, 13 Jul 2006 12:00:01 +0530 Subject: [IronPython] IronPython on Windows Mobile Message-ID: Hi All, I was wondering if it was possible to have IronPython running on Windows Mobile. I started compiling IronMath initially but I found that certain cases like CompilerGeneratedAttribute, Double.TryParse() were creating problems. Before I try to investigate into this further, I wanted to know if it is a practical idea to run IronPython on the Windows Mobile environment? I have seen Python on Nokia 60. I wanted to have this working so that we could have a light weight framework written in .NET which can support smaller applications written for companions using IronPython. Regards, Vagmi -- http://geekswithblogs.net/vagmi.mudumbai http://installneo.blogspot.com "Peace is its own reward." - Mahatma Gandhi -------------- next part -------------- An HTML attachment was scrubbed... URL: From korpse-ironpython at kaydash.za.net Thu Jul 13 09:34:18 2006 From: korpse-ironpython at kaydash.za.net (Jonathan Jacobs) Date: Thu, 13 Jul 2006 09:34:18 +0200 Subject: [IronPython] repr...huh? Message-ID: <44B5F77A.80105@kaydash.za.net> >>> v = Vector3(1, 2, 3) >>> v ...]>osoft.DirectX.Vector3 object at 0x000000000000002C [Z : 3 Huh? -- Jonathan From raathm at gmail.com Thu Jul 13 10:41:07 2006 From: raathm at gmail.com (Mike Raath) Date: Thu, 13 Jul 2006 10:41:07 +0200 Subject: [IronPython] Unable to cast object of type 'IronPython.Runtime.Types.OldClass' to type 'IronPython.Runtime.Types.DynamicType' Message-ID: <664260580607130141m2927c549kebb5ba224e5d64bc@mail.gmail.com> Hi Having tried to switch over to beta 9, and changing my generic Evaluate references to EvaluateAs, I get a runtime error on an import statement which works under beta 8. The exception is as is detailed in the message above, and is from a statement like engine.Execute("from Module import Class); The Module and Class definitions are custom - and as i say this statement works under beta 8. Do you require more information or do I need to make a further change to my code to get it to work? Thanks, Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From giles.thomas at resolversystems.com Thu Jul 13 12:55:48 2006 From: giles.thomas at resolversystems.com (Giles Thomas) Date: Thu, 13 Jul 2006 11:55:48 +0100 Subject: [IronPython] Beta 9 __getitem__ Message-ID: <44B626B4.1070001@resolversystems.com> Hi, We've found what looks like a difference between IronPython and CPython's parsing of argument lists for square brackets. This is a change from Beta 8, which behaved in the same way as CPython. CPython: Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> class GetItemTest(object): ... def __getitem__(self, key): ... return key ... >>> m = GetItemTest() >>> print m[8,6] (8, 6) >>> IronPython: IronPython 1.0.2385 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> class GetItemTest(object): ... def __getitem__(self, key): ... return key ... >>> m = GetItemTest() >>> print m[8,6] Traceback (most recent call last): File , line 0, in ##16 TypeError: __getitem__() takes exactly 2 arguments (3 given) >>> Regards, Giles -- Giles Thomas Resolver Systems giles.thomas at resolversystems.com From Martin.Maly at microsoft.com Thu Jul 13 17:08:49 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Thu, 13 Jul 2006 08:08:49 -0700 Subject: [IronPython] Unable to cast object of type 'IronPython.Runtime.Types.OldClass' to type 'IronPython.Runtime.Types.DynamicType' In-Reply-To: <664260580607130141m2927c549kebb5ba224e5d64bc@mail.gmail.com> Message-ID: To help you, we will need more information about your use of the Python Engine. The simple case of executing "from Module import Class" does work so we need to know more to find out what the problem may be. Thanks Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Mike Raath Sent: Thursday, July 13, 2006 1:41 AM To: Discussion of IronPython Subject: [IronPython] Unable to cast object of type 'IronPython.Runtime.Types.OldClass' to type 'IronPython.Runtime.Types.DynamicType' Hi Having tried to switch over to beta 9, and changing my generic Evaluate references to EvaluateAs, I get a runtime error on an import statement which works under beta 8. The exception is as is detailed in the message above, and is from a statement like engine.Execute("from Module import Class); The Module and Class definitions are custom - and as i say this statement works under beta 8. Do you require more information or do I need to make a further change to my code to get it to work? Thanks, Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Maly at microsoft.com Thu Jul 13 17:10:50 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Thu, 13 Jul 2006 08:10:50 -0700 Subject: [IronPython] IronPython on Windows Mobile In-Reply-To: Message-ID: As of now, there are few features unavailable on Windows Mobile / .Net Compact Framework which prevent IronPython from running. Aside from Double.TryParse and similar cases, the most significant is absence of the Reflection.Emit, the mechanism IronPython uses for its code generation. Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Vagmi Mudumbai Sent: Wednesday, July 12, 2006 11:30 PM To: Discussion of IronPython Subject: [IronPython] IronPython on Windows Mobile Hi All, I was wondering if it was possible to have IronPython running on Windows Mobile. I started compiling IronMath initially but I found that certain cases like CompilerGeneratedAttribute, Double.TryParse() were creating problems. Before I try to investigate into this further, I wanted to know if it is a practical idea to run IronPython on the Windows Mobile environment? I have seen Python on Nokia 60. I wanted to have this working so that we could have a light weight framework written in .NET which can support smaller applications written for companions using IronPython. Regards, Vagmi -- http://geekswithblogs.net/vagmi.mudumbai http://installneo.blogspot.com "Peace is its own reward." - Mahatma Gandhi -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Maly at microsoft.com Thu Jul 13 17:18:52 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Thu, 13 Jul 2006 08:18:52 -0700 Subject: [IronPython] Unable to cast object of type 'IronPython.Runtime.Types.OldClass' to type 'IronPython.Runtime.Types.DynamicType' In-Reply-To: Message-ID: However, that said, in Beta 9, the OldClass is no longer a DynamicType, which explains the exception itself. To find out what you need to change in your code is something that we'll need more info for. For example, the exception can come from anywhere in the Module body (during import, the module body gets executed - unless the module has been already imported). Since I don't get exception when executing "from Module import Class", I suspect that this is what may be the case. The call stack for the exception could help find out what line in your module code is throwing. M. ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Martin Maly Sent: Thursday, July 13, 2006 8:09 AM To: Discussion of IronPython Subject: Re: [IronPython] Unable to cast object of type 'IronPython.Runtime.Types.OldClass' to type 'IronPython.Runtime.Types.DynamicType' To help you, we will need more information about your use of the Python Engine. The simple case of executing "from Module import Class" does work so we need to know more to find out what the problem may be. Thanks Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Mike Raath Sent: Thursday, July 13, 2006 1:41 AM To: Discussion of IronPython Subject: [IronPython] Unable to cast object of type 'IronPython.Runtime.Types.OldClass' to type 'IronPython.Runtime.Types.DynamicType' Hi Having tried to switch over to beta 9, and changing my generic Evaluate references to EvaluateAs, I get a runtime error on an import statement which works under beta 8. The exception is as is detailed in the message above, and is from a statement like engine.Execute("from Module import Class); The Module and Class definitions are custom - and as i say this statement works under beta 8. Do you require more information or do I need to make a further change to my code to get it to work? Thanks, Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From brian at sweetapp.com Thu Jul 13 17:37:50 2006 From: brian at sweetapp.com (Brian Quinlan) Date: Thu, 13 Jul 2006 17:37:50 +0200 Subject: [IronPython] OsCon? In-Reply-To: <7AD436E4270DD54A94238001769C222725D9E3A327@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <7AD436E4270DD54A94238001769C222725D9E3A327@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <44B668CE.3070906@sweetapp.com> Dino Viehland wrote: > Is anyone out there on the mailing list going to OsCon? Maybe we could > all meet up for lunch or dinner some day or night? I think that could be fun. Coordinating with everyone on a mailing list is going to hard though. So why don't you try to coordinate internally and then announce the details? Cheers, Brian From dinov at exchange.microsoft.com Thu Jul 13 17:46:19 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Thu, 13 Jul 2006 08:46:19 -0700 Subject: [IronPython] repr...huh? In-Reply-To: <44B5F77A.80105@kaydash.za.net> References: <44B5F77A.80105@kaydash.za.net> Message-ID: <7AD436E4270DD54A94238001769C222725DB9E85AD@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Ahh, I bet your your ToString includes \r\n and we just split on \n (leaving the \r in there by it's self). I'll get this one fixed. ________________________________________ From: users-bounces at lists.ironpython.com On Behalf Of Jonathan Jacobs Sent: Thursday, July 13, 2006 12:34 AM To: IronPython List Subject: [IronPython] repr...huh? >>> v = Vector3(1, 2, 3) >>> v ...]>osoft.DirectX.Vector3 object at 0x000000000000002C [Z : 3 Huh? -- Jonathan _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Thu Jul 13 17:46:19 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Thu, 13 Jul 2006 08:46:19 -0700 Subject: [IronPython] repr...huh? In-Reply-To: <44B5F77A.80105@kaydash.za.net> References: <44B5F77A.80105@kaydash.za.net> Message-ID: <7AD436E4270DD54A94238001769C222725DB9E85AD@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Ahh, I bet your your ToString includes \r\n and we just split on \n (leaving the \r in there by it's self). I'll get this one fixed. ________________________________________ From: users-bounces at lists.ironpython.com On Behalf Of Jonathan Jacobs Sent: Thursday, July 13, 2006 12:34 AM To: IronPython List Subject: [IronPython] repr...huh? >>> v = Vector3(1, 2, 3) >>> v ...]>osoft.DirectX.Vector3 object at 0x000000000000002C [Z : 3 Huh? -- Jonathan _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Thu Jul 13 18:00:19 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Thu, 13 Jul 2006 09:00:19 -0700 Subject: [IronPython] Beta 9 __getitem__ In-Reply-To: <44B626B4.1070001@resolversystems.com> References: <44B626B4.1070001@resolversystems.com> Message-ID: <7AD436E4270DD54A94238001769C222725DB9E85AE@DF-GRTDANE-MSG.exchange.corp.microsoft.com> I've opened CodePlex bug 922 for this one - this looks like it's related to some of the type changes or the method dispatch changes, but I'm not quite certain what broke it. ________________________________________ From: users-bounces at lists.ironpython.com On Behalf Of Giles Thomas Sent: Thursday, July 13, 2006 3:55 AM To: Discussion of IronPython Subject: [IronPython] Beta 9 __getitem__ Hi, We've found what looks like a difference between IronPython and CPython's parsing of argument lists for square brackets. This is a change from Beta 8, which behaved in the same way as CPython. CPython: Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> class GetItemTest(object): ... def __getitem__(self, key): ... return key ... >>> m = GetItemTest() >>> print m[8,6] (8, 6) >>> IronPython: IronPython 1.0.2385 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> class GetItemTest(object): ... def __getitem__(self, key): ... return key ... >>> m = GetItemTest() >>> print m[8,6] Traceback (most recent call last): File , line 0, in ##16 TypeError: __getitem__() takes exactly 2 arguments (3 given) >>> Regards, Giles -- Giles Thomas Resolver Systems giles.thomas at resolversystems.com _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From jvm_cop at spamcop.net Thu Jul 13 19:14:32 2006 From: jvm_cop at spamcop.net (J. Merrill) Date: Thu, 13 Jul 2006 13:14:32 -0400 Subject: [IronPython] IronPython 1.0 Beta 9 on Mono In-Reply-To: <5b0248170607122013v35a77d5eh636b9ab79c50915f@mail.gmail.co m> References: <5b0248170607122013v35a77d5eh636b9ab79c50915f@mail.gmail.com> Message-ID: <7.0.1.0.2.20060713131309.04499758@wheresmymailserver.com> FYI, some of us who are watching are ready to nominate you as an honorary member of that I IP T. Thanks for all you do on this! At 11:13 PM 7/12/2006, Sanghyeon Seo wrote (in part) >Again, many thanks to hard-working Mono team, in addition to >incredible IronPython team. > >Seo Sanghyeon J. Merrill / Analytical Software Corp From jvm_cop at spamcop.net Thu Jul 13 19:22:25 2006 From: jvm_cop at spamcop.net (J. Merrill) Date: Thu, 13 Jul 2006 13:22:25 -0400 Subject: [IronPython] Getting a call stack from an exception? References: <018901c6a5f2$f5a110c0$6701a8c0@tokai> <529C8DA84B5B364FB86BB4DC8707508B018F70BB@RED-MSG-80.redmond.corp.microsoft.com> Message-ID: <7.0.1.0.2.20060713131654.0449b5e0@wheresmymailserver.com> Could someone explain to this interested observer what is missing when the standard Python traceback functionality is used? Writing IronPython-specific code that isn't specifically involved in interacting with .Net seems against the "you can run the same Python code anywhere" notion that I expect to see. Or did you mean "using the IronPython Engine" (aka "in pure C# code") when you said "in pure IP"? The sample code, after all, was Python and not calls to the IronPython Engine.... At 04:46 PM 7/12/2006, Dino Viehland wrote >It shouldn?t be too hard to just get the line numbers & filenames ? the nice thing that the standard traceback.py file gives you is it can get the lines of source code and include it in the displayed call stack as well. > >From: Lee Culver >Sent: Wednesday, July 12, 2006 1:39 PM >To: Discussion of IronPython >Subject: Re: [IronPython] Getting a call stack from an exception? > >I?m probably going to just reimplement the functionality in pure IP. If I get anywhere with it I?ll post it up here. > > >---------- >From: Alex Henderson >Sent: Wednesday, July 12, 2006 1:37 PM >To: 'Discussion of IronPython' >Subject: Re: [IronPython] Getting a call stack from an exception? > >I would be interested to know how you get on with this problem Lee - I?ve got the same issue myself. > >Chez, > > - Alex > > >---------- >From: Lee Culver >Sent: Thursday, 13 July 2006 6:57 a.m. >To: Discussion of IronPython >Subject: Re: [IronPython] Getting a call stack from an exception? > >Yikes. I was hoping for a way to do it in pure IronPython. Thanks though. > > >---------- >From: Dino Viehland >Sent: Wednesday, July 12, 2006 11:54 AM >To: Discussion of IronPython >Subject: Re: [IronPython] Getting a call stack from an exception? > >Tracebacks are the correct way to do this, I recommend you install the standard Python library against IronPython to make this really useful ? then you can do import traceback and use its handy functions (otherwise you?ll be walking the traceback list in sys.exc_info() which won?t be much fun). > >From: Lee Culver >Sent: Wednesday, July 12, 2006 11:49 AM >To: Discussion of IronPython >Subject: [IronPython] Getting a call stack from an exception? > >I would like to print out a call stack from an exception object, much like what the IronPython console does when an exception goes uncaught. I have tried doing something like this: > >try: > #something that causes an exception >except Exception, e: > print e > >But, like python, this only prints out the message given to it. I have also tried this: > print e.clsException > print e.clsException.StackTrace > >But these print out the stack trace which includes the IronPython library c# code as well. Is there a way to get the stack trace which only contains the python call stack (like the one the console uses)? > >Thanks >-Lee J. Merrill / Analytical Software Corp -------------- next part -------------- An HTML attachment was scrubbed... URL: From t-clacul at microsoft.com Thu Jul 13 19:48:30 2006 From: t-clacul at microsoft.com (Lee Culver) Date: Thu, 13 Jul 2006 10:48:30 -0700 Subject: [IronPython] Getting a call stack from an exception? In-Reply-To: <7.0.1.0.2.20060713131654.0449b5e0@wheresmymailserver.com> Message-ID: <529C8DA84B5B364FB86BB4DC8707508B018F769B@RED-MSG-80.redmond.corp.microsoft.com> Ah yeah, my roommate asked me the same question. There's absolutely no reason that I shouldn't be using the Python traceback library (and you should use it too). I'm working on a tutorial for IronPython which I would like to run "out of the box" (that is, not have the end user install CPython as a dependency of the tutorial). This is the only reason I was looking for a "pure" IronPython solution. -Lee ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of J. Merrill Sent: Thursday, July 13, 2006 10:22 AM To: Discussion of IronPython Subject: Re: [IronPython] Getting a call stack from an exception? Could someone explain to this interested observer what is missing when the standard Python traceback functionality is used? Writing IronPython-specific code that isn't specifically involved in interacting with .Net seems against the "you can run the same Python code anywhere" notion that I expect to see. Or did you mean "using the IronPython Engine" (aka "in pure C# code") when you said "in pure IP"? The sample code, after all, was Python and not calls to the IronPython Engine.... At 04:46 PM 7/12/2006, Dino Viehland wrote It shouldn't be too hard to just get the line numbers & filenames - the nice thing that the standard traceback.py file gives you is it can get the lines of source code and include it in the displayed call stack as well. From: Lee Culver Sent: Wednesday, July 12, 2006 1:39 PM To: Discussion of IronPython Subject: Re: [IronPython] Getting a call stack from an exception? I'm probably going to just reimplement the functionality in pure IP. If I get anywhere with it I'll post it up here. ________________________________ From: Alex Henderson Sent: Wednesday, July 12, 2006 1:37 PM To: 'Discussion of IronPython' Subject: Re: [IronPython] Getting a call stack from an exception? I would be interested to know how you get on with this problem Lee - I've got the same issue myself. Chez, - Alex ________________________________ From: Lee Culver Sent: Thursday, 13 July 2006 6:57 a.m. To: Discussion of IronPython Subject: Re: [IronPython] Getting a call stack from an exception? Yikes. I was hoping for a way to do it in pure IronPython. Thanks though. ________________________________ From: Dino Viehland Sent: Wednesday, July 12, 2006 11:54 AM To: Discussion of IronPython Subject: Re: [IronPython] Getting a call stack from an exception? Tracebacks are the correct way to do this, I recommend you install the standard Python library against IronPython to make this really useful - then you can do import traceback and use its handy functions (otherwise you'll be walking the traceback list in sys.exc_info() which won't be much fun). From: Lee Culver Sent: Wednesday, July 12, 2006 11:49 AM To: Discussion of IronPython Subject: [IronPython] Getting a call stack from an exception? I would like to print out a call stack from an exception object, much like what the IronPython console does when an exception goes uncaught. I have tried doing something like this: try: ... #something that causes an exception except Exception, e: print e But, like python, this only prints out the message given to it. I have also tried this: print e.clsException print e.clsException.StackTrace But these print out the stack trace which includes the IronPython library c# code as well. Is there a way to get the stack trace which only contains the python call stack (like the one the console uses)? Thanks -Lee J. Merrill / Analytical Software Corp -------------- next part -------------- An HTML attachment was scrubbed... URL: From Seth_Milman at bose.com Thu Jul 13 22:30:42 2006 From: Seth_Milman at bose.com (Milman, Seth ) Date: Thu, 13 Jul 2006 16:30:42 -0400 Subject: [IronPython] Multidimensional array performance on IP Beta 9 Message-ID: I've noticed a rather large degradation in speed when accessing elements in multidimensional arrays in the new beta 9. Is this performance expected? I've pasted a script below that demonstrates the issue. Beta 8 output from the script: 1 dimensional copy: 0.4303053 seconds 2 dimensional copy: 1.1508165 seconds Beta 9 output from the script: 1 dimensional copy: 0.4603266 seconds 2 dimensional copy: 7.5953889 seconds Beta 9 takes 6.6 times longer to access all the elements in the 2d array. Is this change expected? -Seth # ############################################### import System from System import * arraySize = 50000 a1 = Array.CreateInstance( Double, arraySize ) a2 = Array.CreateInstance( Double, arraySize ) a3 = Array.CreateInstance( Double, 2, arraySize ) ticks1 = DateTime.Now.Ticks for j in range(2): for i in range(len(a1)): a2[i] = a1[i] ticks2 = DateTime.Now.Ticks for j in range(2): for i in range(len(a1)): a3[j,i] = a1[i] ticks3 = DateTime.Now.Ticks time1 = TimeSpan( ticks2 - ticks1 ) time2 = TimeSpan( ticks3 - ticks2 ) print print '1 dimensional copy: ' + str(time1.TotalSeconds) + ' seconds' print '2 dimensional copy: ' + str(time2.TotalSeconds) + ' seconds' print # ############################################################### -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Thu Jul 13 23:02:16 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Thu, 13 Jul 2006 14:02:16 -0700 Subject: [IronPython] Multidimensional array performance on IP Beta 9 In-Reply-To: References: Message-ID: <7AD436E4270DD54A94238001769C222725DD542A1A@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Definitely not expected, I've opened CodePlex bug 930 to track it (http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkItemId=930). Thanks for reporting this. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Milman, Seth Sent: Thursday, July 13, 2006 1:31 PM To: Discussion of IronPython Subject: [IronPython] Multidimensional array performance on IP Beta 9 I've noticed a rather large degradation in speed when accessing elements in multidimensional arrays in the new beta 9. Is this performance expected? I've pasted a script below that demonstrates the issue. Beta 8 output from the script: 1 dimensional copy: 0.4303053 seconds 2 dimensional copy: 1.1508165 seconds Beta 9 output from the script: 1 dimensional copy: 0.4603266 seconds 2 dimensional copy: 7.5953889 seconds Beta 9 takes 6.6 times longer to access all the elements in the 2d array. Is this change expected? -Seth # ############################################### import System from System import * arraySize = 50000 a1 = Array.CreateInstance( Double, arraySize ) a2 = Array.CreateInstance( Double, arraySize ) a3 = Array.CreateInstance( Double, 2, arraySize ) ticks1 = DateTime.Now.Ticks for j in range(2): for i in range(len(a1)): a2[i] = a1[i] ticks2 = DateTime.Now.Ticks for j in range(2): for i in range(len(a1)): a3[j,i] = a1[i] ticks3 = DateTime.Now.Ticks time1 = TimeSpan( ticks2 - ticks1 ) time2 = TimeSpan( ticks3 - ticks2 ) print print '1 dimensional copy: ' + str(time1.TotalSeconds) + ' seconds' print '2 dimensional copy: ' + str(time2.TotalSeconds) + ' seconds' print # ############################################################### -------------- next part -------------- An HTML attachment was scrubbed... URL: From jorgen.stenarson at bostream.nu Fri Jul 14 00:17:10 2006 From: jorgen.stenarson at bostream.nu (=?ISO-8859-1?Q?J=F6rgen_Stenarson?=) Date: Fri, 14 Jul 2006 00:17:10 +0200 Subject: [IronPython] Bug in beta9? Message-ID: <44B6C666.1010906@bostream.nu> Hi I have hit a change in the behaviour that results in an exception. Is this behaviour expected? My workaround for now is to change chr to str. /J?rgen file(tipy.py) used in test: import System readkey=System.Console.ReadKey print "Press a key" a=readkey(True) print chr(a.KeyChar) Test with beta8: >c:\IronPython-1.0-Beta8\IronPythonConsole.exe tipy.py Press a key d Test with beta9: >c:\IronPython-1.0-Beta9\ipy -i tipy.py Press a key Traceback (most recent call last): File C:\python\pyreadline_branch\pyreadline\console\tipy.py, line 8, in Initialize File , line 0, in Chr##75 TypeError: Cannot convert Char(d) to Int32 From dinov at exchange.microsoft.com Fri Jul 14 01:47:21 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Thu, 13 Jul 2006 16:47:21 -0700 Subject: [IronPython] Bug in beta9? In-Reply-To: <44B6C666.1010906@bostream.nu> References: <44B6C666.1010906@bostream.nu> Message-ID: <7AD436E4270DD54A94238001769C222725DD542B5F@DF-GRTDANE-MSG.exchange.corp.microsoft.com> I think this is probably due to some changes w/ method dispatch (we'll no longer convert from char to int?). I'll have to ask around to see if that's part of the design or not. As a work around you can do: chr(ord(a.KeyChar)) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of J?rgen Stenarson Sent: Thursday, July 13, 2006 3:17 PM To: Discussion of IronPython Subject: [IronPython] Bug in beta9? Hi I have hit a change in the behaviour that results in an exception. Is this behaviour expected? My workaround for now is to change chr to str. /J?rgen file(tipy.py) used in test: import System readkey=System.Console.ReadKey print "Press a key" a=readkey(True) print chr(a.KeyChar) Test with beta8: >c:\IronPython-1.0-Beta8\IronPythonConsole.exe tipy.py Press a key d Test with beta9: >c:\IronPython-1.0-Beta9\ipy -i tipy.py Press a key Traceback (most recent call last): File C:\python\pyreadline_branch\pyreadline\console\tipy.py, line 8, in Initialize File , line 0, in Chr##75 TypeError: Cannot convert Char(d) to Int32 _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From sanxiyn at gmail.com Fri Jul 14 04:28:10 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Fri, 14 Jul 2006 11:28:10 +0900 Subject: [IronPython] Bug in beta9? In-Reply-To: <7AD436E4270DD54A94238001769C222725DD542B5F@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <44B6C666.1010906@bostream.nu> <7AD436E4270DD54A94238001769C222725DD542B5F@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <5b0248170607131928h7fd6460bvcb9292f07dfd549c@mail.gmail.com> 2006/7/14, Dino Viehland : > As a work around you can do: > chr(ord(a.KeyChar)) Actually, you can simply, print a.KeyChar in Beta 9. Seo Sanghyeon From sanxiyn at gmail.com Fri Jul 14 04:48:38 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Fri, 14 Jul 2006 11:48:38 +0900 Subject: [IronPython] Freshmeat In-Reply-To: <5b0248170606171138u5b4dab1ei9149ff5c521c8be6@mail.gmail.com> References: <5b0248170606171138u5b4dab1ei9149ff5c521c8be6@mail.gmail.com> Message-ID: <5b0248170607131948m68404e14k4383f7604ddf266d@mail.gmail.com> I now added IronPython 1.0 Beta 9 release to the default branch on Freshmeat, and it is now visible on the Freshmeat front page. I plan to continue to update Freshmeat. Seo Sanghyeon 2006/6/18, Sanghyeon Seo : > I updated Freshmeat entry for IronPython to point to CodePlex now. > http://freshmeat.net/projects/ironpython From t-clacul at microsoft.com Fri Jul 14 05:17:15 2006 From: t-clacul at microsoft.com (Lee Culver) Date: Thu, 13 Jul 2006 20:17:15 -0700 Subject: [IronPython] Regression with Beta9? Message-ID: <529C8DA84B5B364FB86BB4DC8707508B018F7BA5@RED-MSG-80.redmond.corp.microsoft.com> This seems to not work anymore: >>> import clr >>> HasAttr Traceback (most recent call last): File , line 0, in ##9 NameError: name 'HasAttr' not defined Whereas under Beta8 it worked fine... Is this intentional? If so, this seems a bit weird that it's still in __builtins__: >>> __builtins__.HasAttr Thanks -Lee -------------- next part -------------- An HTML attachment was scrubbed... URL: From t-clacul at microsoft.com Fri Jul 14 05:34:56 2006 From: t-clacul at microsoft.com (Lee Culver) Date: Thu, 13 Jul 2006 20:34:56 -0700 Subject: [IronPython] Regression with Beta9? In-Reply-To: <529C8DA84B5B364FB86BB4DC8707508B018F7BA5@RED-MSG-80.redmond.corp.microsoft.com> Message-ID: <529C8DA84B5B364FB86BB4DC8707508B018F7BB7@RED-MSG-80.redmond.corp.microsoft.com> And another one... IronPython 1.0.60712 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import clr >>> >>> clr.AddReferenceByPartialName("Microsoft.DirectX") >>> from Microsoft import DirectX >>> v = DirectX.Vector3(1, 2, 3) >>> v * 2 ...]>osoft.DirectX.Vector3 object at 0x000000000000002C [Z : 6 >>> v * 2.2 Traceback (most recent call last): File , line 0, in ##30 TypeError: unsupported operand type(s) for *: 'Vector3' and 'float' Whereas this worked fine in IronPython8 (and indeed the DirectX.Vector3 class supports a multiplication with floats): IronPython 1.0.2376 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import clr >>> clr.AddReferenceByPartialName("Microsoft.DirectX") >>> v = DirectX.Vector3(1, 2, 3) Traceback (most recent call last): File , line 0, in ##13 NameError: name 'DirectX' not defined >>> from Microsoft import DirectX >>> v = DirectX.Vector3(1, 2, 3) >>> v * 2 Z : 6 Y : 4 X : 2 >>> v * 2.2 Z : 6.6 Y : 4.4 X : 2.2 I think the ToString issue has already been reported... Thanks -Lee ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Lee Culver Sent: Thursday, July 13, 2006 8:17 PM To: Discussion of IronPython Subject: [IronPython] Regression with Beta9? This seems to not work anymore: >>> import clr >>> HasAttr Traceback (most recent call last): File , line 0, in ##9 NameError: name 'HasAttr' not defined Whereas under Beta8 it worked fine... Is this intentional? If so, this seems a bit weird that it's still in __builtins__: >>> __builtins__.HasAttr Thanks -Lee -------------- next part -------------- An HTML attachment was scrubbed... URL: From sanxiyn at gmail.com Fri Jul 14 05:59:27 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Fri, 14 Jul 2006 12:59:27 +0900 Subject: [IronPython] Away from network Message-ID: <5b0248170607132059x4728aaa5m119570bca82010d5@mail.gmail.com> I will have no network access from July 20 to August 17. So don't be curious if I am quiet. Pity, I think I will miss the 1.0 release. Be well, Seo Sanghyeon From Martin.Maly at microsoft.com Fri Jul 14 06:41:45 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Thu, 13 Jul 2006 21:41:45 -0700 Subject: [IronPython] Bug in beta9? In-Reply-To: <7AD436E4270DD54A94238001769C222725DD542B5F@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: Dino is absolutely right. In our new conversion rules, there is no implicit conversion between integer types (both standard Python types - int and bigint, and CLR integer types - byte, sbyte, short, ushort, long, ulong, uint, decimal) and char. Char is in Python pretty much interchangeable with one-character string and we tried to find the right balance for conversions that are implicit and those which require explicit 'cast'. Consider for example CPython's: >>> range('a') Traceback (most recent call last): File "", line 1, in ? TypeError: range() integer end argument expected, got str. You can still do int("1") or int(Char.Parse('a')), both explicit conversions. Hope this helps. Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Thursday, July 13, 2006 4:47 PM To: Discussion of IronPython Subject: Re: [IronPython] Bug in beta9? I think this is probably due to some changes w/ method dispatch (we'll no longer convert from char to int?). I'll have to ask around to see if that's part of the design or not. As a work around you can do: chr(ord(a.KeyChar)) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of J?rgen Stenarson Sent: Thursday, July 13, 2006 3:17 PM To: Discussion of IronPython Subject: [IronPython] Bug in beta9? Hi I have hit a change in the behaviour that results in an exception. Is this behaviour expected? My workaround for now is to change chr to str. /J?rgen file(tipy.py) used in test: import System readkey=System.Console.ReadKey print "Press a key" a=readkey(True) print chr(a.KeyChar) Test with beta8: >c:\IronPython-1.0-Beta8\IronPythonConsole.exe tipy.py Press a key d Test with beta9: >c:\IronPython-1.0-Beta9\ipy -i tipy.py Press a key Traceback (most recent call last): File C:\python\pyreadline_branch\pyreadline\console\tipy.py, line 8, in Initialize File , line 0, in Chr##75 TypeError: Cannot convert Char(d) to Int32 _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Martin.Maly at microsoft.com Fri Jul 14 06:49:35 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Thu, 13 Jul 2006 21:49:35 -0700 Subject: [IronPython] Regression with Beta9? In-Reply-To: <529C8DA84B5B364FB86BB4DC8707508B018F7BB7@RED-MSG-80.redmond.corp.microsoft.com> Message-ID: Yep, we have entered the ToString issue, but your operator issue is a new one. I've filed it in CodePlex as work item 939 Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Lee Culver Sent: Thursday, July 13, 2006 8:35 PM To: Discussion of IronPython Subject: Re: [IronPython] Regression with Beta9? And another one... IronPython 1.0.60712 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import clr >>> >>> clr.AddReferenceByPartialName("Microsoft.DirectX") >>> from Microsoft import DirectX >>> v = DirectX.Vector3(1, 2, 3) >>> v * 2 ...]>osoft.DirectX.Vector3 object at 0x000000000000002C [Z : 6 >>> v * 2.2 Traceback (most recent call last): File , line 0, in ##30 TypeError: unsupported operand type(s) for *: 'Vector3' and 'float' Whereas this worked fine in IronPython8 (and indeed the DirectX.Vector3 class supports a multiplication with floats): IronPython 1.0.2376 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import clr >>> clr.AddReferenceByPartialName("Microsoft.DirectX") >>> v = DirectX.Vector3(1, 2, 3) Traceback (most recent call last): File , line 0, in ##13 NameError: name 'DirectX' not defined >>> from Microsoft import DirectX >>> v = DirectX.Vector3(1, 2, 3) >>> v * 2 Z : 6 Y : 4 X : 2 >>> v * 2.2 Z : 6.6 Y : 4.4 X : 2.2 I think the ToString issue has already been reported... Thanks -Lee ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Lee Culver Sent: Thursday, July 13, 2006 8:17 PM To: Discussion of IronPython Subject: [IronPython] Regression with Beta9? This seems to not work anymore: >>> import clr >>> HasAttr Traceback (most recent call last): File , line 0, in ##9 NameError: name 'HasAttr' not defined Whereas under Beta8 it worked fine... Is this intentional? If so, this seems a bit weird that it's still in __builtins__: >>> __builtins__.HasAttr Thanks -Lee -------------- next part -------------- An HTML attachment was scrubbed... URL: From raathm at gmail.com Fri Jul 14 09:17:38 2006 From: raathm at gmail.com (Mike Raath) Date: Fri, 14 Jul 2006 09:17:38 +0200 Subject: [IronPython] Unable to cast object of type 'IronPython.Runtime.Types.OldClass' to type 'IronPython.Runtime.Types.DynamicType' In-Reply-To: References: Message-ID: <664260580607140017x59f843fr49783b247972cac@mail.gmail.com> OK - I've broken it down to its simplest form. It looks like there's a problem importing the minidom class. If you create a module TestModule.py containing the following code: Python Code ========== import xml.dom.minidom class TestClass: pass and then try to import this class you will see this error. My C# code is as follows: ==================== PythonEngine engine = new PythonEngine(); engine.AddToPath("C:\\Python24\\lib"); engine.AddToPath ("C:\\Temp\\IronPythonTest\\IronPythonTest\\Python\\"); engine.Execute("from TestModule import TestClass"); Mike On 7/13/06, Martin Maly wrote: > > However, that said, in Beta 9, the OldClass is no longer a DynamicType, > which explains the exception itself. To find out what you need to change in > your code is something that we'll need more info for. > > > > For example, the exception can come from anywhere in the Module body > (during import, the module body gets executed ? unless the module has been > already imported). Since I don't get exception when executing "from Module > import Class", I suspect that this is what may be the case. The call stack > for the exception could help find out what line in your module code is > throwing. > > > > M. > > > ------------------------------ > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Martin Maly > *Sent:* Thursday, July 13, 2006 8:09 AM > *To:* Discussion of IronPython > *Subject:* Re: [IronPython] Unable to cast object of type ' > IronPython.Runtime.Types.OldClass' to type ' > IronPython.Runtime.Types.DynamicType' > > > > To help you, we will need more information about your use of the Python > Engine. The simple case of executing "from Module import Class" does work so > we need to know more to find out what the problem may be. > > > > Thanks > > Martin > > > ------------------------------ > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Mike Raath > *Sent:* Thursday, July 13, 2006 1:41 AM > *To:* Discussion of IronPython > *Subject:* [IronPython] Unable to cast object of type ' > IronPython.Runtime.Types.OldClass' to type ' > IronPython.Runtime.Types.DynamicType' > > > > Hi > > Having tried to switch over to beta 9, and changing my generic Evaluate > references to EvaluateAs, I get a runtime error on an import statement > which works under beta 8. The exception is as is detailed in the message > above, and is from a statement like > engine.Execute("from Module import Class); > > The Module and Class definitions are custom - and as i say this statement > works under beta 8. > > Do you require more information or do I need to make a further change to > my code to get it to work? > > Thanks, > Mike > > _______________________________________________ > 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 Martin.Maly at microsoft.com Fri Jul 14 09:44:12 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Fri, 14 Jul 2006 00:44:12 -0700 Subject: [IronPython] Unable to cast object of type 'IronPython.Runtime.Types.OldClass' to type 'IronPython.Runtime.Types.DynamicType' In-Reply-To: <664260580607140017x59f843fr49783b247972cac@mail.gmail.com> Message-ID: Thank you very much, great repro, which points to an IronPython bug which I opened on CodePlex (bug 940) http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkItemId=940 in fact, the actual repro is even simpler, no need to declare the TestClass either, simply import minidom and exception happens. >>> import sys >>> sys.path.append(r"C:\Python24\Lib") >>> import xml.dom.minidom Traceback (most recent call last): File , line 0, in ##8 File , line 0, in __import__##5 File C:\Python24\Lib\xml\dom\minidom.py, line 462, in Initialize TypeError: Unable to cast object of type 'IronPython.Runtime.Types.OldClass' to type 'IronPython.Runtime.Types.DynamicType'. Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Mike Raath Sent: Friday, July 14, 2006 12:18 AM To: Discussion of IronPython Subject: Re: [IronPython] Unable to cast object of type 'IronPython.Runtime.Types.OldClass' to type 'IronPython.Runtime.Types.DynamicType' OK - I've broken it down to its simplest form. It looks like there's a problem importing the minidom class. If you create a module TestModule.py containing the following code: Python Code ========== import xml.dom.minidom class TestClass: pass and then try to import this class you will see this error. My C# code is as follows: ==================== PythonEngine engine = new PythonEngine(); engine.AddToPath("C:\\Python24\\lib"); engine.AddToPath("C:\\Temp\\IronPythonTest\\IronPythonTest\\Python\\"); engine.Execute("from TestModule import TestClass"); Mike On 7/13/06, Martin Maly > wrote: However, that said, in Beta 9, the OldClass is no longer a DynamicType, which explains the exception itself. To find out what you need to change in your code is something that we'll need more info for. For example, the exception can come from anywhere in the Module body (during import, the module body gets executed - unless the module has been already imported). Since I don't get exception when executing "from Module import Class", I suspect that this is what may be the case. The call stack for the exception could help find out what line in your module code is throwing. M. ________________________________ From: users-bounces at lists.ironpython.com [mailto: users-bounces at lists.ironpython.com] On Behalf Of Martin Maly Sent: Thursday, July 13, 2006 8:09 AM To: Discussion of IronPython Subject: Re: [IronPython] Unable to cast object of type 'IronPython.Runtime.Types.OldClass' to type 'IronPython.Runtime.Types.DynamicType' To help you, we will need more information about your use of the Python Engine. The simple case of executing "from Module import Class" does work so we need to know more to find out what the problem may be. Thanks Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto: users-bounces at lists.ironpython.com] On Behalf Of Mike Raath Sent: Thursday, July 13, 2006 1:41 AM To: Discussion of IronPython Subject: [IronPython] Unable to cast object of type 'IronPython.Runtime.Types.OldClass' to type 'IronPython.Runtime.Types.DynamicType' Hi Having tried to switch over to beta 9, and changing my generic Evaluate references to EvaluateAs, I get a runtime error on an import statement which works under beta 8. The exception is as is detailed in the message above, and is from a statement like engine.Execute("from Module import Class); The Module and Class definitions are custom - and as i say this statement works under beta 8. Do you require more information or do I need to make a further change to my code to get it to work? Thanks, Mike _______________________________________________ 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 jason.ferrara at jacquette.com Fri Jul 14 17:48:07 2006 From: jason.ferrara at jacquette.com (Jason Ferrara) Date: Fri, 14 Jul 2006 11:48:07 -0400 Subject: [IronPython] pickling exceptions and differences between IronPython and cpython Message-ID: Using the pickle modules from cpython to pickle built in exceptions fails under IronPython because IronPython adds a clsException attribute which pickle can't handle. And example is below. Should this be considered a bug? IronPython 1.0.60712 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import pickle >>> a=[] >>> try: ... a[4] ... except Exception, e: ... pickle.dumps(e) ... Traceback (most recent call last): File , line 0, in ##43 File z:\iptest\pickle.py, line 1386, in dumps File z:\iptest\pickle.py, line 231, in dump File z:\iptest\pickle.py, line 293, in save File z:\iptest\pickle.py, line 739, in save_inst File z:\iptest\pickle.py, line 293, in save File z:\iptest\pickle.py, line 663, in save_dict File z:\iptest\pickle.py, line 677, in _batch_setitems File z:\iptest\pickle.py, line 313, in save TypeError: can't pickle IndexOutOfRangeException instance (non- default __reduce__ needed) >>> pickle.dumps(e.clsException) Traceback (most recent call last): File , line 0, in ##72 File z:\iptest\pickle.py, line 1386, in dumps File z:\iptest\pickle.py, line 231, in dump File z:\iptest\pickle.py, line 313, in save TypeError: can't pickle IndexOutOfRangeException instance (non- default __reduce__ needed) >>> del e.clsException >>> pickle.dumps(e) "(iexceptions\nIndexError\np0\n(dp1\nS'msg'\np2\nS'index out of range: 4'\np3\nsS'args'\np4\n(g3\ntp5\nsb." >>> while in cpython: Python 2.4.2 (#1, Jun 14 2006, 09:51:02) [GCC 4.0.1 (Apple Computer, Inc. build 5247)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import pickle >>> a=[] >>> try: ... a[4] ... except Exception, e: ... pickle.dumps(e) ... "(iexceptions\nIndexError\np0\n(dp1\nS'args'\np2\n(S'list index out of range'\np3\ntp4\nsb." >>> From t-clacul at microsoft.com Fri Jul 14 17:59:51 2006 From: t-clacul at microsoft.com (Lee Culver) Date: Fri, 14 Jul 2006 08:59:51 -0700 Subject: [IronPython] Regression with Beta9? In-Reply-To: Message-ID: <529C8DA84B5B364FB86BB4DC8707508B018F7D20@RED-MSG-80.redmond.corp.microsoft.com> What about the previous email? I currently cannot access any IronPython specific constructs which are in the __builtins__ module, or any other module: >>> import clr >>> HasAttr Traceback (most recent call last): File , line 0, in ##16 NameError: name 'HasAttr' not defined >>> __builtins__.HasAttr Other modules have similar problems, such as: >>> import clr >>> import thread >>> thread.StartNewThread Traceback (most recent call last): File , line 0, in ##19 AttributeError: 'module' object has no attribute 'StartNewThread' Whereas StartNewThread was a .Net style alias for thread.start_new_thread in IronPython 8. Thanks, -Lee ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Martin Maly Sent: Thursday, July 13, 2006 9:50 PM To: Discussion of IronPython Subject: Re: [IronPython] Regression with Beta9? Yep, we have entered the ToString issue, but your operator issue is a new one. I've filed it in CodePlex as work item 939 Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Lee Culver Sent: Thursday, July 13, 2006 8:35 PM To: Discussion of IronPython Subject: Re: [IronPython] Regression with Beta9? And another one... IronPython 1.0.60712 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import clr >>> >>> clr.AddReferenceByPartialName("Microsoft.DirectX") >>> from Microsoft import DirectX >>> v = DirectX.Vector3(1, 2, 3) >>> v * 2 ...]>osoft.DirectX.Vector3 object at 0x000000000000002C [Z : 6 >>> v * 2.2 Traceback (most recent call last): File , line 0, in ##30 TypeError: unsupported operand type(s) for *: 'Vector3' and 'float' Whereas this worked fine in IronPython8 (and indeed the DirectX.Vector3 class supports a multiplication with floats): IronPython 1.0.2376 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import clr >>> clr.AddReferenceByPartialName("Microsoft.DirectX") >>> v = DirectX.Vector3(1, 2, 3) Traceback (most recent call last): File , line 0, in ##13 NameError: name 'DirectX' not defined >>> from Microsoft import DirectX >>> v = DirectX.Vector3(1, 2, 3) >>> v * 2 Z : 6 Y : 4 X : 2 >>> v * 2.2 Z : 6.6 Y : 4.4 X : 2.2 I think the ToString issue has already been reported... Thanks -Lee ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Lee Culver Sent: Thursday, July 13, 2006 8:17 PM To: Discussion of IronPython Subject: [IronPython] Regression with Beta9? This seems to not work anymore: >>> import clr >>> HasAttr Traceback (most recent call last): File , line 0, in ##9 NameError: name 'HasAttr' not defined Whereas under Beta8 it worked fine... Is this intentional? If so, this seems a bit weird that it's still in __builtins__: >>> __builtins__.HasAttr Thanks -Lee -------------- next part -------------- An HTML attachment was scrubbed... URL: From t-bruch at microsoft.com Fri Jul 14 18:34:12 2006 From: t-bruch at microsoft.com (Bruce Christensen) Date: Fri, 14 Jul 2006 09:34:12 -0700 Subject: [IronPython] pickling exceptions and differences between IronPythonand cpython In-Reply-To: References: Message-ID: <3581AA168D87A2479D88EA319BDF7D32E046FE@RED-MSG-80.redmond.corp.microsoft.com> Thanks for the feedback! We should definitely support pickling exceptions that originated as CLR exceptions. I've opened http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkIt emId=945 to track it. --Bruce -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jason Ferrara Sent: Friday, July 14, 2006 8:48 AM To: users at lists.ironpython.com Subject: [IronPython] pickling exceptions and differences between IronPythonand cpython Using the pickle modules from cpython to pickle built in exceptions fails under IronPython because IronPython adds a clsException attribute which pickle can't handle. And example is below. Should this be considered a bug? IronPython 1.0.60712 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import pickle >>> a=[] >>> try: ... a[4] ... except Exception, e: ... pickle.dumps(e) ... Traceback (most recent call last): File , line 0, in ##43 File z:\iptest\pickle.py, line 1386, in dumps File z:\iptest\pickle.py, line 231, in dump File z:\iptest\pickle.py, line 293, in save File z:\iptest\pickle.py, line 739, in save_inst File z:\iptest\pickle.py, line 293, in save File z:\iptest\pickle.py, line 663, in save_dict File z:\iptest\pickle.py, line 677, in _batch_setitems File z:\iptest\pickle.py, line 313, in save TypeError: can't pickle IndexOutOfRangeException instance (non- default __reduce__ needed) >>> pickle.dumps(e.clsException) Traceback (most recent call last): File , line 0, in ##72 File z:\iptest\pickle.py, line 1386, in dumps File z:\iptest\pickle.py, line 231, in dump File z:\iptest\pickle.py, line 313, in save TypeError: can't pickle IndexOutOfRangeException instance (non- default __reduce__ needed) >>> del e.clsException >>> pickle.dumps(e) "(iexceptions\nIndexError\np0\n(dp1\nS'msg'\np2\nS'index out of range: 4'\np3\nsS'args'\np4\n(g3\ntp5\nsb." >>> while in cpython: Python 2.4.2 (#1, Jun 14 2006, 09:51:02) [GCC 4.0.1 (Apple Computer, Inc. build 5247)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import pickle >>> a=[] >>> try: ... a[4] ... except Exception, e: ... pickle.dumps(e) ... "(iexceptions\nIndexError\np0\n(dp1\nS'args'\np2\n(S'list index out of range'\np3\ntp4\nsb." >>> _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Martin.Maly at microsoft.com Fri Jul 14 19:29:26 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Fri, 14 Jul 2006 10:29:26 -0700 Subject: [IronPython] Regression with Beta9? In-Reply-To: <529C8DA84B5B364FB86BB4DC8707508B018F7D20@RED-MSG-80.redmond.corp.microsoft.com> Message-ID: HasAttr is not an IronPython specific construct, just an IronPython specific name. It is, however, strange, that we don't find it after you import clr. We'll look into that problem. In the meantime, you can use the name of the true Python built-in "hasattr". It will execute the very same code, only a different name will be used to access it. start_new_thread will still work for your StartNewThread case. Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Lee Culver Sent: Friday, July 14, 2006 9:00 AM To: Discussion of IronPython Subject: Re: [IronPython] Regression with Beta9? What about the previous email? I currently cannot access any IronPython specific constructs which are in the __builtins__ module, or any other module: >>> import clr >>> HasAttr Traceback (most recent call last): File , line 0, in ##16 NameError: name 'HasAttr' not defined >>> __builtins__.HasAttr Other modules have similar problems, such as: >>> import clr >>> import thread >>> thread.StartNewThread Traceback (most recent call last): File , line 0, in ##19 AttributeError: 'module' object has no attribute 'StartNewThread' Whereas StartNewThread was a .Net style alias for thread.start_new_thread in IronPython 8. Thanks, -Lee ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Martin Maly Sent: Thursday, July 13, 2006 9:50 PM To: Discussion of IronPython Subject: Re: [IronPython] Regression with Beta9? Yep, we have entered the ToString issue, but your operator issue is a new one. I've filed it in CodePlex as work item 939 Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Lee Culver Sent: Thursday, July 13, 2006 8:35 PM To: Discussion of IronPython Subject: Re: [IronPython] Regression with Beta9? And another one... IronPython 1.0.60712 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import clr >>> >>> clr.AddReferenceByPartialName("Microsoft.DirectX") >>> from Microsoft import DirectX >>> v = DirectX.Vector3(1, 2, 3) >>> v * 2 ...]>osoft.DirectX.Vector3 object at 0x000000000000002C [Z : 6 >>> v * 2.2 Traceback (most recent call last): File , line 0, in ##30 TypeError: unsupported operand type(s) for *: 'Vector3' and 'float' Whereas this worked fine in IronPython8 (and indeed the DirectX.Vector3 class supports a multiplication with floats): IronPython 1.0.2376 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import clr >>> clr.AddReferenceByPartialName("Microsoft.DirectX") >>> v = DirectX.Vector3(1, 2, 3) Traceback (most recent call last): File , line 0, in ##13 NameError: name 'DirectX' not defined >>> from Microsoft import DirectX >>> v = DirectX.Vector3(1, 2, 3) >>> v * 2 Z : 6 Y : 4 X : 2 >>> v * 2.2 Z : 6.6 Y : 4.4 X : 2.2 I think the ToString issue has already been reported... Thanks -Lee ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Lee Culver Sent: Thursday, July 13, 2006 8:17 PM To: Discussion of IronPython Subject: [IronPython] Regression with Beta9? This seems to not work anymore: >>> import clr >>> HasAttr Traceback (most recent call last): File , line 0, in ##9 NameError: name 'HasAttr' not defined Whereas under Beta8 it worked fine... Is this intentional? If so, this seems a bit weird that it's still in __builtins__: >>> __builtins__.HasAttr Thanks -Lee -------------- next part -------------- An HTML attachment was scrubbed... URL: From t-clacul at microsoft.com Fri Jul 14 19:38:36 2006 From: t-clacul at microsoft.com (Lee Culver) Date: Fri, 14 Jul 2006 10:38:36 -0700 Subject: [IronPython] Regression with Beta9? In-Reply-To: Message-ID: <529C8DA84B5B364FB86BB4DC8707508B01991662@RED-MSG-80.redmond.corp.microsoft.com> Ah ok... I was more wondering if it's a supported construct or not (and if it is, why is it missing?). I would like to use these IronPython specific names since it makes the code uniform in terms of function capitalization (and this code could never run in CPython anyway since it makes heavy use of the .Net platform). Thanks, Lee ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Martin Maly Sent: Friday, July 14, 2006 10:29 AM To: Discussion of IronPython Subject: Re: [IronPython] Regression with Beta9? HasAttr is not an IronPython specific construct, just an IronPython specific name. It is, however, strange, that we don't find it after you import clr. We'll look into that problem. In the meantime, you can use the name of the true Python built-in "hasattr". It will execute the very same code, only a different name will be used to access it. start_new_thread will still work for your StartNewThread case. Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Lee Culver Sent: Friday, July 14, 2006 9:00 AM To: Discussion of IronPython Subject: Re: [IronPython] Regression with Beta9? What about the previous email? I currently cannot access any IronPython specific constructs which are in the __builtins__ module, or any other module: >>> import clr >>> HasAttr Traceback (most recent call last): File , line 0, in ##16 NameError: name 'HasAttr' not defined >>> __builtins__.HasAttr Other modules have similar problems, such as: >>> import clr >>> import thread >>> thread.StartNewThread Traceback (most recent call last): File , line 0, in ##19 AttributeError: 'module' object has no attribute 'StartNewThread' Whereas StartNewThread was a .Net style alias for thread.start_new_thread in IronPython 8. Thanks, -Lee ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Martin Maly Sent: Thursday, July 13, 2006 9:50 PM To: Discussion of IronPython Subject: Re: [IronPython] Regression with Beta9? Yep, we have entered the ToString issue, but your operator issue is a new one. I've filed it in CodePlex as work item 939 Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Lee Culver Sent: Thursday, July 13, 2006 8:35 PM To: Discussion of IronPython Subject: Re: [IronPython] Regression with Beta9? And another one... IronPython 1.0.60712 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import clr >>> >>> clr.AddReferenceByPartialName("Microsoft.DirectX") >>> from Microsoft import DirectX >>> v = DirectX.Vector3(1, 2, 3) >>> v * 2 ...]>osoft.DirectX.Vector3 object at 0x000000000000002C [Z : 6 >>> v * 2.2 Traceback (most recent call last): File , line 0, in ##30 TypeError: unsupported operand type(s) for *: 'Vector3' and 'float' Whereas this worked fine in IronPython8 (and indeed the DirectX.Vector3 class supports a multiplication with floats): IronPython 1.0.2376 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import clr >>> clr.AddReferenceByPartialName("Microsoft.DirectX") >>> v = DirectX.Vector3(1, 2, 3) Traceback (most recent call last): File , line 0, in ##13 NameError: name 'DirectX' not defined >>> from Microsoft import DirectX >>> v = DirectX.Vector3(1, 2, 3) >>> v * 2 Z : 6 Y : 4 X : 2 >>> v * 2.2 Z : 6.6 Y : 4.4 X : 2.2 I think the ToString issue has already been reported... Thanks -Lee ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Lee Culver Sent: Thursday, July 13, 2006 8:17 PM To: Discussion of IronPython Subject: [IronPython] Regression with Beta9? This seems to not work anymore: >>> import clr >>> HasAttr Traceback (most recent call last): File , line 0, in ##9 NameError: name 'HasAttr' not defined Whereas under Beta8 it worked fine... Is this intentional? If so, this seems a bit weird that it's still in __builtins__: >>> __builtins__.HasAttr Thanks -Lee -------------- next part -------------- An HTML attachment was scrubbed... URL: From t-bruch at microsoft.com Fri Jul 14 20:24:52 2006 From: t-bruch at microsoft.com (Bruce Christensen) Date: Fri, 14 Jul 2006 11:24:52 -0700 Subject: [IronPython] Regression with Beta9? In-Reply-To: <529C8DA84B5B364FB86BB4DC8707508B018F7D20@RED-MSG-80.redmond.corp.microsoft.com> References: <529C8DA84B5B364FB86BB4DC8707508B018F7D20@RED-MSG-80.redmond.corp.microsoft.com> Message-ID: <3581AA168D87A2479D88EA319BDF7D32E04863@RED-MSG-80.redmond.corp.microsoft.com> The CLR names are still available on __builtins__ (but strangely not on __builtin__ when it is imported). As a somewhat ugly workaround, you can copy the names from __builtins__ into your local namespace: >>> import clr >>> HasAttr Traceback (most recent call last): File , line 0, in ##6 NameError: name 'HasAttr' not defined >>> for attr in dir(__builtins__): ... locals()[attr] = getattr(__builtins__, attr) ... >>> >>> HasAttr >>> You can also copy them into globals() if you want them available everywhere. --Bruce From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Lee Culver Sent: Friday, July 14, 2006 9:00 AM To: Discussion of IronPython Subject: Re: [IronPython] Regression with Beta9? What about the previous email? I currently cannot access any IronPython specific constructs which are in the __builtins__ module, or any other module: >>> import clr >>> HasAttr Traceback (most recent call last): File , line 0, in ##16 NameError: name 'HasAttr' not defined >>> __builtins__.HasAttr Other modules have similar problems, such as: >>> import clr >>> import thread >>> thread.StartNewThread Traceback (most recent call last): File , line 0, in ##19 AttributeError: 'module' object has no attribute 'StartNewThread' Whereas StartNewThread was a .Net style alias for thread.start_new_thread in IronPython 8. Thanks, -Lee ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Martin Maly Sent: Thursday, July 13, 2006 9:50 PM To: Discussion of IronPython Subject: Re: [IronPython] Regression with Beta9? Yep, we have entered the ToString issue, but your operator issue is a new one. I've filed it in CodePlex as work item 939 Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Lee Culver Sent: Thursday, July 13, 2006 8:35 PM To: Discussion of IronPython Subject: Re: [IronPython] Regression with Beta9? And another one... IronPython 1.0.60712 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import clr >>> >>> clr.AddReferenceByPartialName("Microsoft.DirectX") >>> from Microsoft import DirectX >>> v = DirectX.Vector3(1, 2, 3) >>> v * 2 ...]>osoft.DirectX.Vector3 object at 0x000000000000002C [Z : 6 >>> v * 2.2 Traceback (most recent call last): File , line 0, in ##30 TypeError: unsupported operand type(s) for *: 'Vector3' and 'float' Whereas this worked fine in IronPython8 (and indeed the DirectX.Vector3 class supports a multiplication with floats): IronPython 1.0.2376 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import clr >>> clr.AddReferenceByPartialName("Microsoft.DirectX") >>> v = DirectX.Vector3(1, 2, 3) Traceback (most recent call last): File , line 0, in ##13 NameError: name 'DirectX' not defined >>> from Microsoft import DirectX >>> v = DirectX.Vector3(1, 2, 3) >>> v * 2 Z : 6 Y : 4 X : 2 >>> v * 2.2 Z : 6.6 Y : 4.4 X : 2.2 I think the ToString issue has already been reported... Thanks -Lee ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Lee Culver Sent: Thursday, July 13, 2006 8:17 PM To: Discussion of IronPython Subject: [IronPython] Regression with Beta9? This seems to not work anymore: >>> import clr >>> HasAttr Traceback (most recent call last): File , line 0, in ##9 NameError: name 'HasAttr' not defined Whereas under Beta8 it worked fine... Is this intentional? If so, this seems a bit weird that it's still in __builtins__: >>> __builtins__.HasAttr Thanks -Lee -------------- next part -------------- An HTML attachment was scrubbed... URL: From t-bruch at microsoft.com Fri Jul 14 20:48:11 2006 From: t-bruch at microsoft.com (Bruce Christensen) Date: Fri, 14 Jul 2006 11:48:11 -0700 Subject: [IronPython] pickling exceptions and differences between IronPythonand cpython References: Message-ID: <3581AA168D87A2479D88EA319BDF7D32E048BD@RED-MSG-80.redmond.corp.microsoft.com> Also, as a workaround, you can add a simple __getstate__ method to the Exception class that ignores clsException if it's present: C:\Ip\IronPython>ipy IronPython 1.0.2386 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import sys; sys.path.append(r'c:\Python24\lib') >>> import pickle >>> try: ... a ... except Exception, e: ... pass ... >>> e >>> pickle.dumps(e) Traceback (most recent call last): File , line 0, in ##44 File c:\Python24\lib\pickle.py, line 1386, in dumps File c:\Python24\lib\pickle.py, line 231, in dump File c:\Python24\lib\pickle.py, line 293, in save File c:\Python24\lib\pickle.py, line 739, in save_inst File c:\Python24\lib\pickle.py, line 293, in save File c:\Python24\lib\pickle.py, line 663, in save_dict File c:\Python24\lib\pickle.py, line 677, in _batch_setitems File c:\Python24\lib\pickle.py, line 313, in save TypeError: can't pickle NameError instance (non-default __reduce__ needed) >>> def getstate(self): ... dict = self.__dict__.copy() ... if 'clsException' in dict: ... del dict['clsException'] ... return dict ... >>> Exception.__getstate__ = getstate >>> pickle.dumps(e) '(iexceptions\nNameError\np0\n(dp2\nS\'msg\'\np3\nS"name \'a\' not defined"\np4\ nsS\'args\'\np5\n(g4\ntp6\nsb.' >>> -----Original Message----- From: Bruce Christensen Sent: Friday, July 14, 2006 9:34 AM To: 'Discussion of IronPython' Subject: RE: [IronPython] pickling exceptions and differences between IronPythonand cpython Thanks for the feedback! We should definitely support pickling exceptions that originated as CLR exceptions. I've opened http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkIt emId=945 to track it. --Bruce -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jason Ferrara Sent: Friday, July 14, 2006 8:48 AM To: users at lists.ironpython.com Subject: [IronPython] pickling exceptions and differences between IronPythonand cpython Using the pickle modules from cpython to pickle built in exceptions fails under IronPython because IronPython adds a clsException attribute which pickle can't handle. And example is below. Should this be considered a bug? IronPython 1.0.60712 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import pickle >>> a=[] >>> try: ... a[4] ... except Exception, e: ... pickle.dumps(e) ... Traceback (most recent call last): File , line 0, in ##43 File z:\iptest\pickle.py, line 1386, in dumps File z:\iptest\pickle.py, line 231, in dump File z:\iptest\pickle.py, line 293, in save File z:\iptest\pickle.py, line 739, in save_inst File z:\iptest\pickle.py, line 293, in save File z:\iptest\pickle.py, line 663, in save_dict File z:\iptest\pickle.py, line 677, in _batch_setitems File z:\iptest\pickle.py, line 313, in save TypeError: can't pickle IndexOutOfRangeException instance (non- default __reduce__ needed) >>> pickle.dumps(e.clsException) Traceback (most recent call last): File , line 0, in ##72 File z:\iptest\pickle.py, line 1386, in dumps File z:\iptest\pickle.py, line 231, in dump File z:\iptest\pickle.py, line 313, in save TypeError: can't pickle IndexOutOfRangeException instance (non- default __reduce__ needed) >>> del e.clsException >>> pickle.dumps(e) "(iexceptions\nIndexError\np0\n(dp1\nS'msg'\np2\nS'index out of range: 4'\np3\nsS'args'\np4\n(g3\ntp5\nsb." >>> while in cpython: Python 2.4.2 (#1, Jun 14 2006, 09:51:02) [GCC 4.0.1 (Apple Computer, Inc. build 5247)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import pickle >>> a=[] >>> try: ... a[4] ... except Exception, e: ... pickle.dumps(e) ... "(iexceptions\nIndexError\np0\n(dp1\nS'args'\np2\n(S'list index out of range'\np3\ntp4\nsb." >>> _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From kfarmer at thuban.org Sat Jul 15 05:56:59 2006 From: kfarmer at thuban.org (Keith J. Farmer) Date: Fri, 14 Jul 2006 20:56:59 -0700 Subject: [IronPython] OsCon? Message-ID: Gee.. they don?t send us VCS devs to conventions (well, not all of us) I expect a box of loot in front of my office. ;) ----- Keith J. Farmer kfarmer at thuban.org From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Wednesday, 12 July 2006 20:49 To: IronPython List Subject: [IronPython] OsCon? Is anyone out there on the mailing list going to OsCon? Maybe we could all meet up for lunch or dinner some day or night? I?ll be arriving in Portland Tuesday night and am planning on leaving Friday night. There will be several other people from the team there as well, I?ll let them speak for their schedules. I have no specific plans other than enjoying OsCon, and I?ve heard a restaurant called Hurley?s is the best food in the world (though pricey), so I?m basically open. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jvm_cop at spamcop.net Sat Jul 15 22:01:15 2006 From: jvm_cop at spamcop.net (J. Merrill) Date: Sat, 15 Jul 2006 16:01:15 -0400 Subject: [IronPython] Getting a call stack from an exception? References: <7.0.1.0.2.20060713131654.0449b5e0@wheresmymailserver.com> Message-ID: <7.0.1.0.2.20060715155729.06ab8020@wheresmymailserver.com> Perhaps there should be a discussion of whether the IronPython distribution should (could) include the standard CPython 2.4 libraries that are needed to give the "full" Python experience. Perhaps your tutorial should tell people how to install CPython (it is, after all, trivial), if there's a reason that the standard libraries shouldn't go out with IP. At 01:48 PM 7/13/2006, Lee Culver wrote >Ah yeah, my roommate asked me the same question. > >There?s absolutely no reason that I shouldn?t be using the Python traceback library (and you should use it too). I?m working on a tutorial for IronPython which I would like to run ?out of the box? (that is, not have the end user install CPython as a dependency of the tutorial). This is the only reason I was looking for a ?pure? IronPython solution. > >-Lee > > >---------- >From: J. Merrill >Sent: Thursday, July 13, 2006 10:22 AM >To: Discussion of IronPython >Subject: Re: [IronPython] Getting a call stack from an exception? > >Could someone explain to this interested observer what is missing when the standard Python traceback functionality is used? Writing IronPython-specific code that isn't specifically involved in interacting with .Net seems against the "you can run the same Python code anywhere" notion that I expect to see. > >Or did you mean "using the IronPython Engine" (aka "in pure C# code") when you said "in pure IP"? The sample code, after all, was Python and not calls to the IronPython Engine.... > > >---------- >From: Lee Culver >Sent: Wednesday, July 12, 2006 1:39 PM >To: Discussion of IronPython >Subject: Re: [IronPython] Getting a call stack from an exception? > >I?m probably going to just reimplement the functionality in pure IP. If I get anywhere with it I?ll post it up here. > > >---------- >From: Alex Henderson >Sent: Wednesday, July 12, 2006 1:37 PM >To: 'Discussion of IronPython' >Subject: Re: [IronPython] Getting a call stack from an exception? > >I would be interested to know how you get on with this problem Lee - I?ve got the same issue myself. > >Chez, > > - Alex > > >---------- >From: Lee Culver >Sent: Thursday, 13 July 2006 6:57 a.m. >To: Discussion of IronPython >Subject: Re: [IronPython] Getting a call stack from an exception? > >Yikes. I was hoping for a way to do it in pure IronPython. Thanks though. > > >---------- >From: Dino Viehland >Sent: Wednesday, July 12, 2006 11:54 AM >To: Discussion of IronPython >Subject: Re: [IronPython] Getting a call stack from an exception? > >Tracebacks are the correct way to do this, I recommend you install the standard Python library against IronPython to make this really useful ? then you can do import traceback and use its handy functions (otherwise you?ll be walking the traceback list in sys.exc_info() which won?t be much fun). > >From: Lee Culver >Sent: Wednesday, July 12, 2006 11:49 AM >To: Discussion of IronPython >Subject: [IronPython] Getting a call stack from an exception? > >I would like to print out a call stack from an exception object, much like what the IronPython console does when an exception goes uncaught. I have tried doing something like this: > >try: > #something that causes an exception >except Exception, e: > print e > >But, like python, this only prints out the message given to it. I have also tried this: > print e.clsException > print e.clsException.StackTrace > >But these print out the stack trace which includes the IronPython library c# code as well. Is there a way to get the stack trace which only contains the python call stack (like the one the console uses)? > >Thanks >-Lee J. Merrill / Analytical Software Corp -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Sun Jul 16 00:21:38 2006 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sat, 15 Jul 2006 23:21:38 +0100 Subject: [IronPython] A First Look at IronPython: Where Python meets .NET Message-ID: <44B96A72.1070503@voidspace.org.uk> Hello all, For those who may not have seen it, there is a great article on IronPython on devsource. http://www.devsource.com/article2/0,1895,1989490,00.asp All the best, Michael Foord http://www.voidspace.org.uk/python/index.shtml From Martin.Maly at microsoft.com Sun Jul 16 02:45:33 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Sat, 15 Jul 2006 17:45:33 -0700 Subject: [IronPython] Getting a call stack from an exception? In-Reply-To: <7.0.1.0.2.20060715155729.06ab8020@wheresmymailserver.com> Message-ID: In fact, we have already updated the tutorial with the instructions how to use IP with standard Python libraries. While this change didn't make it into our Beta 9 release, the latest package available on codeplex (http://www.codeplex.com) does include the updated tutorial. Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of J. Merrill Sent: Saturday, July 15, 2006 1:01 PM To: Discussion of IronPython Subject: Re: [IronPython] Getting a call stack from an exception? Perhaps there should be a discussion of whether the IronPython distribution should (could) include the standard CPython 2.4 libraries that are needed to give the "full" Python experience. Perhaps your tutorial should tell people how to install CPython (it is, after all, trivial), if there's a reason that the standard libraries shouldn't go out with IP. At 01:48 PM 7/13/2006, Lee Culver wrote Ah yeah, my roommate asked me the same question. There's absolutely no reason that I shouldn't be using the Python traceback library (and you should use it too). I'm working on a tutorial for IronPython which I would like to run "out of the box" (that is, not have the end user install CPython as a dependency of the tutorial). This is the only reason I was looking for a "pure" IronPython solution. -Lee ________________________________ From: J. Merrill Sent: Thursday, July 13, 2006 10:22 AM To: Discussion of IronPython Subject: Re: [IronPython] Getting a call stack from an exception? Could someone explain to this interested observer what is missing when the standard Python traceback functionality is used? Writing IronPython-specific code that isn't specifically involved in interacting with .Net seems against the "you can run the same Python code anywhere" notion that I expect to see. Or did you mean "using the IronPython Engine" (aka "in pure C# code") when you said "in pure IP"? The sample code, after all, was Python and not calls to the IronPython Engine.... ________________________________ From: Lee Culver Sent: Wednesday, July 12, 2006 1:39 PM To: Discussion of IronPython Subject: Re: [IronPython] Getting a call stack from an exception? I'm probably going to just reimplement the functionality in pure IP. If I get anywhere with it I'll post it up here. ________________________________ From: Alex Henderson Sent: Wednesday, July 12, 2006 1:37 PM To: 'Discussion of IronPython' Subject: Re: [IronPython] Getting a call stack from an exception? I would be interested to know how you get on with this problem Lee - I've got the same issue myself. Chez, - Alex ________________________________ From: Lee Culver Sent: Thursday, 13 July 2006 6:57 a.m. To: Discussion of IronPython Subject: Re: [IronPython] Getting a call stack from an exception? Yikes. I was hoping for a way to do it in pure IronPython. Thanks though. ________________________________ From: Dino Viehland Sent: Wednesday, July 12, 2006 11:54 AM To: Discussion of IronPython Subject: Re: [IronPython] Getting a call stack from an exception? Tracebacks are the correct way to do this, I recommend you install the standard Python library against IronPython to make this really useful - then you can do import traceback and use its handy functions (otherwise you'll be walking the traceback list in sys.exc_info() which won't be much fun). From: Lee Culver Sent: Wednesday, July 12, 2006 11:49 AM To: Discussion of IronPython Subject: [IronPython] Getting a call stack from an exception? I would like to print out a call stack from an exception object, much like what the IronPython console does when an exception goes uncaught. I have tried doing something like this: try: ... #something that causes an exception except Exception, e: print e But, like python, this only prints out the message given to it. I have also tried this: print e.clsException print e.clsException.StackTrace But these print out the stack trace which includes the IronPython library c# code as well. Is there a way to get the stack trace which only contains the python call stack (like the one the console uses)? Thanks -Lee J. Merrill / Analytical Software Corp -------------- next part -------------- An HTML attachment was scrubbed... URL: From t-clacul at microsoft.com Sun Jul 16 21:45:00 2006 From: t-clacul at microsoft.com (Lee Culver) Date: Sun, 16 Jul 2006 12:45:00 -0700 Subject: [IronPython] Exceptions from the console in a background thread... Message-ID: <529C8DA84B5B364FB86BB4DC8707508B01991B92@RED-MSG-80.redmond.corp.microsoft.com> I'd like to file a low priority bug...under the "wouldn't it be nice if..." category. When you have an exception occur while using the console, it produces a very nice output (a stack trace including only Python code). However, if you run this in a background thread you get a monstrosity of a stack trace including C# code with no Python code. It would be very nice if this printed a nice python stack trace since the error which is returned in a thread is not useful in the slightest. Here's a quick repro: >>> def Test(): ... asdf ... >>> Test() # useful stack trace >>> import thread >>> thread.start_new_thread(Test, tuple()) # not useful at all Thanks, -Lee -------------- next part -------------- An HTML attachment was scrubbed... URL: From jvm_cop at spamcop.net Mon Jul 17 05:13:24 2006 From: jvm_cop at spamcop.net (J. Merrill) Date: Sun, 16 Jul 2006 23:13:24 -0400 Subject: [IronPython] Getting a call stack from an exception? References: <7.0.1.0.2.20060715155729.06ab8020@wheresmymailserver.com> Message-ID: <7.0.1.0.2.20060716231250.06c34e48@wheresmymailserver.com> Does it say how to get the standard Python libraries if you haven't installed CPython? At 08:45 PM 7/15/2006, Martin Maly wrote >In fact, we have already updated the tutorial with the instructions how to use IP with standard Python libraries. >While this change didn?t make it into our Beta 9 release, the latest package available on codeplex (http://www.codeplex.com) does include the updated tutorial. > >Martin > > >---------- >From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of J. Merrill >Sent: Saturday, July 15, 2006 1:01 PM >To: Discussion of IronPython >Subject: Re: [IronPython] Getting a call stack from an exception? > >Perhaps there should be a discussion of whether the IronPython distribution should (could) include the standard CPython 2.4 libraries that are needed to give the "full" Python experience. > >Perhaps your tutorial should tell people how to install CPython (it is, after all, trivial), if there's a reason that the standard libraries shouldn't go out with IP. > >At 01:48 PM 7/13/2006, Lee Culver wrote > > >Ah yeah, my roommate asked me the same question. > >There?s absolutely no reason that I shouldn?t be using the Python traceback library (and you should use it too). I?m working on a tutorial for IronPython which I would like to run ?out of the box? (that is, not have the end user install CPython as a dependency of the tutorial). This is the only reason I was looking for a ?pure? IronPython solution. > >-Lee > > >---------- >From: J. Merrill >Sent: Thursday, July 13, 2006 10:22 AM >To: Discussion of IronPython >Subject: Re: [IronPython] Getting a call stack from an exception? > >Could someone explain to this interested observer what is missing when the standard Python traceback functionality is used? Writing IronPython-specific code that isn't specifically involved in interacting with .Net seems against the "you can run the same Python code anywhere" notion that I expect to see. > >Or did you mean "using the IronPython Engine" (aka "in pure C# code") when you said "in pure IP"? The sample code, after all, was Python and not calls to the IronPython Engine.... > > >---------- >From: Lee Culver >Sent: Wednesday, July 12, 2006 1:39 PM >To: Discussion of IronPython >Subject: Re: [IronPython] Getting a call stack from an exception? > >I?m probably going to just reimplement the functionality in pure IP. If I get anywhere with it I?ll post it up here. > > >---------- >From: Alex Henderson >Sent: Wednesday, July 12, 2006 1:37 PM >To: 'Discussion of IronPython' >Subject: Re: [IronPython] Getting a call stack from an exception? > >I would be interested to know how you get on with this problem Lee - I?ve got the same issue myself. > >Chez, > > - Alex > > >---------- >From: Lee Culver >Sent: Thursday, 13 July 2006 6:57 a.m. >To: Discussion of IronPython >Subject: Re: [IronPython] Getting a call stack from an exception? > >Yikes. I was hoping for a way to do it in pure IronPython. Thanks though. > > >---------- >From: Dino Viehland >Sent: Wednesday, July 12, 2006 11:54 AM >To: Discussion of IronPython >Subject: Re: [IronPython] Getting a call stack from an exception? > >Tracebacks are the correct way to do this, I recommend you install the standard Python library against IronPython to make this really useful ? then you can do import traceback and use its handy functions (otherwise you?ll be walking the traceback list in sys.exc_info() which won?t be much fun). > >From: Lee Culver >Sent: Wednesday, July 12, 2006 11:49 AM >To: Discussion of IronPython >Subject: [IronPython] Getting a call stack from an exception? > >I would like to print out a call stack from an exception object, much like what the IronPython console does when an exception goes uncaught. I have tried doing something like this: > >try: > #something that causes an exception >except Exception, e: > print e > >But, like python, this only prints out the message given to it. I have also tried this: > print e.clsException > print e.clsException.StackTrace > >But these print out the stack trace which includes the IronPython library c# code as well. Is there a way to get the stack trace which only contains the python call stack (like the one the console uses)? > >Thanks >-Lee > > >J. Merrill / Analytical Software Corp >_______________________________________________ >users mailing list >users at lists.ironpython.com >http://lists.ironpython.com/listinfo.cgi/users-ironpython.com J. Merrill / Analytical Software Corp -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Maly at microsoft.com Mon Jul 17 05:21:48 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Sun, 16 Jul 2006 20:21:48 -0700 Subject: [IronPython] Getting a call stack from an exception? In-Reply-To: <7.0.1.0.2.20060716231250.06c34e48@wheresmymailserver.com> Message-ID: Yes - link to CPython download and the instructions from then on. ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of J. Merrill Sent: Sunday, July 16, 2006 8:13 PM To: Discussion of IronPython Subject: Re: [IronPython] Getting a call stack from an exception? Does it say how to get the standard Python libraries if you haven't installed CPython? At 08:45 PM 7/15/2006, Martin Maly wrote In fact, we have already updated the tutorial with the instructions how to use IP with standard Python libraries. While this change didn't make it into our Beta 9 release, the latest package available on codeplex (http://www.codeplex.com) does include the updated tutorial. Martin ________________________________ From: users-bounces at lists.ironpython.com [ mailto:users-bounces at lists.ironpython.com] On Behalf Of J. Merrill Sent: Saturday, July 15, 2006 1:01 PM To: Discussion of IronPython Subject: Re: [IronPython] Getting a call stack from an exception? Perhaps there should be a discussion of whether the IronPython distribution should (could) include the standard CPython 2.4 libraries that are needed to give the "full" Python experience. Perhaps your tutorial should tell people how to install CPython (it is, after all, trivial), if there's a reason that the standard libraries shouldn't go out with IP. At 01:48 PM 7/13/2006, Lee Culver wrote Ah yeah, my roommate asked me the same question. There's absolutely no reason that I shouldn't be using the Python traceback library (and you should use it too). I'm working on a tutorial for IronPython which I would like to run "out of the box" (that is, not have the end user install CPython as a dependency of the tutorial). This is the only reason I was looking for a "pure" IronPython solution. -Lee ________________________________ From: J. Merrill Sent: Thursday, July 13, 2006 10:22 AM To: Discussion of IronPython Subject: Re: [IronPython] Getting a call stack from an exception? Could someone explain to this interested observer what is missing when the standard Python traceback functionality is used? Writing IronPython-specific code that isn't specifically involved in interacting with .Net seems against the "you can run the same Python code anywhere" notion that I expect to see. Or did you mean "using the IronPython Engine" (aka "in pure C# code") when you said "in pure IP"? The sample code, after all, was Python and not calls to the IronPython Engine.... ________________________________ From: Lee Culver Sent: Wednesday, July 12, 2006 1:39 PM To: Discussion of IronPython Subject: Re: [IronPython] Getting a call stack from an exception? I'm probably going to just reimplement the functionality in pure IP. If I get anywhere with it I'll post it up here. ________________________________ From: Alex Henderson Sent: Wednesday, July 12, 2006 1:37 PM To: 'Discussion of IronPython' Subject: Re: [IronPython] Getting a call stack from an exception? I would be interested to know how you get on with this problem Lee - I've got the same issue myself. Chez, - Alex ________________________________ From: Lee Culver Sent: Thursday, 13 July 2006 6:57 a.m. To: Discussion of IronPython Subject: Re: [IronPython] Getting a call stack from an exception? Yikes. I was hoping for a way to do it in pure IronPython. Thanks though. ________________________________ From: Dino Viehland Sent: Wednesday, July 12, 2006 11:54 AM To: Discussion of IronPython Subject: Re: [IronPython] Getting a call stack from an exception? Tracebacks are the correct way to do this, I recommend you install the standard Python library against IronPython to make this really useful - then you can do import traceback and use its handy functions (otherwise you'll be walking the traceback list in sys.exc_info() which won't be much fun). From: Lee Culver Sent: Wednesday, July 12, 2006 11:49 AM To: Discussion of IronPython Subject: [IronPython] Getting a call stack from an exception? I would like to print out a call stack from an exception object, much like what the IronPython console does when an exception goes uncaught. I have tried doing something like this: try: ... #something that causes an exception except Exception, e: print e But, like python, this only prints out the message given to it. I have also tried this: print e.clsException print e.clsException.StackTrace But these print out the stack trace which includes the IronPython library c# code as well. Is there a way to get the stack trace which only contains the python call stack (like the one the console uses)? Thanks -Lee J. Merrill / Analytical Software Corp _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com J. Merrill / Analytical Software Corp -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Maly at microsoft.com Mon Jul 17 05:29:44 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Sun, 16 Jul 2006 20:29:44 -0700 Subject: [IronPython] Exceptions from the console in a background thread... In-Reply-To: <529C8DA84B5B364FB86BB4DC8707508B01991B92@RED-MSG-80.redmond.corp.microsoft.com> Message-ID: Good catch, Lee. I've filed this as bug 1015 on CodePlex. ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Lee Culver Sent: Sunday, July 16, 2006 12:45 PM To: Discussion of IronPython Subject: [IronPython] Exceptions from the console in a background thread... I'd like to file a low priority bug...under the "wouldn't it be nice if..." category. When you have an exception occur while using the console, it produces a very nice output (a stack trace including only Python code). However, if you run this in a background thread you get a monstrosity of a stack trace including C# code with no Python code. It would be very nice if this printed a nice python stack trace since the error which is returned in a thread is not useful in the slightest. Here's a quick repro: >>> def Test(): ... asdf ... >>> Test() # useful stack trace >>> import thread >>> thread.start_new_thread(Test, tuple()) # not useful at all Thanks, -Lee -------------- next part -------------- An HTML attachment was scrubbed... URL: From sanxiyn at gmail.com Mon Jul 17 14:41:55 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Mon, 17 Jul 2006 21:41:55 +0900 Subject: [IronPython] Function call bug Message-ID: <5b0248170607170541n665810ble6546f611fd108e7@mail.gmail.com> I am very surprised to find this. # test.py def f(a, *b): print a f(1, *[2]) Seo Sanghyeon From Martin.Maly at microsoft.com Mon Jul 17 17:46:33 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Mon, 17 Jul 2006 08:46:33 -0700 Subject: [IronPython] Function call bug In-Reply-To: <5b0248170607170541n665810ble6546f611fd108e7@mail.gmail.com> Message-ID: Thank you, Seo, opened as bug 1018 on CodePlex. Hopfully this will be an easy fix. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Sanghyeon Seo Sent: Monday, July 17, 2006 5:42 AM To: Discussion of IronPython Subject: [IronPython] Function call bug I am very surprised to find this. # test.py def f(a, *b): print a f(1, *[2]) Seo Sanghyeon _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From snaury at gmail.com Mon Jul 17 18:20:57 2006 From: snaury at gmail.com (Snaury) Date: Mon, 17 Jul 2006 20:20:57 +0400 Subject: [IronPython] Cryptic traceback when encoding name is incorrect Message-ID: # -*- coding: nonsense -*- print "Testing..." Traceback (most recent call last): File mscorlib, line unknown, in .ctor File mscorlib, line unknown, in .ctor TypeError: Value cannot be null. Parameter name: encoding I think it should properly state that encoding name is invalid. From dinov at exchange.microsoft.com Mon Jul 17 18:38:45 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 17 Jul 2006 09:38:45 -0700 Subject: [IronPython] Cryptic traceback when encoding name is incorrect In-Reply-To: References: Message-ID: <7AD436E4270DD54A94238001769C22272B97784EB0@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Thanks for the report - I've opened CodePlex bug #1019 to track this (http://www.codeplex.com/WorkItem/List.aspx?ProjectName=IronPython). -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Snaury Sent: Monday, July 17, 2006 9:21 AM To: Discussion of IronPython Subject: [IronPython] Cryptic traceback when encoding name is incorrect # -*- coding: nonsense -*- print "Testing..." Traceback (most recent call last): File mscorlib, line unknown, in .ctor File mscorlib, line unknown, in .ctor TypeError: Value cannot be null. Parameter name: encoding I think it should properly state that encoding name is invalid. _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From snaury at gmail.com Mon Jul 17 19:42:54 2006 From: snaury at gmail.com (Snaury) Date: Mon, 17 Jul 2006 21:42:54 +0400 Subject: [IronPython] Bug in time.strptime? In-Reply-To: <4039D552ADAB094BB1EA670F3E96214E0445BB6E79@df-foxhound-msg.exchange.corp.microsoft.com> References: <664260580607030250i450da6c2j5f403d7d9eb229ae@mail.gmail.com> <664260580607041023h24d7aa9amaf72562faa69187c@mail.gmail.com> <4039D552ADAB094BB1EA670F3E96214E0445BB6E79@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: Hi Dino, It seems that you just need to use DateTime.ParseExact and wrap those random characters in single quotes and then it parses successfully. At least I did it in the clr way and it worked: import System System.DateTime.ParseExact("July 3, 2006 At 0724 GMT", "MMMM d, y 'At' HHmm 'GMT'", System.Globalization.CultureInfo("en-US")) On 7/5/06, Dino Viehland wrote: > Sorry for the delay ? it was a really long weekend for many of us. > > Currently our strptime implementation is mostly built by translating from > Python formatting codes to .NET formatting codes and then calling the .NET > Formatting APIs. There's apparently a difference here in that .NET doesn't > allow random extra characters in its formatting strings, and CPython does. From snaury at gmail.com Mon Jul 17 19:43:39 2006 From: snaury at gmail.com (Snaury) Date: Mon, 17 Jul 2006 21:43:39 +0400 Subject: [IronPython] Bug in time.strptime? In-Reply-To: References: <664260580607030250i450da6c2j5f403d7d9eb229ae@mail.gmail.com> <664260580607041023h24d7aa9amaf72562faa69187c@mail.gmail.com> <4039D552ADAB094BB1EA670F3E96214E0445BB6E79@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: On 7/17/06, Snaury wrote: > Hi Dino, > > It seems that you just need to use DateTime.ParseExact and wrap those > random characters in single quotes and then it parses successfully. At > least I did it in the clr way and it worked: > > import System > System.DateTime.ParseExact("July 3, 2006 At 0724 GMT", "MMMM d, y 'At' > HHmm 'GMT'", System.Globalization.CultureInfo("en-US")) Oh, that should read: import System System.DateTime.ParseExact("July 3, 2006 At 0724 GMT", "MMMM d, yyyy 'At' HHmm 'GMT'", System.Globalization.CultureInfo("en-US")) From dinov at exchange.microsoft.com Mon Jul 17 19:50:29 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 17 Jul 2006 10:50:29 -0700 Subject: [IronPython] Bug in time.strptime? In-Reply-To: References: <664260580607030250i450da6c2j5f403d7d9eb229ae@mail.gmail.com> <664260580607041023h24d7aa9amaf72562faa69187c@mail.gmail.com> <4039D552ADAB094BB1EA670F3E96214E0445BB6E79@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <7AD436E4270DD54A94238001769C22272B97784F2F@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Awesome, thanks for the information - I wasn't sure how to deal w/ the unrecognized characters before, that'll save me the search. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Snaury Sent: Monday, July 17, 2006 10:44 AM To: Discussion of IronPython Subject: Re: [IronPython] Bug in time.strptime? On 7/17/06, Snaury wrote: > Hi Dino, > > It seems that you just need to use DateTime.ParseExact and wrap those > random characters in single quotes and then it parses successfully. At > least I did it in the clr way and it worked: > > import System > System.DateTime.ParseExact("July 3, 2006 At 0724 GMT", "MMMM d, y 'At' > HHmm 'GMT'", System.Globalization.CultureInfo("en-US")) Oh, that should read: import System System.DateTime.ParseExact("July 3, 2006 At 0724 GMT", "MMMM d, yyyy 'At' HHmm 'GMT'", System.Globalization.CultureInfo("en-US")) _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From snaury at gmail.com Mon Jul 17 20:18:22 2006 From: snaury at gmail.com (Snaury) Date: Mon, 17 Jul 2006 22:18:22 +0400 Subject: [IronPython] Bug in time.strptime? In-Reply-To: References: <664260580607030250i450da6c2j5f403d7d9eb229ae@mail.gmail.com> <664260580607041023h24d7aa9amaf72562faa69187c@mail.gmail.com> <4039D552ADAB094BB1EA670F3E96214E0445BB6E79@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: Apparently, after I tried to create a patch for this, I suddenly found that not only quoting of user text was the problem. Format for %d also was another problem, it seems it should be %x (otherwise ParseExact is looking for two numbers and fails). --- time.cs.orig Fri Jul 7 09:02:28 2006 +++ time.cs Mon Jul 17 22:15:20 2006 @@ -170,7 +170,10 @@ } else { string[] formats = new string[formatInfo.Count]; for (int i = 0; i < formatInfo.Count; i++) { - formats[i] = formatInfo[i].Text; + if(formatInfo[i].Type == FormatInfoType.UserText) { + formats[i] = "'" + formatInfo[i].Text + "'"; + } else + formats[i] = formatInfo[i].Text; } if (!DateTime.TryParseExact(@string, String.Join("", formats), null, DateTimeStyles.AllowWhiteSpaces, out res)) { >>> import System >>> System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo("en-US") >>> import time, datetime >>> d = time.strptime("July 3, 2006 At 0724 GMT", "%B %x, %Y At %H%M GMT") >>> print d 7/3/2006 7:24:00 AM On 7/17/06, Snaury wrote: > On 7/17/06, Snaury wrote: > > Hi Dino, > > > > It seems that you just need to use DateTime.ParseExact and wrap those > > random characters in single quotes and then it parses successfully. At > > least I did it in the clr way and it worked: > > > > import System > > System.DateTime.ParseExact("July 3, 2006 At 0724 GMT", "MMMM d, y 'At' > > HHmm 'GMT'", System.Globalization.CultureInfo("en-US")) > > Oh, that should read: > > import System > System.DateTime.ParseExact("July 3, 2006 At 0724 GMT", "MMMM d, yyyy > 'At' HHmm 'GMT'", System.Globalization.CultureInfo("en-US")) From snaury at gmail.com Mon Jul 17 20:30:12 2006 From: snaury at gmail.com (Snaury) Date: Mon, 17 Jul 2006 22:30:12 +0400 Subject: [IronPython] Bug in time.strptime? In-Reply-To: References: <664260580607030250i450da6c2j5f403d7d9eb229ae@mail.gmail.com> <664260580607041023h24d7aa9amaf72562faa69187c@mail.gmail.com> <4039D552ADAB094BB1EA670F3E96214E0445BB6E79@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: On 7/17/06, Snaury wrote: > >>> import System > >>> System.Threading.Thread.CurrentThread.CurrentCulture = > System.Globalization.CultureInfo("en-US") Btw, the fact that strptime doesn't use locale from module _locale (and I have to set current culture on my own), is it another bug or feature left for some future? From jsacksteder at gmail.com Mon Jul 17 20:32:10 2006 From: jsacksteder at gmail.com (jeff sacksteder) Date: Mon, 17 Jul 2006 14:32:10 -0400 Subject: [IronPython] data binding Message-ID: <51c8a7be0607171132m52c1fcfch8a81e2fd11274849@mail.gmail.com> Another tutorial opportunity for Michael. I have a DataGridView control containing data that needs to be flushed back into the original data source. I believe the following to be true: The DataGridView control is bound to the DataSet Object, which is bound to the DataAdapter, which connects to the DataSource. I need to call the Update() method of the DataAdapter to cause the changes to be written back to the database. Assuming I have a reference to the specific control, how do I find the related DataAdapter ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From zeleny02 at gmail.com Mon Jul 17 21:09:54 2006 From: zeleny02 at gmail.com (zeleny) Date: Mon, 17 Jul 2006 23:09:54 +0400 Subject: [IronPython] data binding In-Reply-To: <51c8a7be0607171132m52c1fcfch8a81e2fd11274849@mail.gmail.com> References: <51c8a7be0607171132m52c1fcfch8a81e2fd11274849@mail.gmail.com> Message-ID: <44BBE082.3020407@gmail.com> > Assuming I have a reference to the specific control, how do I find the > related DataAdapter ? There is no way to find the DataAdapter... just because you can use more than one DataAdapter to fill the DataSet/DataTable, e.g while merging two databases or migrating or smth else. From jsacksteder at gmail.com Mon Jul 17 21:23:06 2006 From: jsacksteder at gmail.com (jeff sacksteder) Date: Mon, 17 Jul 2006 15:23:06 -0400 Subject: [IronPython] data binding In-Reply-To: <44BBE082.3020407@gmail.com> References: <51c8a7be0607171132m52c1fcfch8a81e2fd11274849@mail.gmail.com> <44BBE082.3020407@gmail.com> Message-ID: <51c8a7be0607171223p503ca891k2033ebd8186b196c@mail.gmail.com> So how do I propagate my changes back, then? -------------- next part -------------- An HTML attachment was scrubbed... URL: From zeleny02 at gmail.com Mon Jul 17 21:51:22 2006 From: zeleny02 at gmail.com (zeleny) Date: Mon, 17 Jul 2006 23:51:22 +0400 Subject: [IronPython] data binding In-Reply-To: <51c8a7be0607171223p503ca891k2033ebd8186b196c@mail.gmail.com> References: <51c8a7be0607171132m52c1fcfch8a81e2fd11274849@mail.gmail.com> <44BBE082.3020407@gmail.com> <51c8a7be0607171223p503ca891k2033ebd8186b196c@mail.gmail.com> Message-ID: <44BBEA3A.1090302@gmail.com> > So how do I propagate my changes back, then? Hmm. DataSet dataSet; DataAdapter adapter; // configuring the adapter adapter.Fill (dataSet, "table1"); dataGridView1.DataSource = dataSet; dataGridView1.DataMember = "table1"; // changes to the datagridview adapter.Update (dataSet, "table1"); From jsacksteder at gmail.com Mon Jul 17 23:09:29 2006 From: jsacksteder at gmail.com (jeff sacksteder) Date: Mon, 17 Jul 2006 17:09:29 -0400 Subject: [IronPython] data binding In-Reply-To: <44BBEA3A.1090302@gmail.com> References: <51c8a7be0607171132m52c1fcfch8a81e2fd11274849@mail.gmail.com> <44BBE082.3020407@gmail.com> <51c8a7be0607171223p503ca891k2033ebd8186b196c@mail.gmail.com> <44BBEA3A.1090302@gmail.com> Message-ID: <51c8a7be0607171409lfca1238w15a4bccf0fbe9ddc@mail.gmail.com> Let me show a more specific example. How does the saveChanges method find a reference to the correct DataAdapter to call Update() upon? dataConn = OleDbConnection('provider=microsoft.jet.oledb.4.0;data source= cheeseshop.mdb;') cheese_sql = 'select * from cheese' my_DA = OleDbDataAdapter(cheese_sql,dataConn) my_DS = DataSet() my_DA.Fill(my_dsDS,'ds_cheese') my_BS = Forms.BindingSource(DataSource=my_DS.Tables['cheese']) def saveChanges(self,sender,event): # now what? #sender.?????.?????.Update() dgv = DataGridView(AutoGenerateColumns = True,DataSource = my_BS) dgv.DoubleClick += saveChanges -------------- next part -------------- An HTML attachment was scrubbed... URL: From zeleny02 at gmail.com Mon Jul 17 23:14:29 2006 From: zeleny02 at gmail.com (zeleny) Date: Tue, 18 Jul 2006 01:14:29 +0400 Subject: [IronPython] data binding In-Reply-To: <51c8a7be0607171409lfca1238w15a4bccf0fbe9ddc@mail.gmail.com> References: <51c8a7be0607171132m52c1fcfch8a81e2fd11274849@mail.gmail.com> <44BBE082.3020407@gmail.com> <51c8a7be0607171223p503ca891k2033ebd8186b196c@mail.gmail.com> <44BBEA3A.1090302@gmail.com> <51c8a7be0607171409lfca1238w15a4bccf0fbe9ddc@mail.gmail.com> Message-ID: <44BBFDB5.8080601@gmail.com> You have to save your my_DA somewhere. > dataConn = OleDbConnection('provider=microsoft.jet.oledb.4.0;data > source=cheeseshop.mdb ;') > cheese_sql = 'select * from cheese' > my_DA = OleDbDataAdapter(cheese_sql,dataConn) > my_DS = DataSet() > my_DA.Fill(my_dsDS,'ds_cheese') > my_BS = Forms.BindingSource(DataSource=my_DS.Tables['cheese']) > > def saveChanges(self,sender,event): > # now what? > #sender.?????.?????.Update() > > dgv = DataGridView(AutoGenerateColumns = True,DataSource = my_BS) > dgv.DoubleClick += saveChanges > From fuzzyman at voidspace.org.uk Tue Jul 18 01:36:24 2006 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 18 Jul 2006 00:36:24 +0100 Subject: [IronPython] data binding In-Reply-To: <51c8a7be0607171132m52c1fcfch8a81e2fd11274849@mail.gmail.com> References: <51c8a7be0607171132m52c1fcfch8a81e2fd11274849@mail.gmail.com> Message-ID: <44BC1EF8.1080008@voidspace.org.uk> jeff sacksteder wrote: > Another tutorial opportunity for Michael. > It's on the list, of course I'll have to learn about it first. :-) Luckily I work with some very talented folk... Michael http://www.voidspace.org.uk/python/index.shtml > I have a DataGridView control containing data that needs to be flushed > back into the original data source. I believe the following to be true: > > The DataGridView control is bound to the DataSet Object, which is > bound to the DataAdapter, which connects to the DataSource. > > I need to call the Update() method of the DataAdapter to cause the > changes to be written back to the database. > > Assuming I have a reference to the specific control, how do I find the > related DataAdapter ? > > ------------------------------------------------------------------------ > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From dingyi.lin at gmail.com Tue Jul 18 11:03:28 2006 From: dingyi.lin at gmail.com (peter lin) Date: Tue, 18 Jul 2006 17:03:28 +0800 Subject: [IronPython] Can not use httplib in ironpython beta9? Message-ID: <4a8b0de20607180203p33ecdc9au9d021dd76e527d6a@mail.gmail.com> After reading the tutorial I think it's ok to use httplib, so I write a test code to test it with ipy. I just cannot let it run ok with ipy. Is something wrong I have done? My test code as follows import sys sys.path.append(r"c:\python24\lib") import httplib conn = httplib.HTTPConnection('www.pchome.com.tw') conn.request("GET", "/index.html") r1 = conn.getresponse() if r1.status==200: print r1.read() Here is the error I found when use ipy.exe Traceback (most recent call last): File c:\dev_tool\IronPython-1.0-Beta9\rsslibtest.py, line 23, in Initialize File c:\python24\lib\httplib.py, line 810, in request File c:\python24\lib\httplib.py, line 821, in _send_request File c:\python24\lib\httplib.py, line 752, in putrequest File , line 0, in Encode##71 LookupError: unknown encoding: idna but it runs ok and gets the response when i use python.exe to run my test py code (remove two lines import sys sys.path.append(r"c:\python24\lib") -------------- next part -------------- An HTML attachment was scrubbed... URL: From joesox at gmail.com Tue Jul 18 15:14:50 2006 From: joesox at gmail.com (JoeSox) Date: Tue, 18 Jul 2006 06:14:50 -0700 Subject: [IronPython] ConceptNetUtils (CNU) version 2 Message-ID: <785694cd0607180614v391415cehe0ed0ba96f7b3864@mail.gmail.com> This article and Visual Studio 2005 project that I recently posted online may further explain some of the questions I have been asking on this list. It demonstrates my need for speed from IronPython. I also believe it's a good example of IronPython's usefulness. Thanks! http://codeproject.com/useritems/cnu2.asp -- Later, Joe From xmlhacker at gmail.com Tue Jul 18 17:32:21 2006 From: xmlhacker at gmail.com (M. David Peterson) Date: Tue, 18 Jul 2006 09:32:21 -0600 Subject: [IronPython] Can not use httplib in ironpython beta9? In-Reply-To: <4a8b0de20607180203p33ecdc9au9d021dd76e527d6a@mail.gmail.com> References: <4a8b0de20607180203p33ecdc9au9d021dd76e527d6a@mail.gmail.com> Message-ID: If you attempt to import encodings.idna, it seems as if the unicodedata module is the missing piece. The ever resourceful Seo Sanghyeon comes to the rescue yet again > http://lists.ironpython.com/pipermail/users-ironpython.com/2006-July/002819.html< Unfortunately > AttributeError: 'module' object has no attribute 'unidata_version' < seems to be standing in the way of any sort of success at present time. Seems to be standing in the way On 7/18/06, peter lin wrote: > > After reading the tutorial I think it's ok to use httplib, so I write a > test code > to test it with ipy. > I just cannot let it run ok with ipy. > Is something wrong I have done? > > My test code as follows > > import sys > sys.path.append(r"c:\python24\lib") > import httplib > conn = httplib.HTTPConnection('www.pchome.com.tw') > conn.request("GET", "/index.html") > r1 = conn.getresponse() > if r1.status==200: > print r1.read() > > Here is the error I found when use ipy.exe > > Traceback (most recent call last): > File c:\dev_tool\IronPython-1.0-Beta9\rsslibtest.py , line 23, in > Initialize > File c:\python24\lib\httplib.py, line 810, in request > File c:\python24\lib\httplib.py, line 821, in _send_request > File c:\python24\lib\httplib.py, line 752, in putrequest > File , line 0, in Encode##71 > LookupError: unknown encoding: idna > > but it runs ok and gets the response when i use python.exe to run my test > py code > (remove two lines > import sys > sys.path.append(r"c:\python24\lib") > > > > > > _______________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From xmlhacker at gmail.com Tue Jul 18 17:39:32 2006 From: xmlhacker at gmail.com (M. David Peterson) Date: Tue, 18 Jul 2006 09:39:32 -0600 Subject: [IronPython] Can not use httplib in ironpython beta9? In-Reply-To: References: <4a8b0de20607180203p33ecdc9au9d021dd76e527d6a@mail.gmail.com> Message-ID: uh, minus the second "Seems to be standing in the way"... not sure how that got tagged onto the end. Must have been between thoughts when I hit send. On 7/18/06, M. David Peterson wrote: > > If you attempt to import encodings.idna, it seems as if the unicodedata > module is the missing piece. The ever resourceful Seo Sanghyeon comes to > the rescue yet again > > http://lists.ironpython.com/pipermail/users-ironpython.com/2006-July/002819.html< > > Unfortunately > AttributeError: 'module' object has no attribute > 'unidata_version' < seems to be standing in the way of any sort of success > at present time. > > Seems to be standing in the way > > On 7/18/06, peter lin wrote: > > > After reading the tutorial I think it's ok to use httplib, so I write a > test code > to test it with ipy. > I just cannot let it run ok with ipy. > Is something wrong I have done? > > My test code as follows > > import sys > sys.path.append(r"c:\python24\lib") > import httplib > conn = httplib.HTTPConnection(' www.pchome.com.tw') > conn.request("GET", "/index.html") > r1 = conn.getresponse() > if r1.status==200: > print r1.read() > > Here is the error I found when use ipy.exe > > Traceback (most recent call last): > File c:\dev_tool\IronPython-1.0-Beta9\rsslibtest.py , line 23, in > Initialize > File c:\python24\lib\httplib.py, line 810, in request > File c:\python24\lib\httplib.py, line 821, in _send_request > File c:\python24\lib\httplib.py, line 752, in putrequest > File , line 0, in Encode##71 > LookupError: unknown encoding: idna > > but it runs ok and gets the response when i use python.exe to run my test > py code > (remove two lines > import sys > sys.path.append(r"c:\python24\lib") > > > > > > _______________________________________________ > 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 > -- /M:D M. David Peterson http://mdavid.name | http://www.oreillynet.com/pub/au/2354 -------------- next part -------------- An HTML attachment was scrubbed... URL: From dingyi.lin at gmail.com Tue Jul 18 19:02:20 2006 From: dingyi.lin at gmail.com (peter lin) Date: Wed, 19 Jul 2006 01:02:20 +0800 Subject: [IronPython] Can not use httplib in ironpython beta9? In-Reply-To: References: <4a8b0de20607180203p33ecdc9au9d021dd76e527d6a@mail.gmail.com> Message-ID: <4a8b0de20607181002i20e2b35fkf95a6e29456674b@mail.gmail.com> It seems the method getaddrinfo() is not currently implemented. I test another module urllib, which uses httplib. import sys sys.path.append(r"c:\python24\lib") import urllib data = urllib.urlopen('http://www.google.com').read() print data See the error as follows. Traceback (most recent call last): File c:\dev_tool\IronPython-1.0-Beta9\rsslibtest.py, line 37, in Initialize File c:\python24\lib\urllib.py, line 82, in urlopen File c:\python24\lib\urllib.py, line 194, in open File c:\python24\lib\urllib.py, line 313, in open_http File c:\python24\lib\httplib.py, line 798, in endheaders File c:\python24\lib\httplib.py, line 679, in _send_output File c:\python24\lib\httplib.py, line 646, in send File c:\python24\lib\httplib.py, line 613, in connect File , line 0, in GetAddrInfo##120 NotImplementedError: getaddrinfo() is not currently implemented I test it with python.exe , it works. So, actually, Is it ok to use all python standard library with ipy? 2006/7/18, M. David Peterson : > > uh, minus the second "Seems to be standing in the way"... not sure how > that got tagged onto the end. Must have been between thoughts when I hit > send. > > > On 7/18/06, M. David Peterson wrote: > > > > If you attempt to import encodings.idna, it seems as if the unicodedata > > module is the missing piece. The ever resourceful Seo Sanghyeon comes > > to the rescue yet again > > > http://lists.ironpython.com/pipermail/users-ironpython.com/2006-July/002819.html< > > > > Unfortunately > AttributeError: 'module' object has no attribute > > 'unidata_version' < seems to be standing in the way of any sort of success > > at present time. > > > > Seems to be standing in the way > > > > On 7/18/06, peter lin < dingyi.lin at gmail.com> wrote: > > > > > After reading the tutorial I think it's ok to use httplib, so I write > > a test code > > to test it with ipy. > > I just cannot let it run ok with ipy. > > Is something wrong I have done? > > > > My test code as follows > > > > import sys > > sys.path.append(r"c:\python24\lib") > > import httplib > > conn = httplib.HTTPConnection(' www.pchome.com.tw') > > conn.request("GET", "/index.html") > > r1 = conn.getresponse() > > if r1.status==200: > > print r1.read() > > > > Here is the error I found when use ipy.exe > > > > Traceback (most recent call last): > > File c:\dev_tool\IronPython-1.0-Beta9\rsslibtest.py , line 23, in > > Initialize > > File c:\python24\lib\httplib.py, line 810, in request > > File c:\python24\lib\httplib.py, line 821, in _send_request > > File c:\python24\lib\httplib.py, line 752, in putrequest > > File , line 0, in Encode##71 > > LookupError: unknown encoding: idna > > > > but it runs ok and gets the response when i use python.exe to run my > > test py code > > (remove two lines > > import sys > > sys.path.append(r"c:\python24\lib") > > > > > > > > > > > > _______________________________________________ > > 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 > > > > > > -- > /M:D > > M. David Peterson > http://mdavid.name | http://www.oreillynet.com/pub/au/2354 > > _______________________________________________ > 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 t-bruch at microsoft.com Tue Jul 18 19:20:53 2006 From: t-bruch at microsoft.com (Bruce Christensen) Date: Tue, 18 Jul 2006 10:20:53 -0700 Subject: [IronPython] Can not use httplib in ironpython beta9? In-Reply-To: <4a8b0de20607181002i20e2b35fkf95a6e29456674b@mail.gmail.com> References: <4a8b0de20607180203p33ecdc9au9d021dd76e527d6a@mail.gmail.com> <4a8b0de20607181002i20e2b35fkf95a6e29456674b@mail.gmail.com> Message-ID: <3581AA168D87A2479D88EA319BDF7D32E83A5C@RED-MSG-80.redmond.corp.microsoft.com> Peter, Sorry for the trouble. This is a known issue that we're tracking in our bug database at http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkIt emId=548. For a full explanation of the situation, see http://lists.ironpython.com/pipermail/users-ironpython.com/2006-June/002 605.html. To answer your second question: most, but not all, of the Python standard library works with IronPython. We're working to support as much of it as possible, but there are still areas that are missing functionality, as you have discovered. If you run into any other problems, please let us know so that we can prioritize our work accordingly. --Bruce From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of peter lin Sent: Tuesday, July 18, 2006 10:02 AM To: Discussion of IronPython Subject: Re: [IronPython] Can not use httplib in ironpython beta9? It seems the method getaddrinfo() is not currently implemented. I test another module urllib, which uses httplib. import sys sys.path.append(r"c:\python24\lib") import urllib data = urllib.urlopen ('http://www.google.com').read() print data See the error as follows. Traceback (most recent call last): File c:\dev_tool\IronPython-1.0-Beta9\rsslibtest.py , line 37, in Initialize File c:\python24\lib\urllib.py, line 82, in urlopen File c:\python24\lib\urllib.py, line 194, in open File c:\python24\lib\urllib.py, line 313, in open_http File c:\python24\lib\httplib.py, line 798, in endheaders File c:\python24\lib\httplib.py, line 679, in _send_output File c:\python24\lib\httplib.py, line 646, in send File c:\python24\lib\httplib.py, line 613, in connect File , line 0, in GetAddrInfo##120 NotImplementedError: getaddrinfo() is not currently implemented I test it with python.exe , it works. So, actually, Is it ok to use all python standard library with ipy? -------------- next part -------------- An HTML attachment was scrubbed... URL: From dingyi.lin at gmail.com Tue Jul 18 20:30:34 2006 From: dingyi.lin at gmail.com (peter lin) Date: Wed, 19 Jul 2006 02:30:34 +0800 Subject: [IronPython] Can not use httplib in ironpython beta9? In-Reply-To: <3581AA168D87A2479D88EA319BDF7D32E83A5C@RED-MSG-80.redmond.corp.microsoft.com> References: <4a8b0de20607180203p33ecdc9au9d021dd76e527d6a@mail.gmail.com> <4a8b0de20607181002i20e2b35fkf95a6e29456674b@mail.gmail.com> <3581AA168D87A2479D88EA319BDF7D32E83A5C@RED-MSG-80.redmond.corp.microsoft.com> Message-ID: <4a8b0de20607181130q2459d101kbab1ca960fb53d19@mail.gmail.com> Hello Bruce, Thanks for the reference, I just read it. Sorry for asking the same question again. This helps. Thanks a lot. Best regards Peter 2006/7/19, Bruce Christensen : > > Peter, > > > > Sorry for the trouble. This is a known issue that we're tracking in our > bug database at > http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkItemId=548 > . > > > > For a full explanation of the situation, see > http://lists.ironpython.com/pipermail/users-ironpython.com/2006-June/002605.html > . > > > > To answer your second question: most, but not all, of the Python standard > library works with IronPython. We're working to support as much of it as > possible, but there are still areas that are missing functionality, as you > have discovered. If you run into any other problems, please let us know so > that we can prioritize our work accordingly. > > > > --Bruce > > > > * > * > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dingyi.lin at gmail.com Tue Jul 18 20:37:05 2006 From: dingyi.lin at gmail.com (peter lin) Date: Wed, 19 Jul 2006 02:37:05 +0800 Subject: [IronPython] Can not use httplib in ironpython beta9? In-Reply-To: <4a8b0de20607181130q2459d101kbab1ca960fb53d19@mail.gmail.com> References: <4a8b0de20607180203p33ecdc9au9d021dd76e527d6a@mail.gmail.com> <4a8b0de20607181002i20e2b35fkf95a6e29456674b@mail.gmail.com> <3581AA168D87A2479D88EA319BDF7D32E83A5C@RED-MSG-80.redmond.corp.microsoft.com> <4a8b0de20607181130q2459d101kbab1ca960fb53d19@mail.gmail.com> Message-ID: <4a8b0de20607181137n24d1ba41hc5634c72e7513623@mail.gmail.com> >From the article I just read, you reimplement almost all python standard library in dot.net 2.0, is that right? It's a unbelievably huge job. Big thank to you guys there. Best regards Peter 2006/7/19, peter lin : > > Hello Bruce, > Thanks for the reference, I just read it. > Sorry for asking the same question again. > This helps. > Thanks a lot. > > Best regards Peter > > 2006/7/19, Bruce Christensen : > > > Peter, > > > > > > > > Sorry for the trouble. This is a known issue that we're tracking in our > > bug database at http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkItemId=548 > > . > > > > > > > > For a full explanation of the situation, see > > http://lists.ironpython.com/pipermail/users-ironpython.com/2006-June/002605.html > > . > > > > > > > > To answer your second question: most, but not all, of the Python > > standard library works with IronPython. We're working to support as much of > > it as possible, but there are still areas that are missing functionality, as > > you have discovered. If you run into any other problems, please let us know > > so that we can prioritize our work accordingly. > > > > > > > > --Bruce > > > > > > > > * > > * > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jvm_cop at spamcop.net Tue Jul 18 23:13:18 2006 From: jvm_cop at spamcop.net (J. Merrill) Date: Tue, 18 Jul 2006 17:13:18 -0400 Subject: [IronPython] Can not use httplib in ironpython beta9? In-Reply-To: <4a8b0de20607181137n24d1ba41hc5634c72e7513623@mail.gmail.co m> References: <4a8b0de20607180203p33ecdc9au9d021dd76e527d6a@mail.gmail.com> <4a8b0de20607181002i20e2b35fkf95a6e29456674b@mail.gmail.com> <3581AA168D87A2479D88EA319BDF7D32E83A5C@RED-MSG-80.redmond.corp.microsoft.com> <4a8b0de20607181130q2459d101kbab1ca960fb53d19@mail.gmail.com> <4a8b0de20607181137n24d1ba41hc5634c72e7513623@mail.gmail.com> Message-ID: <7.0.1.0.2.20060718170308.06c7fea0@wheresmymailserver.com> One nice thing about the Python community (as distinct from some others I know of) is that Python coders are quite happy to use the code someone else wrote -- so having the Python language implementation "solid" is a big part of the battle. The IronPython team somewhat "cheated" and "just" made a good enough implementation of the language so that the Python standard library modules that are written in Python (that's quite a lot of them) work as their authors intended. The team has had to write some of modules from scratch, using .Net APIs, however. The hard part has been getting implementations of the lower-level standard libraries that aren't written in Python (e.g. socket) that are oft-used by other stdlib modules. There, the community has helped (Sanghyeon Seo getting 4+ stars for his work). Make sure you look at the code he's written. At 02:37 PM 7/18/2006, peter lin wrote >>From the article I just read, you reimplement almost all python standard library >in dot.net 2.0, is that right? >It's a unbelievably huge job. Big thank to you guys there. > >Best regards Peter J. Merrill / Analytical Software Corp -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark at centurysoftware.com.au Wed Jul 19 02:35:13 2006 From: mark at centurysoftware.com.au (Mark Rees) Date: Wed, 19 Jul 2006 10:35:13 +1000 Subject: [IronPython] Can not use httplib in ironpython beta9? Message-ID: <44BD7E41.2010805@centurysoftware.com.au> peter lin wrote: "It seems the method getaddrinfo() is not currently implemented. I test another module urllib, which uses httplib." I had a similar problem but thanks to our friend Seo Sanghyeon, there is a possible solution until the IronPython socket module supports getaddrinfo(). I have documented it at: http://hex-dump.blogspot.com/2006/07/overriding-ironpythons-built-in.html And it means the urllib example peter gave will work: import urllib data = urllib.urlopen('http://www.google.com').read( ) print data Regards Mark From sanxiyn at gmail.com Wed Jul 19 04:22:52 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Wed, 19 Jul 2006 11:22:52 +0900 Subject: [IronPython] CodePlex dump update Message-ID: <5b0248170607181922w56ab4556q716df982ea1cfb08@mail.gmail.com> This post updates: http://lists.ironpython.com/pipermail/users-ironpython.com/2006-June/002524.html CodePlex dump, aka poor man's TFS client. :-) As I will be offline for a while starting from tomorrow, I stopped procrastinating and set up automated cronjob for my CodePlex dump. Reorganized directory layout again. Sorry. It can be now found at: http://sparcs.kaist.ac.kr/~tinuviel/codeplex/ Update interval is 1 hour. It doesn't download any files if it doesn't find new revisions. It can be used to track CodePlex projects other than IronPython. If you do so, I am interested in your experience. Changes since the initial version: * Prepended 0 to revision before 1000 to sort. Script used: http://sparcs.kaist.ac.kr/~tinuviel/fepy/util/rename3to4.py * Fixed off by one bug in the download routine. * If the last downloaded version is present in Source Code tab, avoid downloading by incrementing revision number. * Fixes to make everything automated. Shell script to compare two revisions: http://sparcs.kaist.ac.kr/~tinuviel/codeplex/IronPython/zipdiff Usage: "zipdiff 1000 1100" will show what files are changed, and how many lines. "zipdiff -v 1000 1100" will show the actual difference. Seo Sanghyeon From sanxiyn at gmail.com Wed Jul 19 09:18:14 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Wed, 19 Jul 2006 16:18:14 +0900 Subject: [IronPython] Latest IronPython on Mono Message-ID: <5b0248170607190018t7c5f5c27jcef6a4580757ad20@mail.gmail.com> The latest source from CodePlex fails to compile on Mono with: IronPython/Runtime/Operations/Ops.cs(1336,13): error CS0411: The type arguments for method `AddRange' cannot be infered from the usage. Try specifying the type arguments explicitly. IronPython/Runtime/Operations/Ops.cs(1413,13): error CS0411: The type arguments for method `AddRange' cannot be infered from the usage. Try specifying the type arguments explicitly. A simple workaround is attached. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: mono-workaround.txt URL: From sanxiyn at gmail.com Wed Jul 19 10:47:06 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Wed, 19 Jul 2006 17:47:06 +0900 Subject: [IronPython] Standard encodings Message-ID: <5b0248170607190147y2e7dba52s48ad2c5ad4f960c8@mail.gmail.com> IronPython doesn't load standard encodings. CPython implicitly tries to import encodings/__init__.py on first codecs lookup, and this registers codecs search function which imports encodings/.py on demand. Any ImportError is ignored. A simple workaround is to have "import encodings" in site.py. After the import IronPython behaves the same. Python 2.4.4c0 (#2, Jun 14 2006, 22:35:41) [GCC 4.1.2 20060613 (prerelease) (Debian 4.1.1-4)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> 'Python'.encode('rot13') 'Clguba' IronPython 1.0.2391 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> 'Python'.encode('rot13') Traceback (most recent call last): LookupError: unknown encoding: rot13 >>> import encodings >>> 'Python'.encode('rot13') 'Clguba' Seo Sanghyeon From sanxiyn at gmail.com Wed Jul 19 11:01:07 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Wed, 19 Jul 2006 18:01:07 +0900 Subject: [IronPython] unicodedata for IronPython update Message-ID: <5b0248170607190201x5efe002fy6dbcf3400f535b5f@mail.gmail.com> Motiviated by this post, http://lists.ironpython.com/pipermail/users-ironpython.com/2006-July/002882.html I added unidata_version and normalize to my unicodedata module. http://sparcs.kaist.ac.kr/~tinuviel/fepy/lib/unicodedata.py Unfortunately, encodings.idna needs bidirectional() function, which I couldn't find a simple .NET equivalent. Seo Sanghyeon From dingyi.lin at gmail.com Wed Jul 19 17:36:50 2006 From: dingyi.lin at gmail.com (peter lin) Date: Wed, 19 Jul 2006 23:36:50 +0800 Subject: [IronPython] Cannot use logging module with ipy? Message-ID: <4a8b0de20607190836t3d173a80q1dcf2fe2c907d0d2@mail.gmail.com> Dear Sir, I test the logging module with ipy import sys sys.path.append(r"c:\python24\lib") import logging f=logging.FileHandler('c:\\test55.log') #formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s") #add formatter to ch #f.setFormatter(formatter) logger = logging.getLogger("test") logger.addHandler(f) logger.setLevel(logging.DEBUG) logger.debug('The Yankees needs no.5 starter!') find the error as follows. Traceback (most recent call last): File c:\dev_tool\IronPython-1.0-Beta9\rsslibtest.py, line 50, in Initialize File __init__, line unknown, in debug File c:\python24\lib\logging\__init__.py, line 955, in debug File c:\python24\lib\logging\__init__.py, line 1072, in _log File c:\python24\lib\logging\__init__.py, line 1047, in findCaller File , line 0, in _getframe##96 ValueError: _getframe is not implemented Test it in python, it runs ok. I guess it's another python standard library not yet to find its way to ipy. -------------- next part -------------- An HTML attachment was scrubbed... URL: From xmlhacker at gmail.com Wed Jul 19 18:42:42 2006 From: xmlhacker at gmail.com (M. David Peterson) Date: Wed, 19 Jul 2006 10:42:42 -0600 Subject: [IronPython] Cannot use logging module with ipy? In-Reply-To: <4a8b0de20607190836t3d173a80q1dcf2fe2c907d0d2@mail.gmail.com> References: <4a8b0de20607190836t3d173a80q1dcf2fe2c907d0d2@mail.gmail.com> Message-ID: This ones easy... > logger.debug('The Yankees needs no.5 starter!') Anytime you mention the "Y" word inside of software developed by Mariners fans is going to cause "problems" ;) DISCLAIMER: Just in case, this is COMPLETELY, 100% *not true*. In other words, it's a joke of which to understand requires an understanding of the history between the Seattle Mariners and New York Yankees. On 7/19/06, peter lin wrote: > > Dear Sir, > I test the logging module with ipy > > import sys > sys.path.append(r"c:\python24\lib") > import logging > > f=logging.FileHandler('c:\\test55.log') > #formatter = logging.Formatter ("%(asctime)s - %(name)s - %(levelname)s - > %(message)s") > #add formatter to ch > #f.setFormatter(formatter) > logger = logging.getLogger("test") > logger.addHandler(f) > logger.setLevel(logging.DEBUG ) > logger.debug('The Yankees needs no.5 starter!') > > find the error as follows. > Traceback (most recent call last): > File c:\dev_tool\IronPython-1.0-Beta9\rsslibtest.py, line 50, in > Initialize > File __init__, line unknown, in debug > File c:\python24\lib\logging\__init__.py, line 955, in debug > File c:\python24\lib\logging\__init__.py, line 1072, in _log > File c:\python24\lib\logging\__init__.py, line 1047, in findCaller > File , line 0, in _getframe##96 > ValueError: _getframe is not implemented > > Test it in python, it runs ok. > > I guess it's another python standard library not yet to find its way to > ipy. > > > _______________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From xmlhacker at gmail.com Wed Jul 19 19:16:31 2006 From: xmlhacker at gmail.com (M. David Peterson) Date: Wed, 19 Jul 2006 11:16:31 -0600 Subject: [IronPython] unicodedata for IronPython update In-Reply-To: <5b0248170607190201x5efe002fy6dbcf3400f535b5f@mail.gmail.com> References: <5b0248170607190201x5efe002fy6dbcf3400f535b5f@mail.gmail.com> Message-ID: :D Very cool :D Thanks Seo! Quick question: Do you happen to know of any success stories in regards to getting ClickOnce apps running on Mono? BTW... I noticed your post regarding your "off-line" status starting tomorrow... Enjoy your *well deserved* rest! Your efforts on this list/project are nothing short of inspiring. Thanks :) You'll be missed, without a doubt! On 7/19/06, Sanghyeon Seo wrote: > > Motiviated by this post, > > http://lists.ironpython.com/pipermail/users-ironpython.com/2006-July/002882.html > > I added unidata_version and normalize to my unicodedata module. > http://sparcs.kaist.ac.kr/~tinuviel/fepy/lib/unicodedata.py > > Unfortunately, encodings.idna needs bidirectional() function, which I > couldn't find a simple .NET equivalent. > > Seo Sanghyeon > _______________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jsacksteder at gmail.com Wed Jul 19 19:28:30 2006 From: jsacksteder at gmail.com (jeff sacksteder) Date: Wed, 19 Jul 2006 13:28:30 -0400 Subject: [IronPython] missing method in datagridview? Message-ID: <51c8a7be0607191028p166dc44ei9aad0701d12b7143@mail.gmail.com> I have a DataGridViewCollumnCollection that appears to not have an "Item" attribute. The "Count" attribute = 0, which I don't understand either. Is this missing functionallity or am I missing something? Excepting this, everything in my app works correctly. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Wed Jul 19 19:40:25 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 19 Jul 2006 10:40:25 -0700 Subject: [IronPython] missing method in datagridview? In-Reply-To: <51c8a7be0607191028p166dc44ei9aad0701d12b7143@mail.gmail.com> References: <51c8a7be0607191028p166dc44ei9aad0701d12b7143@mail.gmail.com> Message-ID: <7AD436E4270DD54A94238001769C22272B9919E520@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Can you access the DataGridViewColumnCollection via indexers (eg myDataGridCollection[0] ? ) We use the same mapping for Item that C# uses - as long as item is the "default" item. If it's not a default item I think we might have a bug in Beta 9 where we don't make this visible (I'm working on a fix for this today). If Count is zero then presumably there's no items in the collection. Is that possible? From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of jeff sacksteder Sent: Wednesday, July 19, 2006 10:29 AM To: users at lists.ironpython.com Subject: [IronPython] missing method in datagridview? I have a DataGridViewCollumnCollection that appears to not have an "Item" attribute. The "Count" attribute = 0, which I don't understand either. Is this missing functionallity or am I missing something? Excepting this, everything in my app works correctly. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Wed Jul 19 19:45:06 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 19 Jul 2006 10:45:06 -0700 Subject: [IronPython] Cannot use logging module with ipy? In-Reply-To: References: <4a8b0de20607190836t3d173a80q1dcf2fe2c907d0d2@mail.gmail.com> Message-ID: <7AD436E4270DD54A94238001769C22272B9919E528@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Not being a sports fan I can't comment on the tension between the Yankees and Mariners, but we definitely don't have an implementation of sys._getframe which is the problem. While sys._getframe isn't as big as an entire standard module, it certainly is nearly as tricky to implement. Unfortunately we don't expect to get _getframe implemented for v1.0 - but we do have a bug to implement this after 1.0 on CodePlex (http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkItemId=1042 ). From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of M. David Peterson Sent: Wednesday, July 19, 2006 9:43 AM To: Discussion of IronPython Subject: Re: [IronPython] Cannot use logging module with ipy? This ones easy... > logger.debug('The Yankees needs no.5 starter!') Anytime you mention the "Y" word inside of software developed by Mariners fans is going to cause "problems" ;) DISCLAIMER: Just in case, this is COMPLETELY, 100% *not true*. In other words, it's a joke of which to understand requires an understanding of the history between the Seattle Mariners and New York Yankees. On 7/19/06, peter lin > wrote: Dear Sir, I test the logging module with ipy import sys sys.path.append(r"c:\python24\lib") import logging f=logging.FileHandler('c:\\test55.log') #formatter = logging.Formatter ("%(asctime)s - %(name)s - %(levelname)s - %(message)s") #add formatter to ch #f.setFormatter(formatter) logger = logging.getLogger("test") logger.addHandler(f) logger.setLevel(logging.DEBUG ) logger.debug('The Yankees needs no.5 starter!') find the error as follows. Traceback (most recent call last): File c:\dev_tool\IronPython-1.0-Beta9\rsslibtest.py, line 50, in Initialize File __init__, line unknown, in debug File c:\python24\lib\logging\__init__.py, line 955, in debug File c:\python24\lib\logging\__init__.py, line 1072, in _log File c:\python24\lib\logging\__init__.py, line 1047, in findCaller File , line 0, in _getframe##96 ValueError: _getframe is not implemented Test it in python, it runs ok. I guess it's another python standard library not yet to find its way to ipy. _______________________________________________ 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jsacksteder at gmail.com Wed Jul 19 19:45:15 2006 From: jsacksteder at gmail.com (jeff sacksteder) Date: Wed, 19 Jul 2006 13:45:15 -0400 Subject: [IronPython] missing method in datagridview? In-Reply-To: <7AD436E4270DD54A94238001769C22272B9919E520@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <51c8a7be0607191028p166dc44ei9aad0701d12b7143@mail.gmail.com> <7AD436E4270DD54A94238001769C22272B9919E520@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <51c8a7be0607191045p21ac6206n6134288d54d375c8@mail.gmail.com> > > If Count is zero then presumably there's no items in the collection. Is > that possible? > In this instance, I have three columns bound to a DataSet, and a button column that I Add()-ed. "Count" only says I have 1 Column. The bound columns do not appear to count. I even tried moving the count statement after the control was added to it's parent, thinking perhaps that was when the databinding actually occurred. No change. -------------- next part -------------- An HTML attachment was scrubbed... URL: From joesox at gmail.com Wed Jul 19 19:47:20 2006 From: joesox at gmail.com (JoeSox) Date: Wed, 19 Jul 2006 10:47:20 -0700 Subject: [IronPython] Dict convertion question Message-ID: <785694cd0607191047u73561f4q1466e37a906375d6@mail.gmail.com> I'm interested in storing a large Dict in a text file. What I am trying to figure out what be the best way on creating the Dict from the text file. I see Converter.ConvertToValueType but I don't understand how to construct the RuntimeTypeHandle to see if that would work. But I am thinking I need to create a custom method to handle this conversion. Does anyone else have any ideas or point me in a direction I don't see right now? Thanks. -- Later, Joe From xmlhacker at gmail.com Wed Jul 19 19:53:19 2006 From: xmlhacker at gmail.com (M. David Peterson) Date: Wed, 19 Jul 2006 11:53:19 -0600 Subject: [IronPython] Cannot use logging module with ipy? In-Reply-To: <7AD436E4270DD54A94238001769C22272B9919E528@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <4a8b0de20607190836t3d173a80q1dcf2fe2c907d0d2@mail.gmail.com> <7AD436E4270DD54A94238001769C22272B9919E528@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: Actually, with the current state of affairs in regards to the Mariners over the past few season, I, a) Don't blame you for not being a fan b) Don't think the tension still exists c) Am grateful that the things you are interested in have to do with building such a killer app as IronPython. :) While I am still learning the Python language, I am loving every minute of it because of IP. Gracias! :D On 7/19/06, Dino Viehland wrote: > > Not being a sports fan I can't comment on the tension between the Yankees > and Mariners, but we definitely don't have an implementation of > sys._getframe which is the problem. While sys._getframe isn't as big as an > entire standard module, it certainly is nearly as tricky to implement. > Unfortunately we don't expect to get _getframe implemented for v1.0 ? but > we do have a bug to implement this after 1.0 on CodePlex ( > http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkItemId=1042). > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *M. David Peterson > *Sent:* Wednesday, July 19, 2006 9:43 AM > *To:* Discussion of IronPython > *Subject:* Re: [IronPython] Cannot use logging module with ipy? > > > > This ones easy... > > > logger.debug('The Yankees needs no.5 starter!') > > Anytime you mention the "Y" word inside of software developed by Mariners > fans is going to cause "problems" ;) > > DISCLAIMER: Just in case, this is COMPLETELY, 100% *not true*. In other > words, it's a joke of which to understand requires an understanding of the > history between the Seattle Mariners and New York Yankees. > > On 7/19/06, *peter lin* wrote: > > Dear Sir, > I test the logging module with ipy > > import sys > sys.path.append(r"c:\python24\lib") > import logging > > f=logging.FileHandler('c:\\test55.log') > #formatter = logging.Formatter ("%(asctime)s - %(name)s - %(levelname)s - > %(message)s") > #add formatter to ch > #f.setFormatter(formatter) > logger = logging.getLogger("test") > logger.addHandler(f) > logger.setLevel(logging.DEBUG ) > logger.debug('The Yankees needs no.5 starter!') > > find the error as follows. > Traceback (most recent call last): > File c:\dev_tool\IronPython-1.0-Beta9\rsslibtest.py, line 50, in > Initialize > File __init__, line unknown, in debug > File c:\python24\lib\logging\__init__.py, line 955, in debug > File c:\python24\lib\logging\__init__.py, line 1072, in _log > File c:\python24\lib\logging\__init__.py, line 1047, in findCaller > File , line 0, in _getframe##96 > ValueError: _getframe is not implemented > > Test it in python, it runs ok. > > I guess it's another python standard library not yet to find its way to > ipy. > > > > _______________________________________________ > 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 > > _______________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From arman at twinsun.com Wed Jul 19 19:54:02 2006 From: arman at twinsun.com (Arman Bostani) Date: Wed, 19 Jul 2006 10:54:02 -0700 Subject: [IronPython] Cannot use logging module with ipy? In-Reply-To: <7AD436E4270DD54A94238001769C22272B9919E528@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <4a8b0de20607190836t3d173a80q1dcf2fe2c907d0d2@mail.gmail.com> <7AD436E4270DD54A94238001769C22272B9919E528@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <44BE71BA.3000507@twinsun.com> Peter, As a hack, you can get logging working as follows: import logging logging._srcfile = None -arman Dino Viehland wrote: > Not being a sports fan I can?t comment on the tension between the > Yankees and Mariners, but we definitely don?t have an implementation of > sys._getframe which is the problem. While sys._getframe isn?t as big as > an entire standard module, it certainly is nearly as tricky to > implement. Unfortunately we don?t expect to get _getframe implemented > for v1.0 ? but we do have a bug to implement this after 1.0 on CodePlex > (http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkItemId=1042 > > ). From jsacksteder at gmail.com Wed Jul 19 19:57:11 2006 From: jsacksteder at gmail.com (jeff sacksteder) Date: Wed, 19 Jul 2006 13:57:11 -0400 Subject: [IronPython] missing method in datagridview? In-Reply-To: <7AD436E4270DD54A94238001769C22272B9919E520@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <51c8a7be0607191028p166dc44ei9aad0701d12b7143@mail.gmail.com> <7AD436E4270DD54A94238001769C22272B9919E520@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <51c8a7be0607191057l64361bben86f8d47feb5f2d97@mail.gmail.com> > > Can you access the DataGridViewColumnCollection via indexers (eg > myDataGridCollection[0] ? ) > Yes. dgv = DataGridView(AutoGenerateColumns = True,DataSource = myBindingSource) myCol = DataGridViewButtonColumn(Text="Spaminate",Name="ButtonCol",UseColumnTextForButtonValue = True) dgv.Columns.Add(myCol) ) #works, returns myCol print dgv.Columns[0] #fails print dgv.Columns[1] #fails print dgv.Columns['ButtonCol'] #fails print dgv.Columns.Item['ButtonCol'] -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Wed Jul 19 20:04:00 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 19 Jul 2006 11:04:00 -0700 Subject: [IronPython] missing method in datagridview? In-Reply-To: <51c8a7be0607191057l64361bben86f8d47feb5f2d97@mail.gmail.com> References: <51c8a7be0607191028p166dc44ei9aad0701d12b7143@mail.gmail.com> <7AD436E4270DD54A94238001769C22272B9919E520@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <51c8a7be0607191057l64361bben86f8d47feb5f2d97@mail.gmail.com> Message-ID: <7AD436E4270DD54A94238001769C22272B9919E558@DF-GRTDANE-MSG.exchange.corp.microsoft.com> I think.Columns['ButtonCol'] not working may be a bug. .Columns.Item['ButtonCol'] shouldn't work. The interesting question is if the bound columns should show up as well - that's probably not our bug but I won't know w/o doing some more research into how the columns are supposed to work. I've opened a bug http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkItemId=1091 to look into this. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of jeff sacksteder Sent: Wednesday, July 19, 2006 10:57 AM To: Discussion of IronPython Subject: Re: [IronPython] missing method in datagridview? Can you access the DataGridViewColumnCollection via indexers (eg myDataGridCollection[0] ? ) Yes. dgv = DataGridView(AutoGenerateColumns = True,DataSource = myBindingSource) myCol = DataGridViewButtonColumn(Text="Spaminate",Name="ButtonCol",UseColumnTextForButtonValue = True) dgv.Columns.Add(myCol) ) #works, returns myCol print dgv.Columns[0] #fails print dgv.Columns[1] #fails print dgv.Columns['ButtonCol'] #fails print dgv.Columns.Item['ButtonCol'] -------------- next part -------------- An HTML attachment was scrubbed... URL: From t-bruch at microsoft.com Wed Jul 19 20:07:53 2006 From: t-bruch at microsoft.com (Bruce Christensen) Date: Wed, 19 Jul 2006 11:07:53 -0700 Subject: [IronPython] Dict convertion question In-Reply-To: <785694cd0607191047u73561f4q1466e37a906375d6@mail.gmail.com> References: <785694cd0607191047u73561f4q1466e37a906375d6@mail.gmail.com> Message-ID: <3581AA168D87A2479D88EA319BDF7D32E84284@RED-MSG-80.redmond.corp.microsoft.com> Joe, We added basic support for the pickle module in beta 9 (http://docs.python.org/lib/module-pickle.html). Pickle allows you to convert an object to a string that you can save to a file and then read in a string and get back and object. Here's an example of how to use it: IronPython 1.0.60712 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import sys >>> sys.path.append('c:\python24\lib') >>> import pickle >>> >>> mydict = [(x,x) for x in range(2000)] >>> >>> output = open('dict.txt', 'wb') >>> pickle.dump(mydict, output, protocol=2) >>> output.close() >>> >>> input = open('dict.txt', 'rb') >>> new_dict = pickle.load(input) >>> input.close() >>> >>> new_dict [(0, 0), (1, 1), (2, 2), (3, 3), (4, 4), ... Since we just added support for this, please let us know if you run into any problems. --Bruce -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of JoeSox Sent: Wednesday, July 19, 2006 10:47 AM To: Discussion of IronPython Subject: [IronPython] Dict convertion question I'm interested in storing a large Dict in a text file. What I am trying to figure out what be the best way on creating the Dict from the text file. I see Converter.ConvertToValueType but I don't understand how to construct the RuntimeTypeHandle to see if that would work. But I am thinking I need to create a custom method to handle this conversion. Does anyone else have any ideas or point me in a direction I don't see right now? Thanks. -- Later, Joe _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dingyi.lin at gmail.com Wed Jul 19 20:43:01 2006 From: dingyi.lin at gmail.com (peter lin) Date: Thu, 20 Jul 2006 02:43:01 +0800 Subject: [IronPython] Cannot use logging module with ipy? In-Reply-To: <44BE71BA.3000507@twinsun.com> References: <4a8b0de20607190836t3d173a80q1dcf2fe2c907d0d2@mail.gmail.com> <7AD436E4270DD54A94238001769C22272B9919E528@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <44BE71BA.3000507@twinsun.com> Message-ID: <4a8b0de20607191143l15e260bfxec472faafe6509e0@mail.gmail.com> Sir, It works! Thanks a lot. 2006/7/20, Arman Bostani : > > Peter, > > As a hack, you can get logging working as follows: > > import logging > logging._srcfile = None > > -arman > > Dino Viehland wrote: > > Not being a sports fan I can't comment on the tension between the > > Yankees and Mariners, but we definitely don't have an implementation of > > sys._getframe which is the problem. While sys._getframe isn't as big as > > an entire standard module, it certainly is nearly as tricky to > > implement. Unfortunately we don't expect to get _getframe implemented > > for v1.0 ? but we do have a bug to implement this after 1.0 on CodePlex > > ( > http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkItemId=1042 > > < > http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkItemId=1042 > > > > ). > _______________________________________________ > 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 jsacksteder at gmail.com Thu Jul 20 06:53:50 2006 From: jsacksteder at gmail.com (jeff sacksteder) Date: Thu, 20 Jul 2006 00:53:50 -0400 Subject: [IronPython] Typing problem with vendor library? Message-ID: <51c8a7be0607192153n7c1fd931g3e570d0b0954d32d@mail.gmail.com> I have a data-acquisition device whose vendor provides a dotnet library for software integration. The dynamic nature of IP is giving me a bit of a problem. To record data from the unit, I make a method call like this: errorlevel = board.AIn(channel,mode,output) It seems that the library wants to put an UInt16 value into the 'output' variable. I would not expect this to be a problem, but this produces... TypeError: no overloads of AIn could match (int, Range, int) AIn(int, Range, Reference[Int16]) AIn(int, Range, Reference[UInt16]) Surely an unsigned Int16 should be able to go into an Int32? -------------- next part -------------- An HTML attachment was scrubbed... URL: From joesox at gmail.com Thu Jul 20 07:05:32 2006 From: joesox at gmail.com (JoeSox) Date: Wed, 19 Jul 2006 22:05:32 -0700 Subject: [IronPython] Dict convertion question In-Reply-To: <3581AA168D87A2479D88EA319BDF7D32E84284@RED-MSG-80.redmond.corp.microsoft.com> References: <785694cd0607191047u73561f4q1466e37a906375d6@mail.gmail.com> <3581AA168D87A2479D88EA319BDF7D32E84284@RED-MSG-80.redmond.corp.microsoft.com> Message-ID: <785694cd0607192205y648be8b4s5ae63530a9f18794@mail.gmail.com> Perfect Bruce thanks for the suggestion. Thanks exactly what I was looking for. However, it took around six minutes to create a file using pickle, as opposed to one second when I used File.WriteAllText. I understand pickle may be compressing but the space savings is not a significant enough benefit. Here's my code examples below and the file sizes(both used the same Dict): Dict myDict = new Dict(); engine.ExecuteToConsole("fw={}"); engine.ExecuteToConsole("fw=c.fw_edges");//c.fw_edges is the large dictionary myDict = (Dict)engine.Globals["fw"]; File.WriteAllText(Application.StartupPath + "\\mydict.txt", myDict.ToCodeString()); (This results in a file size of 1,540,096 bytes which was created in about a second.) ====== engine.Globals["myfile"] = Application.StartupPath + "\\fw_edges.txt"; engine.Import("pickle"); engine.ExecuteToConsole("output =open(myfile, 'wb')"); engine.ExecuteToConsole("pickle.dump(c.fw_edges,output, protocol=2)"); engine.ExecuteToConsole("output.close()"); (This results in a file size of 1,052,672 bytes which was created in about six minutes or more.) I would like the speed of File.WriteAllText, the compression is not really an issue for me. -- Later, Joe On 7/19/06, Bruce Christensen wrote: > Since we just added support for this, please let us know if you run into > any problems. > --Bruce From korpse-ironpython at kaydash.za.net Thu Jul 20 08:20:04 2006 From: korpse-ironpython at kaydash.za.net (Jonathan Jacobs) Date: Thu, 20 Jul 2006 08:20:04 +0200 Subject: [IronPython] Typing problem with vendor library? In-Reply-To: <51c8a7be0607192153n7c1fd931g3e570d0b0954d32d@mail.gmail.com> References: <51c8a7be0607192153n7c1fd931g3e570d0b0954d32d@mail.gmail.com> Message-ID: <44BF2094.9040202@kaydash.za.net> jeff sacksteder wrote: > errorlevel = board.AIn(channel,mode,output) > > TypeError: no overloads of AIn could match (int, Range, int) > AIn(int, Range, Reference[Int16]) > AIn(int, Range, Reference[UInt16]) What are the contents of board.AIn.Overloads? This might give you some idea of why your overload doesn't match. -- Jonathan From Martin.Maly at microsoft.com Thu Jul 20 09:57:30 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Thu, 20 Jul 2006 00:57:30 -0700 Subject: [IronPython] Typing problem with vendor library? In-Reply-To: <51c8a7be0607192153n7c1fd931g3e570d0b0954d32d@mail.gmail.com> Message-ID: The problem is that the method is called with int as the last parameter, but the two overloads in question take "ref Int16" and "ref UInt16". So the conversion is happening in the opposite direction and IronPython cannot safely choose between Int16 and UInt16 given that the input is Int32. They are both narrowing conversions. You can either select the method from Overloads, or cast the int to whichever type you want to use: board.AIn(channel, mode, Int16(output)) Hope this helps Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of jeff sacksteder Sent: Wednesday, July 19, 2006 9:54 PM To: users at lists.ironpython.com Subject: [IronPython] Typing problem with vendor library? I have a data-acquisition device whose vendor provides a dotnet library for software integration. The dynamic nature of IP is giving me a bit of a problem. To record data from the unit, I make a method call like this: errorlevel = board.AIn(channel,mode,output) It seems that the library wants to put an UInt16 value into the 'output' variable. I would not expect this to be a problem, but this produces... TypeError: no overloads of AIn could match (int, Range, int) AIn(int, Range, Reference[Int16]) AIn(int, Range, Reference[UInt16]) Surely an unsigned Int16 should be able to go into an Int32? -------------- next part -------------- An HTML attachment was scrubbed... URL: From t-bruch at microsoft.com Thu Jul 20 17:10:56 2006 From: t-bruch at microsoft.com (Bruce Christensen) Date: Thu, 20 Jul 2006 08:10:56 -0700 Subject: [IronPython] Dict convertion question In-Reply-To: <785694cd0607192205y648be8b4s5ae63530a9f18794@mail.gmail.com> References: <785694cd0607191047u73561f4q1466e37a906375d6@mail.gmail.com><3581AA168D87A2479D88EA319BDF7D32E84284@RED-MSG-80.redmond.corp.microsoft.com> <785694cd0607192205y648be8b4s5ae63530a9f18794@mail.gmail.com> Message-ID: <3581AA168D87A2479D88EA319BDF7D32EF309E@RED-MSG-80.redmond.corp.microsoft.com> Thanks for the feedback. In CPython, there are actually two implementations of pickle: one written in Python (pickle) and one written in C (cPickle). Only the Python version of pickle is available in beta 9, but we're hoping to include an implementation of cPickle, which should be quite a bit faster, in a future release of IronPython. What is the nature of the dict that you're trying to save? How many elements does it have, and what data types are those elements? Maybe there's something we can do to improve pickle's performance for you. --Bruce -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of JoeSox Sent: Wednesday, July 19, 2006 10:06 PM To: Discussion of IronPython Subject: Re: [IronPython] Dict convertion question Perfect Bruce thanks for the suggestion. Thanks exactly what I was looking for. However, it took around six minutes to create a file using pickle, as opposed to one second when I used File.WriteAllText. I understand pickle may be compressing but the space savings is not a significant enough benefit. Here's my code examples below and the file sizes(both used the same Dict): Dict myDict = new Dict(); engine.ExecuteToConsole("fw={}"); engine.ExecuteToConsole("fw=c.fw_edges");//c.fw_edges is the large dictionary myDict = (Dict)engine.Globals["fw"]; File.WriteAllText(Application.StartupPath + "\\mydict.txt", myDict.ToCodeString()); (This results in a file size of 1,540,096 bytes which was created in about a second.) ====== engine.Globals["myfile"] = Application.StartupPath + "\\fw_edges.txt"; engine.Import("pickle"); engine.ExecuteToConsole("output =open(myfile, 'wb')"); engine.ExecuteToConsole("pickle.dump(c.fw_edges,output, protocol=2)"); engine.ExecuteToConsole("output.close()"); (This results in a file size of 1,052,672 bytes which was created in about six minutes or more.) I would like the speed of File.WriteAllText, the compression is not really an issue for me. -- Later, Joe On 7/19/06, Bruce Christensen wrote: > Since we just added support for this, please let us know if you run into > any problems. > --Bruce _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From joesox at gmail.com Thu Jul 20 18:49:47 2006 From: joesox at gmail.com (JoeSox) Date: Thu, 20 Jul 2006 09:49:47 -0700 Subject: [IronPython] Dict convertion question In-Reply-To: <3581AA168D87A2479D88EA319BDF7D32EF309E@RED-MSG-80.redmond.corp.microsoft.com> References: <785694cd0607191047u73561f4q1466e37a906375d6@mail.gmail.com> <3581AA168D87A2479D88EA319BDF7D32E84284@RED-MSG-80.redmond.corp.microsoft.com> <785694cd0607192205y648be8b4s5ae63530a9f18794@mail.gmail.com> <3581AA168D87A2479D88EA319BDF7D32EF309E@RED-MSG-80.redmond.corp.microsoft.com> Message-ID: <785694cd0607200949o2a749554w7717c63434e75082@mail.gmail.com> On 7/20/06, Bruce Christensen wrote: > What is the nature of the dict that you're trying to save? It's a {4: [6, 4278, 44657, 30279, 58912, 67939, 18551, 33653, 28303, 6692, 4827, 110144, 18920, 15569, 11571, 77917, 7968, 10137, 14154, 33180, 12544, 54062, 159370, 9495], 11: [13, 12012, 2752, 97294, 26284, 11605], 17: [19], 23: [25, 3094, 119638, 38476], 29: [31, 3956, 25199, 3613, 62246, 89711, 276, 115528], 37: [39, 11431, 25255, 21317, 41972],.........} The numbers represent words/predicate nodes when they were first indexed. This particular Dict references them in a forward index. There is also a backwards index Dict in my project that stores the array as the Key. For example: {[6, 4278, 44657, 30279, 58912, 67939, 18551, 33653, 28303, 6692, 4827, 110144, 18920, 15569, 11571, 77917, 7968, 10137, 14154, 33180, 12544, 54062, 159370, 9495] : 4,...} > How many > elements does it have, and what data types are those elements? On average it has around 132,000 keys, and ideally it should be able to store more Keys. I'm not really sure how big the largest array Value gets. > Maybe there's something we can do to improve pickle's performance for you. Thanks, I'm sure it would benefit some others also. -- Later, Joe From jvm_cop at spamcop.net Thu Jul 20 21:04:01 2006 From: jvm_cop at spamcop.net (J. Merrill) Date: Thu, 20 Jul 2006 15:04:01 -0400 Subject: [IronPython] Dict convertion question In-Reply-To: <785694cd0607192205y648be8b4s5ae63530a9f18794@mail.gmail.co m> References: <785694cd0607191047u73561f4q1466e37a906375d6@mail.gmail.com> <3581AA168D87A2479D88EA319BDF7D32E84284@RED-MSG-80.redmond.corp.microsoft.com> <785694cd0607192205y648be8b4s5ae63530a9f18794@mail.gmail.com> Message-ID: <7.0.1.0.2.20060720150038.06ce21a0@wheresmymailserver.com> At 01:05 AM 7/20/2006, JoeSox wrote (in part) >File.WriteAllText(Application.StartupPath + "\\mydict.txt", myDict.ToCodeString()); >(This results in a file size of 1,540,096 bytes which was created in about a second.) I don't know much about ToCodeString, but from the name, it should produce a string that can be treated as Python code. If you were to write something like mydict = into the file, name the file mydict.py, and run that file -- wouldn't you end up with your dictionary back in a Python variable? J. Merrill / Analytical Software Corp From dinov at exchange.microsoft.com Thu Jul 20 21:11:59 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Thu, 20 Jul 2006 12:11:59 -0700 Subject: [IronPython] Dict convertion question In-Reply-To: <7.0.1.0.2.20060720150038.06ce21a0@wheresmymailserver.com> References: <785694cd0607191047u73561f4q1466e37a906375d6@mail.gmail.com> <3581AA168D87A2479D88EA319BDF7D32E84284@RED-MSG-80.redmond.corp.microsoft.com> <785694cd0607192205y648be8b4s5ae63530a9f18794@mail.gmail.com> <7.0.1.0.2.20060720150038.06ce21a0@wheresmymailserver.com> Message-ID: <7AD436E4270DD54A94238001769C22272CB2D1B75D@DF-GRTDANE-MSG.exchange.corp.microsoft.com> That will work unless the dict contains some objects who's repr isn't really a usable repr - eg . You could even just read the string from the file & eval it. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of J. Merrill Sent: Thursday, July 20, 2006 12:04 PM To: Discussion of IronPython Subject: Re: [IronPython] Dict convertion question At 01:05 AM 7/20/2006, JoeSox wrote (in part) >File.WriteAllText(Application.StartupPath + "\\mydict.txt", >myDict.ToCodeString()); (This results in a file size of 1,540,096 bytes >which was created in about a second.) I don't know much about ToCodeString, but from the name, it should produce a string that can be treated as Python code. If you were to write something like mydict = into the file, name the file mydict.py, and run that file -- wouldn't you end up with your dictionary back in a Python variable? J. Merrill / Analytical Software Corp _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From t-bruch at microsoft.com Thu Jul 20 21:06:30 2006 From: t-bruch at microsoft.com (Bruce Christensen) Date: Thu, 20 Jul 2006 12:06:30 -0700 Subject: [IronPython] Dict convertion question In-Reply-To: <7.0.1.0.2.20060720150038.06ce21a0@wheresmymailserver.com> References: <785694cd0607191047u73561f4q1466e37a906375d6@mail.gmail.com><3581AA168D87A2479D88EA319BDF7D32E84284@RED-MSG-80.redmond.corp.microsoft.com><785694cd0607192205y648be8b4s5ae63530a9f18794@mail.gmail.com> <7.0.1.0.2.20060720150038.06ce21a0@wheresmymailserver.com> Message-ID: <3581AA168D87A2479D88EA319BDF7D32EF3369@RED-MSG-80.redmond.corp.microsoft.com> Sometimes. :) ToCodeString() from .NET is the same as repr() from Python. So if you stick to simple things like lists, dicts, strings, etc., then that will work. Once you add objects into the mix, though, all bets are off. --Bruce -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of J. Merrill Sent: Thursday, July 20, 2006 12:04 PM To: Discussion of IronPython Subject: Re: [IronPython] Dict convertion question At 01:05 AM 7/20/2006, JoeSox wrote (in part) >File.WriteAllText(Application.StartupPath + "\\mydict.txt", myDict.ToCodeString()); >(This results in a file size of 1,540,096 bytes which was created in about a second.) I don't know much about ToCodeString, but from the name, it should produce a string that can be treated as Python code. If you were to write something like mydict = into the file, name the file mydict.py, and run that file -- wouldn't you end up with your dictionary back in a Python variable? J. Merrill / Analytical Software Corp _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From jvm_cop at spamcop.net Thu Jul 20 21:57:40 2006 From: jvm_cop at spamcop.net (J. Merrill) Date: Thu, 20 Jul 2006 15:57:40 -0400 Subject: [IronPython] Dict convertion question In-Reply-To: <785694cd0607200949o2a749554w7717c63434e75082@mail.gmail.co m> References: <785694cd0607191047u73561f4q1466e37a906375d6@mail.gmail.com> <3581AA168D87A2479D88EA319BDF7D32E84284@RED-MSG-80.redmond.corp.microsoft.com> <785694cd0607192205y648be8b4s5ae63530a9f18794@mail.gmail.com> <3581AA168D87A2479D88EA319BDF7D32EF309E@RED-MSG-80.redmond.corp.microsoft.com> <785694cd0607200949o2a749554w7717c63434e75082@mail.gmail.com> Message-ID: <7.0.1.0.2.20060720155703.06d72f58@wheresmymailserver.com> You should really try executing the ToCodeString result .... At 12:49 PM 7/20/2006, JoeSox wrote >On 7/20/06, Bruce Christensen wrote: >> What is the nature of the dict that you're trying to save? > >It's a >{4: [6, 4278, 44657, 30279, 58912, 67939, 18551, 33653, 28303, 6692, >4827, 110144, 18920, 15569, 11571, 77917, 7968, 10137, 14154, 33180, >12544, 54062, 159370, 9495], 11: [13, 12012, 2752, 97294, 26284, >11605], 17: [19], 23: [25, 3094, 119638, 38476], 29: [31, 3956, 25199, >3613, 62246, 89711, 276, 115528], 37: [39, 11431, 25255, 21317, >41972],.........} > >The numbers represent words/predicate nodes when they were first >indexed. This particular Dict references them in a forward index. >There is also a backwards index Dict in my project that stores the >array as the Key. For example: > >{[6, 4278, 44657, 30279, 58912, 67939, 18551, 33653, 28303, 6692, >4827, 110144, 18920, 15569, 11571, 77917, 7968, 10137, 14154, 33180, >12544, 54062, 159370, 9495] : 4,...} > > >> How many >> elements does it have, and what data types are those elements? > >On average it has around 132,000 keys, and ideally it should be able >to store more Keys. I'm not really sure how big the largest array >Value gets. > >> Maybe there's something we can do to improve pickle's performance for you. > >Thanks, I'm sure it would benefit some others also. >-- >Later, Joe J. Merrill / Analytical Software Corp From dinov at exchange.microsoft.com Thu Jul 20 21:57:44 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Thu, 20 Jul 2006 12:57:44 -0700 Subject: [IronPython] Dict convertion question In-Reply-To: <7.0.1.0.2.20060720155703.06d72f58@wheresmymailserver.com> References: <785694cd0607191047u73561f4q1466e37a906375d6@mail.gmail.com> <3581AA168D87A2479D88EA319BDF7D32E84284@RED-MSG-80.redmond.corp.microsoft.com> <785694cd0607192205y648be8b4s5ae63530a9f18794@mail.gmail.com> <3581AA168D87A2479D88EA319BDF7D32EF309E@RED-MSG-80.redmond.corp.microsoft.com> <785694cd0607200949o2a749554w7717c63434e75082@mail.gmail.com> <7.0.1.0.2.20060720155703.06d72f58@wheresmymailserver.com> Message-ID: <7AD436E4270DD54A94238001769C22272CB2D1B7B0@DF-GRTDANE-MSG.exchange.corp.microsoft.com> That could be really slow right now as we'll do all the code gen, compilation, etc... only to run it once. We have an experimental option called FastEval (-X:FastEval) that might speed that up as well, but unfortunately I don't think it works for everything. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of J. Merrill Sent: Thursday, July 20, 2006 12:58 PM To: Discussion of IronPython Subject: Re: [IronPython] Dict convertion question You should really try executing the ToCodeString result .... At 12:49 PM 7/20/2006, JoeSox wrote >On 7/20/06, Bruce Christensen wrote: >> What is the nature of the dict that you're trying to save? > >It's a >{4: [6, 4278, 44657, 30279, 58912, 67939, 18551, 33653, 28303, 6692, >4827, 110144, 18920, 15569, 11571, 77917, 7968, 10137, 14154, 33180, >12544, 54062, 159370, 9495], 11: [13, 12012, 2752, 97294, 26284, >11605], 17: [19], 23: [25, 3094, 119638, 38476], 29: [31, 3956, 25199, >3613, 62246, 89711, 276, 115528], 37: [39, 11431, 25255, 21317, >41972],.........} > >The numbers represent words/predicate nodes when they were first >indexed. This particular Dict references them in a forward index. >There is also a backwards index Dict in my project that stores the >array as the Key. For example: > >{[6, 4278, 44657, 30279, 58912, 67939, 18551, 33653, 28303, 6692, 4827, >110144, 18920, 15569, 11571, 77917, 7968, 10137, 14154, 33180, 12544, >54062, 159370, 9495] : 4,...} > > >> How many >> elements does it have, and what data types are those elements? > >On average it has around 132,000 keys, and ideally it should be able to >store more Keys. I'm not really sure how big the largest array Value >gets. > >> Maybe there's something we can do to improve pickle's performance for you. > >Thanks, I'm sure it would benefit some others also. >-- >Later, Joe J. Merrill / Analytical Software Corp _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From joesox at gmail.com Thu Jul 20 22:41:56 2006 From: joesox at gmail.com (JoeSox) Date: Thu, 20 Jul 2006 13:41:56 -0700 Subject: [IronPython] Dict convertion question In-Reply-To: <7.0.1.0.2.20060720150038.06ce21a0@wheresmymailserver.com> References: <785694cd0607191047u73561f4q1466e37a906375d6@mail.gmail.com> <3581AA168D87A2479D88EA319BDF7D32E84284@RED-MSG-80.redmond.corp.microsoft.com> <785694cd0607192205y648be8b4s5ae63530a9f18794@mail.gmail.com> <7.0.1.0.2.20060720150038.06ce21a0@wheresmymailserver.com> Message-ID: <785694cd0607201341g66707e16k68267728619da2bf@mail.gmail.com> On 7/20/06, J. Merrill wrote: > At 01:05 AM 7/20/2006, JoeSox wrote (in part) > >File.WriteAllText(Application.StartupPath + "\\mydict.txt", myDict.ToCodeString()); > >(This results in a file size of 1,540,096 bytes which was created in about a second.) > > I don't know much about ToCodeString, but from the name, it should produce a string that can be treated as Python code. If you were to write something like > mydict = > into the file, name the file mydict.py, and run that file -- wouldn't you end up with your dictionary back in a Python variable? > I have tried this in IDLE and I couldn't get a response back or extremely slow. I haven't had time to try it in IP yet. I have written this method below (rather quickly) and since it changes the strings into ints using IP it slows down the conversion. === public static Dict Convert_StringtoDict(string dictcodestring) { Dict myDict = new Dict(); int i = 0; string nextKey = ""; StringCollection tempSC = new StringCollection(); foreach (string kv in dictcodestring.Split(':')) { string tempstr = ""; string cur = ""; cur = kv; cur = cur.Trim(); //**if begining of Dict, remove the { if (cur.StartsWith("{") && i.Equals(0)) { tempstr = cur.Replace("{", ""); tempstr = tempstr.Trim(); //Add the first Key tempSC.Add(tempstr); } //**if '[' found then get its value [x,x...], may have some at end if (cur.StartsWith("[")) { string Value = ""; tempstr = cur.Replace("[", ""); tempstr = tempstr.Trim(); if (tempstr.Contains("],")) { int index = 0; index = tempstr.IndexOf("],"); Value = tempstr.Substring(0, index); //Turn Value into ints CNDB.cn_pe.Globals["Value"] = Value; CNDB.cn_pe.ExecuteToConsole("v={}"); CNDB.cn_pe.ExecuteToConsole("v=Value"); nextKey = tempstr.Substring(index, tempstr.Length - Value.Length); nextKey = nextKey.Replace("],", "").Trim(); //Add the next Key to SC tempSC.Add(nextKey); } else nextKey = ""; //Add the Key,Value... if (!i.Equals(0)) { //Add this Value to the last Key myDict.Add(Convert.ToInt32(tempSC[i - 1]), CNDB.cn_pe.Globals["Value"]); } } i = i + 1; } //IEnumerator myEnumerator = inList.GetEnumerator(); //while (myEnumerator.MoveNext()) // stringList += myEnumerator.Current.ToString() + "\r\n"; return myDict; } From jsacksteder at gmail.com Fri Jul 21 15:54:44 2006 From: jsacksteder at gmail.com (jeff sacksteder) Date: Fri, 21 Jul 2006 09:54:44 -0400 Subject: [IronPython] missing method in datagridview? In-Reply-To: <7AD436E4270DD54A94238001769C22272B9919E558@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <51c8a7be0607191028p166dc44ei9aad0701d12b7143@mail.gmail.com> <7AD436E4270DD54A94238001769C22272B9919E520@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <51c8a7be0607191057l64361bben86f8d47feb5f2d97@mail.gmail.com> <7AD436E4270DD54A94238001769C22272B9919E558@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <51c8a7be0607210654m60805f8bwbc2bcf046b7949ed@mail.gmail.com> > > I think.Columns['ButtonCol'] not working may be a bug. > .Columns.Item['ButtonCol'] shouldn't work. The interesting question is if > the bound columns should show up as well ? that's probably not our bug but I > won't know w/o doing some more research into how the columns are supposed to > work. > Interestingly, When I Add() a column to my DataGridView control it appears as the left-most column. I don't think this is the intended way to layout the control. Modifying the DisplayIndex property does not move it either. It's like the layout logic only thinks there is the one column, as well. It probably has the same root cause . -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Fri Jul 21 18:38:35 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Fri, 21 Jul 2006 09:38:35 -0700 Subject: [IronPython] missing method in datagridview? In-Reply-To: <51c8a7be0607210654m60805f8bwbc2bcf046b7949ed@mail.gmail.com> References: <51c8a7be0607191028p166dc44ei9aad0701d12b7143@mail.gmail.com> <7AD436E4270DD54A94238001769C22272B9919E520@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <51c8a7be0607191057l64361bben86f8d47feb5f2d97@mail.gmail.com> <7AD436E4270DD54A94238001769C22272B9919E558@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <51c8a7be0607210654m60805f8bwbc2bcf046b7949ed@mail.gmail.com> Message-ID: <7AD436E4270DD54A94238001769C22272CB2D1BAC8@DF-GRTDANE-MSG.exchange.corp.microsoft.com> FYI I looked at this a little bit yesterday and it looked like the Columsn['Name'] was working on our latest builds, but I didn't have enough time to start looking at the auto-generated columns. I do think that ultimately this should work and am a little worried this could be our bug, so I'll continue to look at it today. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of jeff sacksteder Sent: Friday, July 21, 2006 6:55 AM To: Discussion of IronPython Subject: Re: [IronPython] missing method in datagridview? I think.Columns['ButtonCol'] not working may be a bug. .Columns.Item['ButtonCol'] shouldn't work. The interesting question is if the bound columns should show up as well - that's probably not our bug but I won't know w/o doing some more research into how the columns are supposed to work. Interestingly, When I Add() a column to my DataGridView control it appears as the left-most column. I don't think this is the intended way to layout the control. Modifying the DisplayIndex property does not move it either. It's like the layout logic only thinks there is the one column, as well. It probably has the same root cause . -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Fri Jul 21 22:01:40 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Fri, 21 Jul 2006 13:01:40 -0700 Subject: [IronPython] missing method in datagridview? In-Reply-To: <51c8a7be0607210654m60805f8bwbc2bcf046b7949ed@mail.gmail.com> References: <51c8a7be0607191028p166dc44ei9aad0701d12b7143@mail.gmail.com> <7AD436E4270DD54A94238001769C22272B9919E520@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <51c8a7be0607191057l64361bben86f8d47feb5f2d97@mail.gmail.com> <7AD436E4270DD54A94238001769C22272B9919E558@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <51c8a7be0607210654m60805f8bwbc2bcf046b7949ed@mail.gmail.com> Message-ID: <7AD436E4270DD54A94238001769C22272CB2D1BC82@DF-GRTDANE-MSG.exchange.corp.microsoft.com> I believe this is a bug in the DataGridView, or otherwise it's the correct behavior of the DataGridView. The first code snippet below works, the 2nd code snippet fails to have the columns as you'd expect. The only difference between them is the order in which the user-columns are added vs. when the auto-generated columns should be generated. Luckily for you the developer of this feature was on Channel9 yesterday, so I'll ping her and see what she thinks J. import clr clr.AddReference('System.Windows.Forms') import System.Windows.Forms as SWF data = list() data.append('abc') data.append('def') f = SWF.Form() dgv = SWF.DataGridView() f.Controls.Add(dgv) myCol = SWF.DataGridViewButtonColumn(Text="Spaminate",Name="ButtonCol",UseColumnTextForButtonValue = True) dgv.Columns.Add(myCol) myCol = SWF.DataGridViewButtonColumn(Text="Spaminate2",Name="SecondColumn",UseColumnTextForButtonValue = True) dgv.Columns.Add(myCol) dgv.AutoGenerateColumns = True dgv.DataSource = data print dgv.Columns.Count print dgv.Columns[0] print dgv.Columns[1] print dgv.Columns[2] print dgv.Columns[0] == dgv.Columns['ButtonCol'] print dgv.Columns[1] == dgv.Columns['SecondColumn'] print dgv.Columns[2] == dgv.Columns['Length'] SWF.Application.Run(f) import clr clr.AddReference('System.Windows.Forms') import System.Windows.Forms as SWF data = list() data.append('abc') data.append('def') f = SWF.Form() dgv = SWF.DataGridView() dgv.AutoGenerateColumns = True dgv.DataSource = data f.Controls.Add(dgv) myCol = SWF.DataGridViewButtonColumn(Text="Spaminate",Name="ButtonCol",UseColumnTextForButtonValue = True) dgv.Columns.Add(myCol) myCol = SWF.DataGridViewButtonColumn(Text="Spaminate2",Name="SecondColumn",UseColumnTextForButtonValue = True) dgv.Columns.Add(myCol) print dgv.Columns.Count print dgv.Columns[0] print dgv.Columns[1] print dgv.Columns[2] print dgv.Columns[0] == dgv.Columns['ButtonCol'] print dgv.Columns[1] == dgv.Columns['SecondColumn'] print dgv.Columns[2] == dgv.Columns['Length'] SWF.Application.Run(f) From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of jeff sacksteder Sent: Friday, July 21, 2006 6:55 AM To: Discussion of IronPython Subject: Re: [IronPython] missing method in datagridview? I think.Columns['ButtonCol'] not working may be a bug. .Columns.Item['ButtonCol'] shouldn't work. The interesting question is if the bound columns should show up as well - that's probably not our bug but I won't know w/o doing some more research into how the columns are supposed to work. Interestingly, When I Add() a column to my DataGridView control it appears as the left-most column. I don't think this is the intended way to layout the control. Modifying the DisplayIndex property does not move it either. It's like the layout logic only thinks there is the one column, as well. It probably has the same root cause . -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Sat Jul 22 15:54:03 2006 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sat, 22 Jul 2006 14:54:03 +0100 Subject: [IronPython] Movable Python - GUI Launcher for IronPython Message-ID: <44C22DFB.3050005@voidspace.org.uk> Hello all, My apologies if this is considered off-topic. Feel free to ignore this email. :-) An updated Movable Python is now available. As well as providing a portable development environment for Python, it allows you to choose the interpreter for running scripts with (which can be any program). This means you can choose IronPython as the interpreter and use Movable Python for launching Python scripts, including choosing the working directory and providing command line arguments. You can see an overview of some of the other new features in Movable Python at : http://www.voidspace.org.uk/python/weblog/arch_d7_2006_07_22.shtml#e396 Thanks for your patience. Michael Foord http://www.voidspace.org.uk/python/index.shtml From fuzzyman at voidspace.org.uk Sat Jul 22 19:08:53 2006 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sat, 22 Jul 2006 18:08:53 +0100 Subject: [IronPython] Ironpython.com & Mailing List Archive Message-ID: <44C25BA5.7020302@voidspace.org.uk> Hello all, Hey, they've updated the Ironpython.com homepage. This is great news. :-) I've also setup a google group which mirrors this mailing list. The advantage of this is a convenient web interface for posting, and more chance of people finding the mailing list (and posting without having to subscribe - but hopefully not more spam). I hope this is ok. The groups homepage is : http://groups.google.com/group/ironpy In order for posting to work, someone on the IronPython mailing list admin will have to confirm 'ironpy at googlegroups.com' as a member of the group. Can someone do this ? I'm taking a break from Movable Python and working on a new tutorial blog entry. All the best, Michael Foord http://www.voidspace.org.uk/python/weblog/index.shtml From prince0 at hotmail.com Sat Jul 22 10:35:36 2006 From: prince0 at hotmail.com (Prince0) Date: Sat, 22 Jul 2006 10:35:36 +0200 Subject: [IronPython] How to compile has a DLL assembly ? Message-ID: Hi, I have compiled my Python script and now I would like to use it as a standard DLL assembly. How can I do this? Here's my current code: List files = new List(); files.Add(@"c:\toto.py"); PythonCompiler compiler = new PythonCompiler(files, @"c:\toto.dll"); compiler.Compile(); Then: private toto toto1; ctor() this.toto1 = new toto(); PythonModule pm = Ops.InitializeModule(this.toto1, "toto", new string[0]); pm.SystemState.stdout = new PythonFile(File.Create(@"c:\output.txt"), Encoding.ASCII, "output", "w"); OnClick() Ops.ExecuteCompiled(new InitializeModule(this.toto1.Initialize)); Is there a better way? It seems I will have to modify IronPython's source code so I can also specify the args. -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Sat Jul 22 19:57:24 2006 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sat, 22 Jul 2006 18:57:24 +0100 Subject: [IronPython] Ironpython.com & Mailing List Archive In-Reply-To: <44C25BA5.7020302@voidspace.org.uk> References: <44C25BA5.7020302@voidspace.org.uk> Message-ID: <44C26704.90601@voidspace.org.uk> The google groups web interface works (it is receiving email). Posting only works if the person posting is subscribed - so at least no increase in spam. I've amended the group description to include details of how to subscribe in the group subscription. Perhaps it would be better if I made the group 'read-only' ? Michael http://www.voidspace.org.uk/python/index.shtml Michael Foord wrote: > Hello all, > > Hey, they've updated the Ironpython.com homepage. This is great news. :-) > > I've also setup a google group which mirrors this mailing list. > > The advantage of this is a convenient web interface for posting, and > more chance of people finding the mailing list (and posting without > having to subscribe - but hopefully not more spam). I hope this is ok. > > The groups homepage is : > > http://groups.google.com/group/ironpy > > In order for posting to work, someone on the IronPython mailing list > admin will have to confirm 'ironpy at googlegroups.com' as a member of the > group. Can someone do this ? > > I'm taking a break from Movable Python and working on a new tutorial > blog entry. > > All the best, > > Michael Foord > http://www.voidspace.org.uk/python/weblog/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 Sat Jul 22 21:44:10 2006 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sat, 22 Jul 2006 20:44:10 +0100 Subject: [IronPython] IronPython & Windows Forms VII, Dock & Anchor Message-ID: <44C2800A.9090609@voidspace.org.uk> Hello all, I've completed another entry in the "IronPython & Windows Forms" series. http://www.voidspace.org.uk/python/weblog/arch_d7_2006_07_22.shtml#e399 This one covers using the Dock and Anchor properties to layout controls in a form. It is a short entry, but contains essential information for creating any GUI application. The series has now covered all the essential basics. Hopefully the next entries can put this information together and show how it can be used. I won't be covering data binding just yet, we've got events, images and dialogs (at least) to go through first... ;-) Oh, as usual, corrections and comments welcomed. All the best, Michael Foord http://www.voidspace.org.uk/python/index.shtml From john.tobler.associates at gmail.com Sat Jul 22 23:31:52 2006 From: john.tobler.associates at gmail.com (John Tobler) Date: Sat, 22 Jul 2006 14:31:52 -0700 Subject: [IronPython] IronPython Console on Unix. In-Reply-To: <7AD436E4270DD54A94238001769C222725D9E3A1F6@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <44B4BAB0.2070601@free.fr> <5b0248170607120652n32febcbdxb0225fca986fe221@mail.gmail.com> <44B5013C.2000000@free.fr> <1152729014.12777.96.camel@erandi.cam.novell.com> <7AD436E4270DD54A94238001769C222725D9E3A1F6@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: > Just to get your Unix input on this: Would us checking Environment.OSVersion.Platform > and switch from Ctrl-Z to Ctrl-D for Unix sound ok to you? The reason I ask is we don't > have Environment.EndOfFileDescriptor :). Considering that CTRL-Z has indicated an exit from Python Consoles on all platforms, including Windows, for about as long as anyone can remember, it seems a bit presumptious of the IronPython community to make such a drastic change so cavalierly! My vote? NO! John Tobler ----- On 7/12/06, Dino Viehland wrote: > > Thanks for the bug report Miguel. I think the reason we're doing this > today is because we're using Console.ReadKey which returns the raw key > info instead of EOF when there's no input available. I've opened CodePlex > bug 904 to track the issue ( > http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkItemId=904 > ). > > Just to get your Unix input on this: Would us checking > Environment.OSVersion.Platform and switch from Ctrl-Z to Ctrl-D for Unix > sound ok to you? The reason I ask is we don't have > Environment.EndOfFileDescriptor :). > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] On Behalf Of Miguel de Icaza > Sent: Wednesday, July 12, 2006 11:30 AM > To: Discussion of IronPython > Subject: [IronPython] IronPython Console on Unix. > > Hello, > > Something in IronPython is now looking for Control-z, which is fine on > Windows, but on Unix, Control-Z stands for "suspend application". > > In Unix, the end-of-file descriptor is control-d; Am not sure why > the code is actually looking for a Control-Z, while it could be checking > whether there is input available instead. > > miguel. > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From s at rusek.org Sat Jul 22 23:37:16 2006 From: s at rusek.org (Stefan Rusek) Date: Sat, 22 Jul 2006 17:37:16 -0400 Subject: [IronPython] IronPython Console on Unix. In-Reply-To: Message-ID: <20060722214048.946191BB91@che.dreamhost.com> CTRL-Z does not indicate exit on any unix or linux platform in Python. On those platforms pressing CTRL-Z suspends the application, which might appear similar to exiting, but it is not the same at all. For optimal compatibility, IronPython should exit based on the platforms End of File character/keystroke. _____ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of John Tobler Sent: Saturday, July 22, 2006 5:32 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Console on Unix. > Just to get your Unix input on this: Would us checking Environment.OSVersion.Platform > and switch from Ctrl-Z to Ctrl-D for Unix sound ok to you? The reason I ask is we don't > have Environment.EndOfFileDescriptor :). Considering that CTRL-Z has indicated an exit from Python Consoles on all platforms, including Windows, for about as long as anyone can remember, it seems a bit presumptious of the IronPython community to make such a drastic change so cavalierly! My vote? NO! John Tobler ----- On 7/12/06, Dino Viehland wrote: Thanks for the bug report Miguel. I think the reason we're doing this today is because we're using Console.ReadKey which returns the raw key info instead of EOF when there's no input available. I've opened CodePlex bug 904 to track the issue ( http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkItemId =904). Just to get your Unix input on this: Would us checking Environment.OSVersion.Platform and switch from Ctrl-Z to Ctrl-D for Unix sound ok to you? The reason I ask is we don't have Environment.EndOfFileDescriptor :). -----Original Message----- From: users-bounces at lists.ironpython.com [mailto: users-bounces at lists.ironpython.com] On Behalf Of Miguel de Icaza Sent: Wednesday, July 12, 2006 11:30 AM To: Discussion of IronPython Subject: [IronPython] IronPython Console on Unix. Hello, Something in IronPython is now looking for Control-z, which is fine on Windows, but on Unix, Control-Z stands for "suspend application". In Unix, the end-of-file descriptor is control-d; Am not sure why the code is actually looking for a Control-Z, while it could be checking whether there is input available instead. miguel. _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Sat Jul 22 23:56:00 2006 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sat, 22 Jul 2006 22:56:00 +0100 Subject: [IronPython] IronPython Console on Unix. In-Reply-To: References: <44B4BAB0.2070601@free.fr> <5b0248170607120652n32febcbdxb0225fca986fe221@mail.gmail.com> <44B5013C.2000000@free.fr> <1152729014.12777.96.camel@erandi.cam.novell.com> <7AD436E4270DD54A94238001769C222725D9E3A1F6@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <44C29EF0.1060504@voidspace.org.uk> John Tobler wrote: > > > Just to get your Unix input on this: Would us checking > Environment.OSVersion.Platform > > and switch from Ctrl-Z to Ctrl-D for Unix sound ok to you? The > reason I ask is we don't > > have Environment.EndOfFileDescriptor :). > > Considering that CTRL-Z has indicated an exit from Python Consoles on > all platforms, including Windows, for about as long as anyone can > remember, it seems a bit presumptious of the IronPython community to > make such a drastic change so cavalierly! My vote? NO! > Hmm... I've just tried it on several windows interpreters. Ctrl-Z as an exit works on Python 2.2.3 (???), but not Python 2.3, 2.4, or 2.5b1 Personally I'm +1 on the change. Sticking with a Unix convention that hasn't worked on Windows for years seems odd... :-p Fuzzyman http://www.voidspace.org.uk/python/index.shtml > John Tobler > > ----- > > On 7/12/06, *Dino Viehland* > wrote: > > Thanks for the bug report Miguel. I think the reason we're doing > this today is because we're using Console.ReadKey which returns > the raw key info instead of EOF when there's no input > available. I've opened CodePlex bug 904 to track the issue ( > http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkItemId=904 > ). > > Just to get your Unix input on this: Would us checking > Environment.OSVersion.Platform and switch from Ctrl-Z to Ctrl-D > for Unix sound ok to you? The reason I ask is we don't have > Environment.EndOfFileDescriptor :). > > -----Original Message----- > From: users-bounces at lists.ironpython.com > [mailto: > users-bounces at lists.ironpython.com > ] On Behalf Of Miguel > de Icaza > Sent: Wednesday, July 12, 2006 11:30 AM > To: Discussion of IronPython > Subject: [IronPython] IronPython Console on Unix. > > Hello, > > Something in IronPython is now looking for Control-z, which is > fine on Windows, but on Unix, Control-Z stands for "suspend > application". > > In Unix, the end-of-file descriptor is control-d; Am not sure why > the code is actually looking for a Control-Z, while it could be > checking whether there is input available instead. > > miguel. > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.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 korpse-ironpython at kaydash.za.net Sun Jul 23 00:12:27 2006 From: korpse-ironpython at kaydash.za.net (Jonathan Jacobs) Date: Sun, 23 Jul 2006 00:12:27 +0200 Subject: [IronPython] IronPython Console on Unix. In-Reply-To: <44C29EF0.1060504@voidspace.org.uk> References: <44B4BAB0.2070601@free.fr> <5b0248170607120652n32febcbdxb0225fca986fe221@mail.gmail.com> <44B5013C.2000000@free.fr> <1152729014.12777.96.camel@erandi.cam.novell.com> <7AD436E4270DD54A94238001769C222725D9E3A1F6@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <44C29EF0.1060504@voidspace.org.uk> Message-ID: <44C2A2CB.70005@kaydash.za.net> Michael Foord wrote: > Hmm... I've just tried it on several windows interpreters. > > Ctrl-Z as an exit works on Python 2.2.3 (???), but not Python 2.3, 2.4, > or 2.5b1 Did you forget to press enter after typing Ctrl-Z, like the "exit" message says? Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> exit 'Use Ctrl-Z plus Return to exit.' Incidentally, under *nix there is no need for enter after pressing Ctrl-D. Python 2.4.4c0 (#2, Jun 14 2006, 22:35:41) [GCC 4.1.2 20060613 (prerelease) (Debian 4.1.1-4)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> exit 'Use Ctrl-D (i.e. EOF) to exit.' -- Jonathan From fuzzyman at voidspace.org.uk Sun Jul 23 00:21:50 2006 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sat, 22 Jul 2006 23:21:50 +0100 Subject: [IronPython] IronPython Console on Unix. In-Reply-To: <44C2A2CB.70005@kaydash.za.net> References: <44B4BAB0.2070601@free.fr> <5b0248170607120652n32febcbdxb0225fca986fe221@mail.gmail.com> <44B5013C.2000000@free.fr> <1152729014.12777.96.camel@erandi.cam.novell.com> <7AD436E4270DD54A94238001769C222725D9E3A1F6@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <44C29EF0.1060504@voidspace.org.uk> <44C2A2CB.70005@kaydash.za.net> Message-ID: <44C2A4FE.1080803@voidspace.org.uk> Jonathan Jacobs wrote: > Michael Foord wrote: > >> Hmm... I've just tried it on several windows interpreters. >> >> Ctrl-Z as an exit works on Python 2.2.3 (???), but not Python 2.3, 2.4, >> or 2.5b1 >> > > Did you forget to press enter after typing Ctrl-Z, like the "exit" message says? > Nope I didn't forget - and it still didn't work. Fuzzyman http://www.voidspace.org.uk/python/index.shtml > Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] on win32 > Type "help", "copyright", "credits" or "license" for more information. > >>> exit > 'Use Ctrl-Z plus Return to exit.' > > Incidentally, under *nix there is no need for enter after pressing Ctrl-D. > > Python 2.4.4c0 (#2, Jun 14 2006, 22:35:41) > [GCC 4.1.2 20060613 (prerelease) (Debian 4.1.1-4)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> exit > 'Use Ctrl-D (i.e. EOF) to exit.' > From dinov at exchange.microsoft.com Mon Jul 24 17:25:49 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 24 Jul 2006 08:25:49 -0700 Subject: [IronPython] How to compile has a DLL assembly ? In-Reply-To: <001e01c6ad69$cdf6c230$0100a8c0@edelweiss> References: <001e01c6ad69$cdf6c230$0100a8c0@edelweiss> Message-ID: <7AD436E4270DD54A94238001769C22272CDFD25B22@DF-GRTDANE-MSG.exchange.corp.microsoft.com> The easiest way to compile something is to run it w/ -X:SaveAssembiles: Ipy.exe -X:SaveAssemblies toto.py Will write out a toto.exe. Then you can just do an AppDomain.CurrentDomain.ExecuteAssembly on that and it'll run. Note you won't be able to get at the classes defined in the assembly from the .NET code. If you just want to compile & run inside of your process you're probably better off using the PythonEngine APIs which provide compile & execute functionality, but this won't allow you to save it to disk. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Prince0 Sent: Saturday, July 22, 2006 1:36 AM To: users at lists.ironpython.com Subject: [IronPython] How to compile has a DLL assembly ? Hi, I have compiled my Python script and now I would like to use it as a standard DLL assembly. How can I do this? Here's my current code: List files = new List(); files.Add(@"c:\toto.py"); PythonCompiler compiler = new PythonCompiler(files, @"c:\toto.dll"); compiler.Compile(); Then: private toto toto1; ctor() this.toto1 = new toto(); PythonModule pm = Ops.InitializeModule(this.toto1, "toto", new string[0]); pm.SystemState.stdout = new PythonFile(File.Create(@"c:\output.txt"), Encoding.ASCII, "output", "w"); OnClick() Ops.ExecuteCompiled(new InitializeModule(this.toto1.Initialize)); Is there a better way? It seems I will have to modify IronPython's source code so I can also specify the args. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Mon Jul 24 17:27:10 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 24 Jul 2006 08:27:10 -0700 Subject: [IronPython] IronPython & Windows Forms VII, Dock & Anchor In-Reply-To: <44C2800A.9090609@voidspace.org.uk> References: <44C2800A.9090609@voidspace.org.uk> Message-ID: <7AD436E4270DD54A94238001769C22272CDFD25B23@DF-GRTDANE-MSG.exchange.corp.microsoft.com> I've added this to the list of articles at http://www.codeplex.com/Wiki/View.aspx?ProjectName=IronPython&title=More%20Information (the other 4 were already up there). -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Saturday, July 22, 2006 12:44 PM To: Discussion of IronPython Subject: [IronPython] IronPython & Windows Forms VII, Dock & Anchor Hello all, I've completed another entry in the "IronPython & Windows Forms" series. http://www.voidspace.org.uk/python/weblog/arch_d7_2006_07_22.shtml#e399 This one covers using the Dock and Anchor properties to layout controls in a form. It is a short entry, but contains essential information for creating any GUI application. The series has now covered all the essential basics. Hopefully the next entries can put this information together and show how it can be used. I won't be covering data binding just yet, we've got events, images and dialogs (at least) to go through first... ;-) Oh, as usual, corrections and comments welcomed. All the best, Michael Foord http://www.voidspace.org.uk/python/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 24 17:30:14 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 24 Jul 2006 08:30:14 -0700 Subject: [IronPython] IronPython Console on Unix. In-Reply-To: <44C2A4FE.1080803@voidspace.org.uk> References: <44B4BAB0.2070601@free.fr> <5b0248170607120652n32febcbdxb0225fca986fe221@mail.gmail.com> <44B5013C.2000000@free.fr> <1152729014.12777.96.camel@erandi.cam.novell.com> <7AD436E4270DD54A94238001769C222725D9E3A1F6@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <44C29EF0.1060504@voidspace.org.uk> <44C2A2CB.70005@kaydash.za.net> <44C2A4FE.1080803@voidspace.org.uk> Message-ID: <7AD436E4270DD54A94238001769C22272CDFD25B28@DF-GRTDANE-MSG.exchange.corp.microsoft.com> FYI this fix was checked in late last week so if anyone wants to try it out w/ the latest CodePlex sources and let us know what they think of the current behavior that'd be great :). We don't do anything special to not require enter though so this behavior may be close but not entirely 100% the same. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Saturday, July 22, 2006 3:22 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Console on Unix. Jonathan Jacobs wrote: > Michael Foord wrote: > >> Hmm... I've just tried it on several windows interpreters. >> >> Ctrl-Z as an exit works on Python 2.2.3 (???), but not Python 2.3, >> 2.4, or 2.5b1 >> > > Did you forget to press enter after typing Ctrl-Z, like the "exit" message says? > Nope I didn't forget - and it still didn't work. Fuzzyman http://www.voidspace.org.uk/python/index.shtml > Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] > on win32 Type "help", "copyright", "credits" or "license" for more information. > >>> exit > 'Use Ctrl-Z plus Return to exit.' > > Incidentally, under *nix there is no need for enter after pressing Ctrl-D. > > Python 2.4.4c0 (#2, Jun 14 2006, 22:35:41) [GCC 4.1.2 20060613 > (prerelease) (Debian 4.1.1-4)] on linux2 Type "help", "copyright", > "credits" or "license" for more information. > >>> exit > 'Use Ctrl-D (i.e. EOF) to exit.' > _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From graham.bloice at trihedral.com Mon Jul 24 17:45:31 2006 From: graham.bloice at trihedral.com (Graham Bloice) Date: Mon, 24 Jul 2006 16:45:31 +0100 Subject: [IronPython] IronPython Console on Unix. In-Reply-To: <44C2A4FE.1080803@voidspace.org.uk> Message-ID: > > > >> Hmm... I've just tried it on several windows interpreters. > >> > >> Ctrl-Z as an exit works on Python 2.2.3 (???), but not Python > 2.3, 2.4, > >> or 2.5b1 > >> > > > > Did you forget to press enter after typing Ctrl-Z, like the > "exit" message says? > > > Nope I didn't forget - and it still didn't work. > Works fine for me on Python 2.4 & 2.4.2 !! Graham From jsacksteder at gmail.com Tue Jul 25 06:42:29 2006 From: jsacksteder at gmail.com (jeff sacksteder) Date: Tue, 25 Jul 2006 00:42:29 -0400 Subject: [IronPython] Ah, DataGridView- my cruel, inconstant muse. Message-ID: <51c8a7be0607242142k36492689jaad03c8d08fa9963@mail.gmail.com> DataGridViewCheckBoxColumns seem to return (True|None) instead of (True|False) even if The ThreeState and FalseValue attributes are set to 'False'. One of us is in error... -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Maly at microsoft.com Tue Jul 25 06:55:40 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Mon, 24 Jul 2006 21:55:40 -0700 Subject: [IronPython] Ah, DataGridView- my cruel, inconstant muse. In-Reply-To: <51c8a7be0607242142k36492689jaad03c8d08fa9963@mail.gmail.com> Message-ID: Which method on the DataGridViewCheckBoxColumn are you calling? ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of jeff sacksteder Sent: Monday, July 24, 2006 9:42 PM To: users at lists.ironpython.com Subject: [IronPython] Ah, DataGridView- my cruel, inconstant muse. DataGridViewCheckBoxColumns seem to return (True|None) instead of (True|False) even if The ThreeState and FalseValue attributes are set to 'False'. One of us is in error... -------------- next part -------------- An HTML attachment was scrubbed... URL: From textdirected at gmail.com Tue Jul 25 09:19:15 2006 From: textdirected at gmail.com (HEMMI, Shigeru) Date: Tue, 25 Jul 2006 16:19:15 +0900 Subject: [IronPython] ImportError: No module named parser Message-ID: In IP, parser - an interface to Python's internal parser, is not implemented. Is it a problem or not? IronPython 1.0.60712 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import parser Traceback (most recent call last): File , line 0, in ##3 File , line 0, in __import__##7 ImportError: No module named parser >>> From WSadkin at Parlancecorp.com Tue Jul 25 17:09:31 2006 From: WSadkin at Parlancecorp.com (Will Sadkin) Date: Tue, 25 Jul 2006 11:09:31 -0400 Subject: [IronPython] IronPython (PythonCodePovider) for ASP.NET? Message-ID: <61957B071FF421419E567A28A45C7FE505DFE1F7@mailbox.nameconnector.com> Except for one casual mention of this back in August of last year, I can't find any mention of any plans for this. For me, this is the "holy grail" for IronPython; I need a rapid webapp design and implementation framework, but ideally would like to use Python to drive the business logic behind it. Can anyone on this list provide any information about any plans and or target dates for IronPython's integration into the ASP.NET framework? /Will Sadkin Parlance Corporation From benoist.jamin at free.fr Sat Jul 22 22:51:13 2006 From: benoist.jamin at free.fr (Benoist JAMIN) Date: Sat, 22 Jul 2006 22:51:13 +0200 Subject: [IronPython] Seek fails Message-ID: <000301c6add0$91c30dc0$0100a8c0@edelweiss> I need to get file size. Here's my Python code: fd = open("c:\\parser.py", 'r'); fd.seek(0, 2); size =fd.tell(); Python returns the correct file size but IronPython returns 0. I had a look at the source code and I would say a bug exists. Does anyone confirm? -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesse.granden at gmail.com Mon Jul 24 00:05:46 2006 From: jesse.granden at gmail.com (Jesse Granden) Date: Sun, 23 Jul 2006 17:05:46 -0500 Subject: [IronPython] Import Bug with 1.0 Beta 9 Message-ID: Hi, I ran across this while trying to get sqlalchemy working with IronPython. If a package's __init__.py defines a method with the same name as a module in that package, you can't import the module. example: test.py:: import foo.bar as b print b foo/__init__.py:: def bar(): pass foo/bar.py:: pass ----------------------------- C:\IronPython-1.0-Beta9>python test.py C:\IronPython-1.0-Beta9>ipy test.py ------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From kmmbvnr at gmail.com Mon Jul 24 09:58:08 2006 From: kmmbvnr at gmail.com (=?KOI8-R?B?7cnIwcnMIPDPxMfV0tPLyco=?=) Date: Mon, 24 Jul 2006 13:58:08 +0600 Subject: [IronPython] ActiveX Winfowms and IronPython Message-ID: Is there any way to add any ActiveX controls to WinForm in IronPython code? -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Tue Jul 25 17:37:15 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 25 Jul 2006 08:37:15 -0700 Subject: [IronPython] IronPython (PythonCodePovider) for ASP.NET? In-Reply-To: <61957B071FF421419E567A28A45C7FE505DFE1F7@mailbox.nameconnector.com> References: <61957B071FF421419E567A28A45C7FE505DFE1F7@mailbox.nameconnector.com> Message-ID: <7AD436E4270DD54A94238001769C22272CDFD25F49@DF-GRTDANE-MSG.exchange.corp.microsoft.com> We actually do have a PythonCodeProvider that can be enabled by setting up a web.config that points at IronPython.dll's PythonProvider class. It is highly experimental and using this compilation mode doesn't pass our full test suite - in other words you might find some features work incorrectly or don't work at all. We're also investigating other options to try and come up w/ the right model here - we're not sure this is the right way to do ASP.NET & Python together. This might give you something to play with and as always we'd love to hear your feedback, but you probably don't want to make any long-term bets on it. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Will Sadkin Sent: Tuesday, July 25, 2006 8:10 AM To: 'users at lists.ironpython.com' Subject: [IronPython] IronPython (PythonCodePovider) for ASP.NET? Except for one casual mention of this back in August of last year, I can't find any mention of any plans for this. For me, this is the "holy grail" for IronPython; I need a rapid webapp design and implementation framework, but ideally would like to use Python to drive the business logic behind it. Can anyone on this list provide any information about any plans and or target dates for IronPython's integration into the ASP.NET framework? /Will Sadkin Parlance Corporation _______________________________________________ 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 25 17:53:35 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 25 Jul 2006 08:53:35 -0700 Subject: [IronPython] ImportError: No module named parser In-Reply-To: References: Message-ID: <7AD436E4270DD54A94238001769C22272CDFD25F57@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Well, it's only a problem if you need the parser module :) I've opened CodePlex work item 1347 for this - http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkItemId=1347 - it'll have to wait until after 1.0 at this point though because we're too close to the 1.0 release. We've also had a similar request for better quality checking tools support which rely on the parser module so this is starting to look more compelling. Thanks for reporting this. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of HEMMI, Shigeru Sent: Tuesday, July 25, 2006 12:19 AM To: Discussion of IronPython Subject: [IronPython] ImportError: No module named parser In IP, parser - an interface to Python's internal parser, is not implemented. Is it a problem or not? IronPython 1.0.60712 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import parser Traceback (most recent call last): File , line 0, in ##3 File , line 0, in __import__##7 ImportError: No module named parser >>> _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From slide.o.mix at gmail.com Tue Jul 25 18:09:20 2006 From: slide.o.mix at gmail.com (Slide) Date: Tue, 25 Jul 2006 09:09:20 -0700 Subject: [IronPython] IronPython (PythonCodePovider) for ASP.NET? In-Reply-To: <7AD436E4270DD54A94238001769C22272CDFD25F49@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <61957B071FF421419E567A28A45C7FE505DFE1F7@mailbox.nameconnector.com> <7AD436E4270DD54A94238001769C22272CDFD25F49@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: If you could combine something like Twisted with ASP.NET...woohoo! On 7/25/06, Dino Viehland wrote: > We actually do have a PythonCodeProvider that can be enabled by setting up a web.config that points at IronPython.dll's PythonProvider class. It is highly experimental and using this compilation mode doesn't pass our full test suite - in other words you might find some features work incorrectly or don't work at all. > > We're also investigating other options to try and come up w/ the right model here - we're not sure this is the right way to do ASP.NET & Python together. This might give you something to play with and as always we'd love to hear your feedback, but you probably don't want to make any long-term bets on it. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Will Sadkin > Sent: Tuesday, July 25, 2006 8:10 AM > To: 'users at lists.ironpython.com' > Subject: [IronPython] IronPython (PythonCodePovider) for ASP.NET? > > Except for one casual mention of this back in August of last year, I can't find any mention of any plans for this. > > For me, this is the "holy grail" for IronPython; I need a rapid webapp design and implementation framework, but ideally would like to use Python to drive the business logic behind it. Can anyone on this list provide any information about any plans and or target dates for IronPython's integration into the ASP.NET framework? > > /Will Sadkin > Parlance Corporation > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.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 WSadkin at Parlancecorp.com Tue Jul 25 19:25:11 2006 From: WSadkin at Parlancecorp.com (Will Sadkin) Date: Tue, 25 Jul 2006 13:25:11 -0400 Subject: [IronPython] IronPython (PythonCodePovider) for ASP.NET? Message-ID: <61957B071FF421419E567A28A45C7FE505DFE1F8@mailbox.nameconnector.com> Hi Dino, Please excuse me, as I'm new to this list: I assume "we" in that sentence is Microsoft? (The response provided leads to some obvious follow questions:) - What are the concerns/issues with this approach? Isn't this the intended mechanism for extending support for new stuff under ASP.NET? - If you decide that it's "not the right way to do" it, what are the alternatives for doing ASP.NET and Python, and how would they work? - Is Microsoft actually planning a supported integration w/IP and ASP.NET? - Can you tell us when will there be a real strategy/beta that I *can* make bets on? /Will Dino Viehland wrote: > We actually do have a PythonCodeProvider that can be enabled by > setting up a web.config that points at IronPython.dll's > PythonProvider class. It is highly experimental and using this > compilation mode doesn't pass our full test suite - in other words > you might find some features work incorrectly or don't work at all. > > We're also investigating other options to try and come up w/ the > right model here - we're not sure this is the right way to do ASP.NET > & Python together. This might give you something to play with and as > always we'd love to hear your feedback, but you probably don't want > to make any long-term bets on it. > > -----Original Message----- > From: users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] On Behalf Of Will Sadkin > Sent: Tuesday, July 25, 2006 8:10 AM > To: 'users at lists.ironpython.com' > Subject: [IronPython] IronPython (PythonCodePovider) for ASP.NET? > > Except for one casual mention of this back in August of last year, I > can't find any mention of any plans for this. > > For me, this is the "holy grail" for IronPython; I need a rapid > webapp design and implementation framework, but ideally would like to > use Python to drive the business logic behind it. Can anyone on this > list provide any information about any plans and or target dates for > IronPython's integration into the ASP.NET framework? > > /Will Sadkin > Parlance Corporation > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.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 jsacksteder at gmail.com Tue Jul 25 19:25:29 2006 From: jsacksteder at gmail.com (jeff sacksteder) Date: Tue, 25 Jul 2006 13:25:29 -0400 Subject: [IronPython] When does data binding occur? Message-ID: <51c8a7be0607251025o1f392152o5ffcb18e5dc96714@mail.gmail.com> In my __init__ method, I create a DataGridview and set it's datasource to a BindingSource previously created. If the very last line of my __init__ gets the 'Rows' property of the DGV, it is an empty collection. I can get other attributes( like 'Name') without any problem. If I get 'Rows' from outside the __init__ method, I see what I expect. Is the binding delayed until the method returns? Is there anyway to force the Rows to be populated so that that can be examined/manipulated before returning? -------------- next part -------------- An HTML attachment was scrubbed... URL: From haiboluo at exchange.microsoft.com Tue Jul 25 20:07:11 2006 From: haiboluo at exchange.microsoft.com (Haibo Luo) Date: Tue, 25 Jul 2006 11:07:11 -0700 Subject: [IronPython] Seek fails In-Reply-To: <000301c6add0$91c30dc0$0100a8c0@edelweiss> Message-ID: Thanks for reporting this. This has been fixed in recent build. You may go to our codeplex site and download the source. ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Benoist JAMIN Sent: Saturday, July 22, 2006 1:51 PM To: users at lists.ironpython.com Subject: [IronPython] Seek fails I need to get file size. Here's my Python code: fd = open("c:\\parser.py", 'r'); fd.seek(0, 2); size =fd.tell(); Python returns the correct file size but IronPython returns 0. I had a look at the source code and I would say a bug exists. Does anyone confirm? -------------- next part -------------- An HTML attachment was scrubbed... URL: From haiboluo at exchange.microsoft.com Tue Jul 25 20:16:12 2006 From: haiboluo at exchange.microsoft.com (Haibo Luo) Date: Tue, 25 Jul 2006 11:16:12 -0700 Subject: [IronPython] Import Bug with 1.0 Beta 9 In-Reply-To: Message-ID: Thanks for reporting this. I opened a bug at http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkItemId=1348. Unfortunately we will unable to fix it in the next release, which will be out soon. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jesse Granden Sent: Sunday, July 23, 2006 3:06 PM To: users at lists.ironpython.com Subject: [IronPython] Import Bug with 1.0 Beta 9 Hi, I ran across this while trying to get sqlalchemy working with IronPython. If a package's __init__.py defines a method with the same name as a module in that package, you can't import the module. example: test.py:: import foo.bar as b print b foo/__init__.py:: def bar(): pass foo/bar.py:: pass ----------------------------- C:\IronPython-1.0-Beta9>python test.py C:\IronPython-1.0-Beta9>ipy test.py ------------------------------- From dinov at exchange.microsoft.com Tue Jul 25 20:46:58 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 25 Jul 2006 11:46:58 -0700 Subject: [IronPython] IronPython (PythonCodePovider) for ASP.NET? In-Reply-To: <61957B071FF421419E567A28A45C7FE505DFE1F8@mailbox.nameconnector.com> References: <61957B071FF421419E567A28A45C7FE505DFE1F8@mailbox.nameconnector.com> Message-ID: <7AD436E4270DD54A94238001769C22272F38A14AE0@DF-GRTDANE-MSG.exchange.corp.microsoft.com> The first we actually applies more to the world than just MS. This is something that we've shipped w/ the past 2 or 3 betas. The we're is definitely MS / the IronPython team. The main concern is that we are shoe-horning a dynmamic language into a static world and that's not really the right thing to do. With enough effort we might be able to pull it off, but there might be a better way to go which enables ASP.NET w/o the feeling of it not being Python. There might also always be rough edges that we can never quite make work correctly - and given we've spent all this time making IronPython work like CPython we don't want to just throw that away. Just to give you some concrete examples of what doesn't work with the static compiler we have today: Multiple inheritance Overloading functions when there are multiple virtuals to overload Inheriting from assemblies dynamically added at runtime (e.g. clr.AddReference) Dealing w/ "well-known names" that aren't really well-known (e.g. object, property, etc...) and can be redefined OTOH you should be able to do all of this once you're inside ASP.NET script tags modulo bugs (which there are probably plenty of). We're still researching other options so it's a little too soon to say what the alternatives would look like. And the final two questions I don't think we have answers to right now, but we'll be sure to let you know when we have more to say. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Will Sadkin Sent: Tuesday, July 25, 2006 10:25 AM To: 'Discussion of IronPython' Subject: Re: [IronPython] IronPython (PythonCodePovider) for ASP.NET? Hi Dino, Please excuse me, as I'm new to this list: I assume "we" in that sentence is Microsoft? (The response provided leads to some obvious follow questions:) - What are the concerns/issues with this approach? Isn't this the intended mechanism for extending support for new stuff under ASP.NET? - If you decide that it's "not the right way to do" it, what are the alternatives for doing ASP.NET and Python, and how would they work? - Is Microsoft actually planning a supported integration w/IP and ASP.NET? - Can you tell us when will there be a real strategy/beta that I *can* make bets on? /Will Dino Viehland wrote: > We actually do have a PythonCodeProvider that can be enabled by > setting up a web.config that points at IronPython.dll's PythonProvider > class. It is highly experimental and using this compilation mode > doesn't pass our full test suite - in other words you might find some > features work incorrectly or don't work at all. > > We're also investigating other options to try and come up w/ the right > model here - we're not sure this is the right way to do ASP.NET & > Python together. This might give you something to play with and as > always we'd love to hear your feedback, but you probably don't want to > make any long-term bets on it. > > -----Original Message----- > From: users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] On Behalf Of Will Sadkin > Sent: Tuesday, July 25, 2006 8:10 AM > To: 'users at lists.ironpython.com' > Subject: [IronPython] IronPython (PythonCodePovider) for ASP.NET? > > Except for one casual mention of this back in August of last year, I > can't find any mention of any plans for this. > > For me, this is the "holy grail" for IronPython; I need a rapid webapp > design and implementation framework, but ideally would like to use > Python to drive the business logic behind it. Can anyone on this list > provide any information about any plans and or target dates for > IronPython's integration into the ASP.NET framework? > > /Will Sadkin > Parlance Corporation > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.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 gmail.com Wed Jul 26 00:17:09 2006 From: fuzzyman at gmail.com (Michael Foord) Date: Tue, 25 Jul 2006 22:17:09 -0000 Subject: [IronPython] IronPython & Windows Forms VII, Dock & Anchor In-Reply-To: <7AD436E4270DD54A94238001769C22272CDFD25B23@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <44C2800A.9090609@voidspace.org.uk> <7AD436E4270DD54A94238001769C22272CDFD25B23@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <1153865829.542418.102490@m79g2000cwm.googlegroups.com> Dino Viehland wrote: > I've added this to the list of articles at http://www.codeplex.com/Wiki/View.aspx?ProjectName=IronPython&title=More%20Information (the other 4 were already up there). That's great, thanks. I'm getting quite a few hits from those links, so it looks like the subject is popular. For what it's worth, there are six others rather than four others. As each entry starts with links to the others it's not really an issue though... :-) All the best, Michael Foord http://www.voidspace.org.uk/python/index.shtml > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Saturday, July 22, 2006 12:44 PM > To: Discussion of IronPython > Subject: [IronPython] IronPython & Windows Forms VII, Dock & Anchor > > Hello all, > > I've completed another entry in the "IronPython & Windows Forms" series. > > http://www.voidspace.org.uk/python/weblog/arch_d7_2006_07_22.shtml#e399 > > This one covers using the Dock and Anchor properties to layout controls in a form. It is a short entry, but contains essential information for creating any GUI application. > > The series has now covered all the essential basics. Hopefully the next entries can put this information together and show how it can be used. I won't be covering data binding just yet, we've got events, images and dialogs (at least) to go through first... ;-) > > Oh, as usual, corrections and comments welcomed. > > All the best, > > Michael Foord > http://www.voidspace.org.uk/python/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 Wed Jul 26 01:18:44 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 25 Jul 2006 16:18:44 -0700 Subject: [IronPython] IronPython & Windows Forms VII, Dock & Anchor In-Reply-To: <1153865829.542418.102490@m79g2000cwm.googlegroups.com> References: <44C2800A.9090609@voidspace.org.uk> <7AD436E4270DD54A94238001769C22272CDFD25B23@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <1153865829.542418.102490@m79g2000cwm.googlegroups.com> Message-ID: <7AD436E4270DD54A94238001769C22272F38A14CF8@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Thanks for pointing that out - I've updated it (removed the part #s, added the description names and all 7 articles). -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Tuesday, July 25, 2006 3:17 PM To: users at lists.ironpython.com Subject: Re: [IronPython] IronPython & Windows Forms VII, Dock & Anchor Dino Viehland wrote: > I've added this to the list of articles at http://www.codeplex.com/Wiki/View.aspx?ProjectName=IronPython&title=More%20Information (the other 4 were already up there). That's great, thanks. I'm getting quite a few hits from those links, so it looks like the subject is popular. For what it's worth, there are six others rather than four others. As each entry starts with links to the others it's not really an issue though... :-) All the best, Michael Foord http://www.voidspace.org.uk/python/index.shtml > > -----Original Message----- > From: users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Saturday, July 22, 2006 12:44 PM > To: Discussion of IronPython > Subject: [IronPython] IronPython & Windows Forms VII, Dock & Anchor > > Hello all, > > I've completed another entry in the "IronPython & Windows Forms" series. > > > http://www.voidspace.org.uk/python/weblog/arch_d7_2006_07_22.shtml#e39 > 9 > > This one covers using the Dock and Anchor properties to layout controls in a form. It is a short entry, but contains essential information for creating any GUI application. > > The series has now covered all the essential basics. Hopefully the > next entries can put this information together and show how it can be > used. I won't be covering data binding just yet, we've got events, > images and dialogs (at least) to go through first... ;-) > > Oh, as usual, corrections and comments welcomed. > > All the best, > > Michael Foord > http://www.voidspace.org.uk/python/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 Jim.Hugunin at microsoft.com Wed Jul 26 01:36:05 2006 From: Jim.Hugunin at microsoft.com (Jim Hugunin) Date: Tue, 25 Jul 2006 16:36:05 -0700 Subject: [IronPython] speed In-Reply-To: <002b01c6a560$a7856ae0$c51ce818@luis> Message-ID: You're correct that most of our work in getting to IronPython 1.0 has been focused on completeness and correctness rather than performance. IronPython 1.0 is roughly as fast as IronPython 0.1 was - which is reasonably fast (see more at the end of this message). As anyone who's built a large system knows, not losing performance while achieving completeness and correctness is a challenge. When we talk about IronPython performance, we try to reference specific benchmarks. The standard line you'll see is, "IronPython is fast - up to 1.8x faster than CPython on the standard pystone benchmark." Performance will vary on different tasks. Even though performance will vary, any time that IronPython is 21x slower than CPython that should be considered a bug in IronPython and you should file it as an issue on CodePlex. I ran your test script on my ThinkPad X60 laptop with a 1.83GHz Intel Core Duo processor and 1.5GB of RAM under Windows XP SP2 with the final RTM release of .NET 2.0. Running your test with the 1.0beta9 release of IronPython, I find that it is ~8x slower in IronPython than in CPython-2.4. This is much better than your result, but still is not acceptable performance for such a simple test case. Over the past week, we looked into this more closely. There were two major performance issues revealed by your test case. One was that the way we are packaging our signed release builds caused worse performance than the standard internal builds we tested on. The second issue was we had some bad performance issues calling methods on builtin types. Both of these issues have been fixed in the soon to be released IronPython 1.0 RC 1 (which you can build from the current codeplex sources today). After the fix, I find that IronPython-1.0rc1 is about 2.2x slower than CPython-2.4 on your benchmark code. While I wish that IronPython was faster on this test, for this stage of the project a ~2x performance hit on some benchmarks is considered acceptable. There are other benchmarks where IronPython will be 2x faster than CPython. In fact, I can modify your test below to write it in a more abstract style and it will run with roughly the same performance on IronPython as CPython. import time def do_x(i): if i % 2: return 10 else: return "a string" def do_z(i): if isinstance(i, str): return i.upper() else: return i*3 def test(): start= time.clock() x = [do_x(i) for i in xrange(1000000)] z = [do_z(i) for i in x] end= time.clock() - start print end test() # pre-run to ignore initialization time test() I can't stress enough how much we appreciate this kind of performance bug report. Because you included a small self-contained test script without any external dependencies, it was easy for us to isolate the issues in IronPython and get them fixed. Right now, we don't have the time to help people who are encountering performance issues in complete apps, but we can address issues when they are reported this clearly and are this easy to reproduce. The only additional thing that I would have liked to see here would be a more complete description of the machine and version of .NET and IronPython that you were running against. I mentioned at the start of this email that IronPython's performance hasn't changed much from the 0.1 version. Keep in mind that IronPython 0.1 was a tiny little translator that I wrote from Python to C# that had everything it needed to run the pystone benchmark and nothing else. I'm quite excited that we've been able to keep the good performance aspects of that initial prototype in the 1.0 release. Here's a copy of data from the original email that I sent about IronPython 0.1: -------------------------------------------------------------------- Date: Mon, 8 Dec 2003 17:16:15 -0800 From: Jim Hugunin Subject: Python can run fast on the CLR To: DOTNET-LANGUAGE-DEVS at DISCUSS.MICROSOFT.COM IronPython-0.1 Python-2.3 Python-2.1 pystone 0.58 1.00 1.29 function call 0.19 1.00 1.12 integer add 0.59 1.00 1.18 string.replace 0.92 1.00 1.00 range(bigint) 5.57 1.00 1.09 eval("2+2") 66.97 1.00 1.58 ------------------------------------------------------------------- These numbers are measuring time to run each of the benchmarks and are all relative to Python-2.3. Smaller number are better and indicate faster performance. For IronPython 0.1, the performance on function calls and integer add were both considerably faster than CPython, string.replace was roughly the same speed, range was too slow and performance on eval("2+2") was horrible. Out of curiosity, I reran these same benchmarks on 1.0rc1 as well as CPython-2.4 and 2.5beta2 using the same machine as described above. IronPython-1.0rc1 Python-2.5b2 Python-2.4 pystone 0.55 1.00 1.01 function call 0.14 1.00 0.98 integer add 0.46 1.00 1.04 string.replace 0.92 1.00 1.45 range(bigint) 6.07 1.00 1.00 eval("2+2") 14.03 1.00 0.76 If you compare the numbers closely, you should be somewhat stunned by how similar they are. I certainly was. A lot of things have changed, but the underlying results still show that IronPython is blindingly fast on function calls, ~2x faster than CPython on pystone and simple math, about the same speed on many library function calls and ~6x slower for range(bigint). The good news is that the one place where IronPython was previously 67x slower than CPython is the one place where a huge improvement can be measured and IronPython is now only 14x slower on eval("2+2"). Everywhere that IronPython is more than 2x slower than CPython is something we need to better understand. For this set of microbenchmarks, there are two cases of this. The first case is range(bigint). I believe that this 6x perf hit on range(bigint) has the same underlying cause as the 2x perf hit on Luis's benchmark below. There is something to do with building up large lists of numbers that gives IronPython trouble. This is a performance issue that we will certainly be looking into more deeply in the future and I hope to see major improvements here in the future The second performance issue is with eval("2+2"). The improvements to performance here came as a result of a new API (DynamicMethod) added in .NET 2.0 that let's us generate code for small methods much more efficiently. We'd like to see this get still faster, but it isn't an area of top concern to me since eval is very rarely used in performance critical scenarios. In fact, I've heard privately from a number of people that they wish CPython's eval could be slowed down by 10x to discourage it's use except where it is truly needed. IronPython does a lot more work compiling code in order to get its performance boosts and some additional cost to eval seems reasonable to pay here. Looking at comparisons of microbenchmarks is an interesting way to identify possible low-hanging optimization fruit for IronPython. Last week I also looked at the pybench benchmark by Marc-Andre Lemburg which includes a large number of microbenchmark tests. This was helpful to more clearly identify the same performance issue Luis's test shows for builtin method calls. From pybench, we also noticed a surprising >10x performance hit in IronPython for list and tuple slicing. This has been reduced dramatically in the 1.0rc1 release. I expect that we will look at more of these kinds of comparisons in the future as we work to further optimize IronPython. Thanks - Jim --- bench.py used to generate the tables above (copy pystone.py from Lib/test) --- import time N = 1000000 import pystone def test_pystone(L): pystone.pystones(200000) def test_call(L): def f(a,b): return for i in L: f(1,2); f(1,2); f(1,2); f(1,2); f(1,2) f(1,2); f(1,2); f(1,2); f(1,2); f(1,2) def test_add(L): x = 10 for i in L: y = x + 1; y = x + 1; y = x + 1; y = x + 1; y = x + 1 y = x + 1; y = x + 1; y = x + 1; y = x + 1; y = x + 1 def test_replace(L): s = "abcdefghi" for i in L: s.replace('def', 'DEF') s.replace('def', 'DEF') s.replace('def', 'DEF') s.replace('def', 'DEF') s.replace('def', 'DEF') s.replace('def', 'DEF') s.replace('def', 'DEF') s.replace('def', 'DEF') s.replace('def', 'DEF') s.replace('def', 'DEF') def test_range(L): for i in range(100): r = range(N) def test_eval(L): for i in range(10000): x = eval("2+2") def bench(func, L): start = time.clock() func(L) end = time.clock() print 'ran %s in \t%.2f seconds' % (func.__name__, end-start) tests = [test_pystone, test_call, test_add, test_replace, test_range, test_eval] L = range(N) for i in range(2): for test in tests: bench(test, L) ------------------------------------------------------------------------------------ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Luis M. Gonzalez Sent: Tuesday, July 11, 2006 8:10 PM To: users at lists.ironpython.com Subject: [IronPython] speed Hi everyone, I'd like to ask you a question about Ironpython's speed and performance: I imagine that so far, you've been concentrated in completeness and compatibility more than performance, and I guess you'll address this issue after verion 1.0. However, and although you claimed that Ironpython is faster than cpython, I see cases where it is slower by a large margin. For example, the script below is up to 21x slower than cpython. My question is: what are your expectations regarding ironpython's speed in the future? According to your experience so far, are you confident that it will match or surpass cpython's? Where do you think it will be better and where it will be worse? script ----------------------------- import time def test(): start= time.clock() z=[] x=range(1000000) for i in range(1000000): if i % 2: x[i] = 10 else: x[i] = "a string" for i in x: if type(i)==str: z.append(i.upper()) else: z.append(i*3) end= time.clock() - start print end test() ----------------------------------- end script Regards, Luis From arman at twinsun.com Wed Jul 26 02:02:53 2006 From: arman at twinsun.com (Arman Bostani) Date: Tue, 25 Jul 2006 17:02:53 -0700 Subject: [IronPython] profiling ipy apps Message-ID: <44C6B12D.5050007@twinsun.com> Hello all, Is there a recommended process for profiling ipy applications? Understandably, the cpython profile module doesn't work (no sys.setprofile). Also, CLR Profiler isn't geared towards performance analysis. So, do I need to somehow run my ipy applications under VS 2005 Team Suite? Thanks, -arman From mark.john.rees at gmail.com Wed Jul 26 02:29:41 2006 From: mark.john.rees at gmail.com (Mark Rees) Date: Wed, 26 Jul 2006 10:29:41 +1000 Subject: [IronPython] IronPython (PythonCodePovider) for ASP.NET? In-Reply-To: <7AD436E4270DD54A94238001769C22272F38A14AE0@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <61957B071FF421419E567A28A45C7FE505DFE1F8@mailbox.nameconnector.com> <7AD436E4270DD54A94238001769C22272F38A14AE0@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: Dino wrote: The main concern is that we are shoe-horning a dynmamic language into a static world and that's not really the right thing to do. With enough effort we might be able to pull it off, but there might be a better way to go which enables ASP.NET w/o the feeling of it not being Python. There might also always be rough edges that we can never quite make work correctly - and given we've spent all this time making IronPython work like CPython we don't want to just throw that away. One pythonic way of "hosting" IronPython within ASP.NET is to use WSGI (http://wsgi.org/wsgi/What_is_WSGI) Seo did the original work and I have made his stuff more WSGI PEP compliant and work with the latest IronPython Beta hosting API. SInce Seo is not near a network connection for a few weeks and cannot add these changes to his code, I have put my changes up under subversion at: http://svn.isapi-wsgi.python-hosting.com/sandbox/mark/ironpy-wsgi/ It does give you access to "true" ASP.NET page generation, needs some docs and a lillte more work. But I have been using it for RSS/Atom feed generation from a ADO.NET database under both IIS ASP.NET and Apache mod_mono. This email post of Seo's should help you get going: http://lists.ironpython.com/pipermail/users-ironpython.com/2006-March/002049.html Mark From mark.john.rees at gmail.com Wed Jul 26 02:40:45 2006 From: mark.john.rees at gmail.com (Mark Rees) Date: Wed, 26 Jul 2006 10:40:45 +1000 Subject: [IronPython] IronPython (PythonCodePovider) for ASP.NET? In-Reply-To: References: <61957B071FF421419E567A28A45C7FE505DFE1F8@mailbox.nameconnector.com> <7AD436E4270DD54A94238001769C22272F38A14AE0@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: On 7/26/06, Mark Rees wrote: > It does give you access to "true" ASP.NET page generation, needs some > docs and a lillte more work. Opps, a small typo, I meant: It does not give you access to "true" ASP.NET page generation, Sorry if the typo got people excited. :-) Mark From LThompson at ixiacom.com Wed Jul 26 02:42:00 2006 From: LThompson at ixiacom.com (Lyle Thompson) Date: Tue, 25 Jul 2006 17:42:00 -0700 Subject: [IronPython] IronPython and Swig Message-ID: <07441B92D00E8E4C81BF91F4DE2B46D105CE7995@ixca-ex99.ixiacom.com> Hi All, I have a C++ DLL that I wrapped with Swig. Inside the python wrapper it imports the DLL, i.e. "import _myDll". In IronPython, I get the error: ImportError: No Module named _myDll. I have made sure that the directory with my DLL is in both my PATH and PYTHONPATH. Does IronPython not support this usage of the import statement? Thanks, Lyle From dinov at exchange.microsoft.com Wed Jul 26 02:43:19 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 25 Jul 2006 17:43:19 -0700 Subject: [IronPython] IronPython and Swig In-Reply-To: <07441B92D00E8E4C81BF91F4DE2B46D105CE7995@ixca-ex99.ixiacom.com> References: <07441B92D00E8E4C81BF91F4DE2B46D105CE7995@ixca-ex99.ixiacom.com> Message-ID: <7AD436E4270DD54A94238001769C22272F38E1103D@DF-GRTDANE-MSG.exchange.corp.microsoft.com> You'll need to tell us about the DLL first: import clr clr.AddReference('_myDll') import someNamespaceOrTypeFrom_myDll then we'll be able to load types & namespaces from it. ________________________________________ From: users-bounces at lists.ironpython.com On Behalf Of Lyle Thompson Sent: Tuesday, July 25, 2006 5:42 PM To: users at lists.ironpython.com Subject: [IronPython] IronPython and Swig Hi All, I have a C++ DLL that I wrapped with Swig. Inside the python wrapper it imports the DLL, i.e. "import _myDll". In IronPython, I get the error: ImportError: No Module named _myDll. I have made sure that the directory with my DLL is in both my PATH and PYTHONPATH. Does IronPython not support this usage of the import statement? Thanks, Lyle _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Wed Jul 26 03:31:01 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 25 Jul 2006 18:31:01 -0700 Subject: [IronPython] IronPython 1.0 RC1 is Released Message-ID: <7AD436E4270DD54A94238001769C22272F38A14DD8@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Hello IronPython Community, We have just released IronPython 1.0 RC1. We're anticipating that this build will be the same as 1.0 final unless we hear otherwise. We're looking for any feedback, but in particular we'd like to know of any blocking issues discovered against this build or fundamental language incompatibilities. Please try out the latest build over the next 2 weeks and let us know if you encounter any issues as soon as possible. Additionally, if there are any 1.01 Alpha bugs on CodePlex that are blocking you please bring these to our attention so we can take a second look at them. Our goal for IronPython 1.0 is to be compatible with CPython 2.4 We've fixed all known language incompatibilities and implemented a large number of the standard CPython built-in modules with a focus on those most used. RC1 includes one new module that hasn't shipped previous (cPickle). We do have some issues remaining but we believe these will not affect compatability with CPython. In addition RC1 has several new 2.5 Python features that can be enabled with the experimental switch -X:Python25, but by default these are disabled: a. PEP 308: Conditional Expressions b. PEP 343: The 'with' statement. (as per PEP 343, you need to do 'from __future__ import with_statement' for enabling 'with' statement ) c. Other Language Changes 1. The dict type has a new hook for letting subclasses provide a default value with '__missing__' method. 2. Both 8-bit and Unicode strings have new partition(sep) and rpartition(sep) methods. 3. The startswith() and endswith() methods of string types now accept tuples of strings to check for. 4. The min() and max() built-in functions gained a 'key' keyword parameter. 5. Two new built-in functions, any() and all(), evaluate whether an iterator contains any true or false values. 6. The list of base classes in a class definition can now be empty. You can download the release from: http://www.CodePlex.com/IronPython We'd like to thank everyone in the community for your bug reports and suggestions that helped make this a better release: audespc, Jonathan Jacobs, Lee Culver, Luis M. Gonzalez, Miguel de Icaza, Mike Raath, paparipote, Sanghyeon Seo, and Vincent Wehren. Thanks and keep in touch, The IronPython Team More complete list of changes and bug fixes: ============================================ Bugfix: 824 - IP Fails to trap AttributeError from __getattr__ Bugfix: 825 - weakref.proxy needs all special methods Bugfix: test_descr: two class init issues Bugfix: test_descr: minor negative cases we're missing (classmethod, __cmp__, __get__, read-only properties) Bugfix: test_descr: dict compat issues Bugfix: test_descr: four minor issues (wrong except on invalid format string, hex is uppercase, moduletype, Ellipsis) Bugfix: 872 - NullRef exception in finally w/o yield ClrModule.Path was deprecated, to be removed in Beta 7, but it's still there Also removed sys.LoadAssemblyXXX methods Tutorial Update: Added some bulletproofing to pyevent.py so that you could only add callable objects to events, quietly handle removing handlers that aren't there, and r emoved some old/unused code. Tutorial Update: Added comments to winforms to explain what it was doing and why Bugfix: 348 RE_Pattern.match matches start-of-string too optimistically when endpos is specified Bugfix: 438 os functions raise wrong exception types Bugfix: 897 Memory leak in ClrModule Bugfix: 901 SystemError when deriving from a parent class and a grandparent class with __slots__ Bugfix: 813 Builtin eval with dict subclass as locals does not work as in CPython 2.4 Bugfix: Add filename, lineno, offset and text to SyntaxError Exception when dealing with pure Python Bugfix: test_sys: Implement various missing sys functions WAS: Implement sys.settrace function Bugfix: cpython supports backslash to concat long string? Bugfix: clr.LoadAssemblyByName and LoadAssemblyByPartialName publish the assembly Bugfix: MethodBinder: choose which explicitly implemetned interface methods with the same name Bugfix: implement type.mro()Bugfix: test_isinstance: Assertion triggered for test case calling isinstance with a class that has no __bases__ attribute Tutorial Update: Tweaks to text for winforms and avalon exercises. Added test cases for COM interop Bugfix: 1018 - Function call with expanded argument list passes values incorrectly Bugfix: AddReference* APIs eat exceptionsBugfix: Some of the ClrModule.LoadAssemblyXxx methods swallow exceptions from the Assembly APIs they call, making debugging difficult Bugfix: 940 - Cannot cast OldClass to DynamicType exception when importing xml.dom.minidom Bugfix: 922 - __getitem__ is no longer callable w/ multiple indexesBugfix: 930 - Performance degradation between beta 8 and 9 doing multi-dimensional array copies Bugfix: CodeDom: Ignore empty Indent and always force it to indent Bugfix: 871 - Overriding __call__ on type exposes Caller ContextBugfix: 921 - FancyRepr only splits on \n Bugfix: 895 - cmp() on recursive structures produces uncaught StackOverflowException and kills interpreter Bugfix: Strange behavior of MonthCalendar control causes cascading message boxes in the tutorial on Embedding IronPython Bugfix: - test_descr: three super() issues, Super had a bunch of issues - #1) Super.__get__ would return an instance of Super not an instance of whatever type Super is #2) Super was passing the wrong values for the descriptor get, resulting in the property's __get__ doing useful work #3) If we're not looking up in a subclass of what super is a super for, then we should search the real type of the insta nce, skipping the 1st class in the MRO #4) Super on super - ran into this one while writing the tests, our repr would stack overflow #5) Super __new__ / __init__ was wrong - __new__ is a NOP which yields an empty super, __init__ re-initializes the super and can be called multiple times #6) Our IDynamicObject implementation for Super wasn't reporting the right thing for subclasses Bugfix: test_descr: issues with __str__ __repr__ and subclasses of str Tutorial Update: Updated tutorial with a new exercise. Bugfix: test_descr: four __slots__ issues Bugfix: 1029 - Can't access __builtins__ when runing method compiled with PythondEngine.CompileMethod Bugfix: test_file.py failing on CPython---seems like a bug with our "seek" implementation Bugfix: Exception.__str__() exception message differs from the message given by CPython Test updates: Improvments to tests to ensure they pass on both IronPython & CPython Bugfix: Add ISlice interface to IronMath.dll Bugfix: If the count argument to re.subn is omitted or 0 then all occurrences should be replaced Bugfix: 1054 - IPy Runtime crashes making COM call with missing arguments Bugfix: System.Char.Parse('c') in set(['c']) -- fails Python 2.5 feature: __MISSING__ on dict Bugfix: 894 - Cannot implement an interface that defines an event Bugfix: COM Interop: regression - missing some methods Bugfix: We seem to be boxing the return value (bool) of 'a' == 'a' every time we call it Performance fixes for areas where we were 2-10x slower than CPython: 10x boost to tuple slicing perf by using code on object[] rather than on generic Array and smaller boost to List slicing with same code. ~2x boost to builtin and clr method lookup perf with two steps 1. Using a customized immutable SymbolId based HashTable 2. Not checking the type of self when we know it's ours The performance of looking up methods on builtin and clr types is barely noticeable in pystone and parrotbench, but should be noticeable in many real-world apps and other benchmarks. This impacts every method call to either a .NET type or a builtin Python type - which are the same thing in IronPython. Also simplified and sped-up Function and OldClass binding rules Tutorial Update: Output of dir(FileSystemEventArgs) Tutorial Update: Added TypedCode sample for Tutorial 2 Task 3 Tutorial Update: Fixed obsolete method calls in code sample of Tutorial 6, Exercise 2, Task 1&3 Bugfix: 758 - Some invalid input doesn't report error in the console Bugfix: 776 - datetime.strptime doesn't allow extra non-whitespace characters in format string Bugfix: 904 - Ctrl-Z improperly expected for EOF on Unix Bugfix: 936 - RE_Match.start doesn't accept group name Bugfix: 1015 - Exception stack not filtered/formatted when exception occurs on a different thread Improved help's display & __doc__ of built-in functions & properties Bugfix: sys.exit(None) prints None to console. PythonSystemExitException.GetExitCode now returns non-integer values and the caller has to handle it appropriately. Bugfix: PythonEngine.Evaluate does not work with EngineOptions.ClrDebuggingEnabled. Added EngineModule.Import to match PythonEngine.Import which only worked with the DefaultModule. Bugfix: CreateLambda throws NullReferenceException if the expression includes a division operator Bugfix: Names for generic parameters of CreateLambda and CreateMethod don't follow same pattern as existing FX generic types Python 2.5 Feature: with Statement Bugfix: CodePlex 1075 - Type Error is not raised Bugfix: nt.unlink not deleting file properly Bugfix: issue in the marshal module (enable test_marshal.cs) Bugfix: date.strftime does not show good data Bugfix: COM interop: duplicate entries of __class__ (and __doc__, __init__ etc) in dir(com object) result Bugfix: Wrong exception when opening read-only file for write. Implemented cPickle module and made associated changes to the runtime. Bugfix: 1090 - del sys._getframe Add APP ID Icon to ipy.exe and ipyw.exe Bugfix: Deleting a class attribute should raise an error Bugfix: implement socket.getaddrinfo to ~90% fidelity of CPython Add AllowPartiallyTrustedCallers attribute to IronPython.dll and IronMath.dll From luismg at gmx.net Wed Jul 26 04:28:34 2006 From: luismg at gmx.net (Luis M. Gonzalez) Date: Tue, 25 Jul 2006 23:28:34 -0300 Subject: [IronPython] speed Message-ID: <000801c6b05b$3336cde0$c100a8c0@luis> >> The only additional thing that I would have liked to see here would be a more complete description of the machine and version of .NET and IronPython that you were running against. Hi Jim, This is how I run this script: IronPython 1.0.60712 (Beta) on .NET 2.0.50727.42 (this is Beta 9) Intel celeron 2.0 - WinXP Professional 512 Mb RAM First pass: 30.7604572648 Second pass: 29.9800466260 On the same machine with Cpython 2.4.2: First pass: 2.46591424329 Now with IronPython 1.0.60725 on .NET 2.0.50727.42 (RC 1): First pass: 7.52073545660 Second pass: 7.98481566791 So I see that Beta 9 was up to 12x slower, while the latest version is only 3x slower. Great speedup! Congratulations for the great job you and your team are doing (and thank you!) Luis -------------- next part -------------- An HTML attachment was scrubbed... URL: From redmoon17 at gmail.com Wed Jul 26 04:31:14 2006 From: redmoon17 at gmail.com (Kevin Chu) Date: Wed, 26 Jul 2006 10:31:14 +0800 Subject: [IronPython] IronPython 1.0 RC1 is Released In-Reply-To: <7AD436E4270DD54A94238001769C22272F38A14DD8@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <7AD436E4270DD54A94238001769C22272F38A14DD8@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <41d7f4a90607251931p56f84a30g8c471d31f7805586@mail.gmail.com> I am glade to hear about this greate news! Especially, it implemented a large number of the standard CPython built-in modules. But I found md5 module is not implemented yet! 2006/7/26, Dino Viehland : > Hello IronPython Community, > > We have just released IronPython 1.0 RC1. We're anticipating that this build will be the same as 1.0 final unless we hear otherwise. We're looking for any feedback, but in particular we'd like to know of any blocking issues discovered against this build or fundamental language incompatibilities. Please try out the latest build over the next 2 weeks and let us know if you encounter any issues as soon as possible. Additionally, if there are any 1.01 Alpha bugs on CodePlex that are blocking you please bring these to our attention so we can take a second look at them. > > Our goal for IronPython 1.0 is to be compatible with CPython 2.4 We've fixed all known language incompatibilities and implemented a large number of the standard CPython built-in modules with a focus on those most used. RC1 includes one new module that hasn't shipped previous (cPickle). We do have some issues remaining but we believe these will not affect compatability with CPython. In addition RC1 has several new 2.5 Python features that can be enabled with the experimental switch -X:Python25, but by default these are disabled: > > a. PEP 308: Conditional Expressions > b. PEP 343: The 'with' statement. (as per PEP 343, you need to do 'from __future__ import with_statement' for enabling 'with' statement ) > c. Other Language Changes > 1. The dict type has a new hook for letting subclasses provide a default value with '__missing__' method. > 2. Both 8-bit and Unicode strings have new partition(sep) and rpartition(sep) methods. > 3. The startswith() and endswith() methods of string types now accept tuples of strings to check for. > 4. The min() and max() built-in functions gained a 'key' keyword parameter. > 5. Two new built-in functions, any() and all(), evaluate whether an iterator contains any true or false values. > 6. The list of base classes in a class definition can now be empty. > > You can download the release from: http://www.CodePlex.com/IronPython > > We'd like to thank everyone in the community for your bug reports and suggestions that helped make this a better release: audespc, Jonathan Jacobs, Lee Culver, Luis M. Gonzalez, Miguel de Icaza, Mike Raath, paparipote, Sanghyeon Seo, and Vincent Wehren. > > Thanks and keep in touch, > The IronPython Team > > More complete list of changes and bug fixes: > ============================================ > Bugfix: 824 - IP Fails to trap AttributeError from __getattr__ > Bugfix: 825 - weakref.proxy needs all special methods > Bugfix: test_descr: two class init issues > Bugfix: test_descr: minor negative cases we're missing (classmethod, __cmp__, __get__, read-only properties) > Bugfix: test_descr: dict compat issues > Bugfix: test_descr: four minor issues (wrong except on invalid format string, hex is uppercase, moduletype, Ellipsis) > Bugfix: 872 - NullRef exception in finally w/o yield > ClrModule.Path was deprecated, to be removed in Beta 7, but it's still there > Also removed sys.LoadAssemblyXXX methods > Tutorial Update: Added some bulletproofing to pyevent.py so that you could only add callable objects to events, quietly handle removing handlers that aren't there, and r > emoved some old/unused code. > Tutorial Update: Added comments to winforms to explain what it was doing and why > Bugfix: 348 RE_Pattern.match matches start-of-string too optimistically when endpos is specified > Bugfix: 438 os functions raise wrong exception types > Bugfix: 897 Memory leak in ClrModule > Bugfix: 901 SystemError when deriving from a parent class and a grandparent class with __slots__ > Bugfix: 813 Builtin eval with dict subclass as locals does not work as in CPython 2.4 > Bugfix: Add filename, lineno, offset and text to SyntaxError Exception when dealing with pure Python > Bugfix: test_sys: Implement various missing sys functions WAS: Implement sys.settrace function > Bugfix: cpython supports backslash to concat long string? > Bugfix: clr.LoadAssemblyByName and LoadAssemblyByPartialName publish the assembly > Bugfix: MethodBinder: choose which explicitly implemetned interface methods with the same name > Bugfix: implement type.mro()Bugfix: test_isinstance: Assertion triggered for test case calling isinstance with a class that has no __bases__ attribute > Tutorial Update: Tweaks to text for winforms and avalon exercises. > Added test cases for COM interop > Bugfix: 1018 - Function call with expanded argument list passes values incorrectly > Bugfix: AddReference* APIs eat exceptionsBugfix: Some of the ClrModule.LoadAssemblyXxx methods swallow exceptions from the Assembly APIs they call, making debugging difficult > Bugfix: 940 - Cannot cast OldClass to DynamicType exception when importing xml.dom.minidom > Bugfix: 922 - __getitem__ is no longer callable w/ multiple indexesBugfix: 930 - Performance degradation between beta 8 and 9 doing multi-dimensional array copies > Bugfix: CodeDom: Ignore empty Indent and always force it to indent > Bugfix: 871 - Overriding __call__ on type exposes Caller ContextBugfix: 921 - FancyRepr only splits on \n > Bugfix: 895 - cmp() on recursive structures produces uncaught StackOverflowException and kills interpreter > Bugfix: Strange behavior of MonthCalendar control causes cascading message boxes in the tutorial on Embedding IronPython > Bugfix: - test_descr: three super() issues, Super had a bunch of issues - > #1) Super.__get__ would return an instance of Super not an instance of whatever type Super is > #2) Super was passing the wrong values for the descriptor get, resulting in the property's __get__ doing useful work > #3) If we're not looking up in a subclass of what super is a super for, then we should search the real type of the insta > nce, skipping the 1st class in the MRO > #4) Super on super - ran into this one while writing the tests, our repr would stack overflow > #5) Super __new__ / __init__ was wrong - __new__ is a NOP which yields an empty super, __init__ re-initializes the super > and can be called multiple times > #6) Our IDynamicObject implementation for Super wasn't reporting the right thing for subclasses > Bugfix: test_descr: issues with __str__ __repr__ and subclasses of str > Tutorial Update: Updated tutorial with a new exercise. > Bugfix: test_descr: four __slots__ issues > Bugfix: 1029 - Can't access __builtins__ when runing method compiled with PythondEngine.CompileMethod > Bugfix: test_file.py failing on CPython---seems like a bug with our "seek" implementation > Bugfix: Exception.__str__() exception message differs from the message given by CPython > Test updates: Improvments to tests to ensure they pass on both IronPython & CPython > Bugfix: Add ISlice interface to IronMath.dll > Bugfix: If the count argument to re.subn is omitted or 0 then all occurrences should be replaced > Bugfix: 1054 - IPy Runtime crashes making COM call with missing arguments > Bugfix: System.Char.Parse('c') in set(['c']) -- fails > Python 2.5 feature: __MISSING__ on dict > Bugfix: 894 - Cannot implement an interface that defines an event > Bugfix: COM Interop: regression - missing some methods > Bugfix: We seem to be boxing the return value (bool) of 'a' == 'a' every time we call it > Performance fixes for areas where we were 2-10x slower than CPython: > 10x boost to tuple slicing perf by using code on object[] rather than on generic Array and smaller boost to List slicing with same code. > > ~2x boost to builtin and clr method lookup perf with two steps > 1. Using a customized immutable SymbolId based HashTable > 2. Not checking the type of self when we know it's ours > The performance of looking up methods on builtin and clr types is barely noticeable in pystone and parrotbench, but should be noticeable in many real-world apps and other benchmarks. This impacts every method call to either a .NET type or a builtin Python type - which are the same thing in IronPython. > > Also simplified and sped-up Function and OldClass binding rules > Tutorial Update: Output of dir(FileSystemEventArgs) > Tutorial Update: Added TypedCode sample for Tutorial 2 Task 3 > Tutorial Update: Fixed obsolete method calls in code sample of Tutorial 6, Exercise 2, Task 1&3 > Bugfix: 758 - Some invalid input doesn't report error in the console > Bugfix: 776 - datetime.strptime doesn't allow extra non-whitespace characters in format string > Bugfix: 904 - Ctrl-Z improperly expected for EOF on Unix > Bugfix: 936 - RE_Match.start doesn't accept group name > Bugfix: 1015 - Exception stack not filtered/formatted when exception occurs on a different thread > Improved help's display & __doc__ of built-in functions & properties > Bugfix: sys.exit(None) prints None to console. PythonSystemExitException.GetExitCode now returns non-integer values and the caller has to handle it appropriately. > Bugfix: PythonEngine.Evaluate does not work with EngineOptions.ClrDebuggingEnabled. > Added EngineModule.Import to match PythonEngine.Import which only worked with the DefaultModule. > Bugfix: CreateLambda throws NullReferenceException if the expression includes a division operator > Bugfix: Names for generic parameters of CreateLambda and CreateMethod don't follow same pattern as existing FX generic types > Python 2.5 Feature: with Statement > Bugfix: CodePlex 1075 - Type Error is not raised > Bugfix: nt.unlink not deleting file properly > Bugfix: issue in the marshal module (enable test_marshal.cs) > Bugfix: date.strftime does not show good data > Bugfix: COM interop: duplicate entries of __class__ (and __doc__, __init__ etc) in dir(com object) result > Bugfix: Wrong exception when opening read-only file for write. > Implemented cPickle module and made associated changes to the runtime. > Bugfix: 1090 - del sys._getframe > Add APP ID Icon to ipy.exe and ipyw.exe > Bugfix: Deleting a class attribute should raise an error > Bugfix: implement socket.getaddrinfo to ~90% fidelity of CPython > Add AllowPartiallyTrustedCallers attribute to IronPython.dll and IronMath.dll > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- Once in a Redmoon From xmlhacker at gmail.com Wed Jul 26 04:37:25 2006 From: xmlhacker at gmail.com (M. David Peterson) Date: Tue, 25 Jul 2006 20:37:25 -0600 Subject: [IronPython] IronPython 1.0 RC1 is Released In-Reply-To: <7AD436E4270DD54A94238001769C22272F38A14DD8@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <7AD436E4270DD54A94238001769C22272F38A14DD8@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: This is FANTASTIC! I've made a quick announcments/thanks to the O'Reilly Windows DevCenter > http://www.oreillynet.com/windows/blog/2006/07/msironpython_ironpython_10_rc1_1.html< and furthermore plan to get a hold of Preston Gralla (the editor of the Windows DevCenter) to discuss the potential of starting up a column specific to the development needs of the IronPython development community. While I can't promise he'll go for it, with enough community interest/support suggesting this to be something of interest my guess the chances of interest will be greater than if no interest were to be showcased. While I have a couple ideas of how to present this to him, one area that I think would provide a TON of value would be to create an application "spotlight" area where, for example, you could write a tutorial/overview of the application of which I would list a quick summary and then a link to your blog entry. This brings you traffic and exposure, while providing a nice service to the O'Reilly community members to gain access to this content via the same source they're already subscribed to (the O'Reilly weblog feed) Would this be of interest to any of you if I were to move forward with the proposal to Preston? Feel free to respond to this post directly, or follow-up in a private thread, either way is fine by me. Thanks again to each of you involved with bringing this project into reality! On 7/25/06, Dino Viehland wrote: > > Hello IronPython Community, > > We have just released IronPython 1.0 RC1. We're anticipating that this > build will be the same as 1.0 final unless we hear otherwise. We're > looking for any feedback, but in particular we'd like to know of any > blocking issues discovered against this build or fundamental language > incompatibilities. Please try out the latest build over the next 2 weeks > and let us know if you encounter any issues as soon as > possible. Additionally, if there are any 1.01 Alpha bugs on CodePlex that > are blocking you please bring these to our attention so we can take a second > look at them. > > Our goal for IronPython 1.0 is to be compatible with CPython 2.4 We've > fixed all known language incompatibilities and implemented a large number of > the standard CPython built-in modules with a focus on those most used. RC1 > includes one new module that hasn't shipped previous (cPickle). We do have > some issues remaining but we believe these will not affect compatability > with CPython. In addition RC1 has several new 2.5 Python features that > can be enabled with the experimental switch -X:Python25, but by default > these are disabled: > > a. PEP 308: Conditional Expressions > b. PEP 343: The 'with' statement. (as per PEP 343, you need to do > 'from __future__ import with_statement' for enabling 'with' statement ) > c. Other Language Changes > 1. The dict type has a new hook for letting subclasses provide a > default value with '__missing__' method. > 2. Both 8-bit and Unicode strings have new partition(sep) and > rpartition(sep) methods. > 3. The startswith() and endswith() methods of string types now > accept tuples of strings to check for. > 4. The min() and max() built-in functions gained a 'key' keyword > parameter. > 5. Two new built-in functions, any() and all(), evaluate whether > an iterator contains any true or false values. > 6. The list of base classes in a class definition can now be > empty. > > You can download the release from: http://www.CodePlex.com/IronPython > > We'd like to thank everyone in the community for your bug reports and > suggestions that helped make this a better release: audespc, Jonathan > Jacobs, Lee Culver, Luis M. Gonzalez, Miguel de Icaza, Mike Raath, > paparipote, Sanghyeon Seo, and Vincent Wehren. > > Thanks and keep in touch, > The IronPython Team > > More complete list of changes and bug fixes: > ============================================ > Bugfix: 824 - IP Fails to trap AttributeError from __getattr__ > Bugfix: 825 - weakref.proxy needs all special methods > Bugfix: test_descr: two class init issues > Bugfix: test_descr: minor negative cases we're missing (classmethod, > __cmp__, __get__, read-only properties) > Bugfix: test_descr: dict compat issues > Bugfix: test_descr: four minor issues (wrong except on invalid format > string, hex is uppercase, moduletype, Ellipsis) > Bugfix: 872 - NullRef exception in finally w/o yield > ClrModule.Path was deprecated, to be removed in Beta 7, but it's still > there > Also removed sys.LoadAssemblyXXX methods > Tutorial Update: Added some bulletproofing to pyevent.py so that you could > only add callable objects to events, quietly handle removing handlers that > aren't there, and r > emoved some old/unused code. > Tutorial Update: Added comments to winforms to explain what it was doing > and why > Bugfix: 348 RE_Pattern.match matches start-of-string too optimistically > when endpos is specified > Bugfix: 438 os functions raise wrong exception types > Bugfix: 897 Memory leak in ClrModule > Bugfix: 901 SystemError when deriving from a parent class and a > grandparent class with __slots__ > Bugfix: 813 Builtin eval with dict subclass as locals does not work as in > CPython 2.4 > Bugfix: Add filename, lineno, offset and text to SyntaxError Exception > when dealing with pure Python > Bugfix: test_sys: Implement various missing sys functions WAS: Implement > sys.settrace function > Bugfix: cpython supports backslash to concat long string? > Bugfix: clr.LoadAssemblyByName and LoadAssemblyByPartialName publish the > assembly > Bugfix: MethodBinder: choose which explicitly implemetned interface > methods with the same name > Bugfix: implement type.mro()Bugfix: test_isinstance: Assertion triggered > for test case calling isinstance with a class that has no __bases__ > attribute > Tutorial Update: Tweaks to text for winforms and avalon exercises. > Added test cases for COM interop > Bugfix: 1018 - Function call with expanded argument list passes values > incorrectly > Bugfix: AddReference* APIs eat exceptionsBugfix: Some of the > ClrModule.LoadAssemblyXxx methods swallow exceptions from the Assembly > APIs they call, making debugging difficult > Bugfix: 940 - Cannot cast OldClass to DynamicType exception when importing > xml.dom.minidom > Bugfix: 922 - __getitem__ is no longer callable w/ multiple indexesBugfix: > 930 - Performance degradation between beta 8 and 9 doing multi-dimensional > array copies > Bugfix: CodeDom: Ignore empty Indent and always force it to indent > Bugfix: 871 - Overriding __call__ on type exposes Caller ContextBugfix: > 921 - FancyRepr only splits on \n > Bugfix: 895 - cmp() on recursive structures produces uncaught > StackOverflowException and kills interpreter > Bugfix: Strange behavior of MonthCalendar control causes cascading message > boxes in the tutorial on Embedding IronPython > Bugfix: - test_descr: three super() issues, Super had a bunch of issues - > #1) Super.__get__ would return an instance of Super not an > instance of whatever type Super is > #2) Super was passing the wrong values for the descriptor > get, resulting in the property's __get__ doing useful work > #3) If we're not looking up in a subclass of what super is > a super for, then we should search the real type of the insta > nce, skipping the 1st class in the MRO > #4) Super on super - ran into this one while writing the > tests, our repr would stack overflow > #5) Super __new__ / __init__ was wrong - __new__ is a NOP > which yields an empty super, __init__ re-initializes the super > and can be called multiple times > #6) Our IDynamicObject implementation for Super wasn't > reporting the right thing for subclasses > Bugfix: test_descr: issues with __str__ __repr__ and subclasses of str > Tutorial Update: Updated tutorial with a new exercise. > Bugfix: test_descr: four __slots__ issues > Bugfix: 1029 - Can't access __builtins__ when runing method compiled with > PythondEngine.CompileMethod > Bugfix: test_file.py failing on CPython---seems like a bug with our "seek" > implementation > Bugfix: Exception.__str__() exception message differs from the message > given by CPython > Test updates: Improvments to tests to ensure they pass on both IronPython > & CPython > Bugfix: Add ISlice interface to IronMath.dll > Bugfix: If the count argument to re.subn is omitted or 0 then all > occurrences should be replaced > Bugfix: 1054 - IPy Runtime crashes making COM call with missing arguments > Bugfix: System.Char.Parse('c') in set(['c']) -- fails > Python 2.5 feature: __MISSING__ on dict > Bugfix: 894 - Cannot implement an interface that defines an event > Bugfix: COM Interop: regression - missing some methods > Bugfix: We seem to be boxing the return value (bool) of 'a' == 'a' every > time we call it > Performance fixes for areas where we were 2-10x slower than CPython: > 10x boost to tuple slicing perf by using code on object[] rather > than on generic Array and smaller boost to List slicing with same code. > > ~2x boost to builtin and clr method lookup perf with two steps > 1. Using a customized immutable SymbolId based HashTable > 2. Not checking the type of self when we know it's ours > The performance of looking up methods on builtin and clr types is > barely noticeable in pystone and parrotbench, but should be noticeable in > many real-world apps and other benchmarks. This impacts every method call > to either a .NET type or a builtin Python type - which are the same thing in > IronPython. > > Also simplified and sped-up Function and OldClass binding rules > Tutorial Update: Output of dir(FileSystemEventArgs) > Tutorial Update: Added TypedCode sample for Tutorial 2 Task 3 > Tutorial Update: Fixed obsolete method calls in code sample of Tutorial 6, > Exercise 2, Task 1&3 > Bugfix: 758 - Some invalid input doesn't report error in the console > Bugfix: 776 - datetime.strptime doesn't allow extra non-whitespace > characters in format string > Bugfix: 904 - Ctrl-Z improperly expected for EOF on Unix > Bugfix: 936 - RE_Match.start doesn't accept group name > Bugfix: 1015 - Exception stack not filtered/formatted when exception > occurs on a different thread > Improved help's display & __doc__ of built-in functions & properties > Bugfix: sys.exit(None) prints None to console. > PythonSystemExitException.GetExitCode now returns non-integer values and > the caller has to handle it appropriately. > Bugfix: PythonEngine.Evaluate does not work with > EngineOptions.ClrDebuggingEnabled. > Added EngineModule.Import to match PythonEngine.Import which only worked > with the DefaultModule. > Bugfix: CreateLambda throws NullReferenceException if the expression > includes a division operator > Bugfix: Names for generic parameters of CreateLambda and CreateMethod > don't follow same pattern as existing FX generic types > Python 2.5 Feature: with Statement > Bugfix: CodePlex 1075 - Type Error is not raised > Bugfix: nt.unlink not deleting file properly > Bugfix: issue in the marshal module (enable test_marshal.cs) > Bugfix: date.strftime does not show good data > Bugfix: COM interop: duplicate entries of __class__ (and __doc__, __init__ > etc) in dir(com object) result > Bugfix: Wrong exception when opening read-only file for write. > Implemented cPickle module and made associated changes to the runtime. > Bugfix: 1090 - del sys._getframe > Add APP ID Icon to ipy.exe and ipyw.exe > Bugfix: Deleting a class attribute should raise an error > Bugfix: implement socket.getaddrinfo to ~90% fidelity of CPython > Add AllowPartiallyTrustedCallers attribute to IronPython.dll and > IronMath.dll > > _______________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.john.rees at gmail.com Wed Jul 26 04:37:28 2006 From: mark.john.rees at gmail.com (Mark Rees) Date: Wed, 26 Jul 2006 12:37:28 +1000 Subject: [IronPython] IronPython 1.0 RC1 is Released In-Reply-To: <41d7f4a90607251931p56f84a30g8c471d31f7805586@mail.gmail.com> References: <7AD436E4270DD54A94238001769C22272F38A14DD8@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <41d7f4a90607251931p56f84a30g8c471d31f7805586@mail.gmail.com> Message-ID: As an interim solution our friend Seo has an implementation of md5 for IronPython. http://sparcs.kaist.ac.kr/~tinuviel/fepy/lib/ On 7/26/06, Kevin Chu wrote: > I am glade to hear about this greate news! > Especially, it implemented a large number of the standard CPython > built-in modules. > But I found md5 module is not implemented yet! > > 2006/7/26, Dino Viehland : > > Hello IronPython Community, > > > > We have just released IronPython 1.0 RC1. We're anticipating that this build will be the same as 1.0 final unless we hear otherwise. We're looking for any feedback, but in particular we'd like to know of any blocking issues discovered against this build or fundamental language incompatibilities. Please try out the latest build over the next 2 weeks and let us know if you encounter any issues as soon as possible. Additionally, if there are any 1.01 Alpha bugs on CodePlex that are blocking you please bring these to our attention so we can take a second look at them. > > > > Our goal for IronPython 1.0 is to be compatible with CPython 2.4 We've fixed all known language incompatibilities and implemented a large number of the standard CPython built-in modules with a focus on those most used. RC1 includes one new module that hasn't shipped previous (cPickle). We do have some issues remaining but we believe these will not affect compatability with CPython. In addition RC1 has several new 2.5 Python features that can be enabled with the experimental switch -X:Python25, but by default these are disabled: > > > > a. PEP 308: Conditional Expressions > > b. PEP 343: The 'with' statement. (as per PEP 343, you need to do 'from __future__ import with_statement' for enabling 'with' statement ) > > c. Other Language Changes > > 1. The dict type has a new hook for letting subclasses provide a default value with '__missing__' method. > > 2. Both 8-bit and Unicode strings have new partition(sep) and rpartition(sep) methods. > > 3. The startswith() and endswith() methods of string types now accept tuples of strings to check for. > > 4. The min() and max() built-in functions gained a 'key' keyword parameter. > > 5. Two new built-in functions, any() and all(), evaluate whether an iterator contains any true or false values. > > 6. The list of base classes in a class definition can now be empty. > > > > You can download the release from: http://www.CodePlex.com/IronPython > > > > We'd like to thank everyone in the community for your bug reports and suggestions that helped make this a better release: audespc, Jonathan Jacobs, Lee Culver, Luis M. Gonzalez, Miguel de Icaza, Mike Raath, paparipote, Sanghyeon Seo, and Vincent Wehren. > > > > Thanks and keep in touch, > > The IronPython Team > > > > More complete list of changes and bug fixes: > > ============================================ > > Bugfix: 824 - IP Fails to trap AttributeError from __getattr__ > > Bugfix: 825 - weakref.proxy needs all special methods > > Bugfix: test_descr: two class init issues > > Bugfix: test_descr: minor negative cases we're missing (classmethod, __cmp__, __get__, read-only properties) > > Bugfix: test_descr: dict compat issues > > Bugfix: test_descr: four minor issues (wrong except on invalid format string, hex is uppercase, moduletype, Ellipsis) > > Bugfix: 872 - NullRef exception in finally w/o yield > > ClrModule.Path was deprecated, to be removed in Beta 7, but it's still there > > Also removed sys.LoadAssemblyXXX methods > > Tutorial Update: Added some bulletproofing to pyevent.py so that you could only add callable objects to events, quietly handle removing handlers that aren't there, and r > > emoved some old/unused code. > > Tutorial Update: Added comments to winforms to explain what it was doing and why > > Bugfix: 348 RE_Pattern.match matches start-of-string too optimistically when endpos is specified > > Bugfix: 438 os functions raise wrong exception types > > Bugfix: 897 Memory leak in ClrModule > > Bugfix: 901 SystemError when deriving from a parent class and a grandparent class with __slots__ > > Bugfix: 813 Builtin eval with dict subclass as locals does not work as in CPython 2.4 > > Bugfix: Add filename, lineno, offset and text to SyntaxError Exception when dealing with pure Python > > Bugfix: test_sys: Implement various missing sys functions WAS: Implement sys.settrace function > > Bugfix: cpython supports backslash to concat long string? > > Bugfix: clr.LoadAssemblyByName and LoadAssemblyByPartialName publish the assembly > > Bugfix: MethodBinder: choose which explicitly implemetned interface methods with the same name > > Bugfix: implement type.mro()Bugfix: test_isinstance: Assertion triggered for test case calling isinstance with a class that has no __bases__ attribute > > Tutorial Update: Tweaks to text for winforms and avalon exercises. > > Added test cases for COM interop > > Bugfix: 1018 - Function call with expanded argument list passes values incorrectly > > Bugfix: AddReference* APIs eat exceptionsBugfix: Some of the ClrModule.LoadAssemblyXxx methods swallow exceptions from the Assembly APIs they call, making debugging difficult > > Bugfix: 940 - Cannot cast OldClass to DynamicType exception when importing xml.dom.minidom > > Bugfix: 922 - __getitem__ is no longer callable w/ multiple indexesBugfix: 930 - Performance degradation between beta 8 and 9 doing multi-dimensional array copies > > Bugfix: CodeDom: Ignore empty Indent and always force it to indent > > Bugfix: 871 - Overriding __call__ on type exposes Caller ContextBugfix: 921 - FancyRepr only splits on \n > > Bugfix: 895 - cmp() on recursive structures produces uncaught StackOverflowException and kills interpreter > > Bugfix: Strange behavior of MonthCalendar control causes cascading message boxes in the tutorial on Embedding IronPython > > Bugfix: - test_descr: three super() issues, Super had a bunch of issues - > > #1) Super.__get__ would return an instance of Super not an instance of whatever type Super is > > #2) Super was passing the wrong values for the descriptor get, resulting in the property's __get__ doing useful work > > #3) If we're not looking up in a subclass of what super is a super for, then we should search the real type of the insta > > nce, skipping the 1st class in the MRO > > #4) Super on super - ran into this one while writing the tests, our repr would stack overflow > > #5) Super __new__ / __init__ was wrong - __new__ is a NOP which yields an empty super, __init__ re-initializes the super > > and can be called multiple times > > #6) Our IDynamicObject implementation for Super wasn't reporting the right thing for subclasses > > Bugfix: test_descr: issues with __str__ __repr__ and subclasses of str > > Tutorial Update: Updated tutorial with a new exercise. > > Bugfix: test_descr: four __slots__ issues > > Bugfix: 1029 - Can't access __builtins__ when runing method compiled with PythondEngine.CompileMethod > > Bugfix: test_file.py failing on CPython---seems like a bug with our "seek" implementation > > Bugfix: Exception.__str__() exception message differs from the message given by CPython > > Test updates: Improvments to tests to ensure they pass on both IronPython & CPython > > Bugfix: Add ISlice interface to IronMath.dll > > Bugfix: If the count argument to re.subn is omitted or 0 then all occurrences should be replaced > > Bugfix: 1054 - IPy Runtime crashes making COM call with missing arguments > > Bugfix: System.Char.Parse('c') in set(['c']) -- fails > > Python 2.5 feature: __MISSING__ on dict > > Bugfix: 894 - Cannot implement an interface that defines an event > > Bugfix: COM Interop: regression - missing some methods > > Bugfix: We seem to be boxing the return value (bool) of 'a' == 'a' every time we call it > > Performance fixes for areas where we were 2-10x slower than CPython: > > 10x boost to tuple slicing perf by using code on object[] rather than on generic Array and smaller boost to List slicing with same code. > > > > ~2x boost to builtin and clr method lookup perf with two steps > > 1. Using a customized immutable SymbolId based HashTable > > 2. Not checking the type of self when we know it's ours > > The performance of looking up methods on builtin and clr types is barely noticeable in pystone and parrotbench, but should be noticeable in many real-world apps and other benchmarks. This impacts every method call to either a .NET type or a builtin Python type - which are the same thing in IronPython. > > > > Also simplified and sped-up Function and OldClass binding rules > > Tutorial Update: Output of dir(FileSystemEventArgs) > > Tutorial Update: Added TypedCode sample for Tutorial 2 Task 3 > > Tutorial Update: Fixed obsolete method calls in code sample of Tutorial 6, Exercise 2, Task 1&3 > > Bugfix: 758 - Some invalid input doesn't report error in the console > > Bugfix: 776 - datetime.strptime doesn't allow extra non-whitespace characters in format string > > Bugfix: 904 - Ctrl-Z improperly expected for EOF on Unix > > Bugfix: 936 - RE_Match.start doesn't accept group name > > Bugfix: 1015 - Exception stack not filtered/formatted when exception occurs on a different thread > > Improved help's display & __doc__ of built-in functions & properties > > Bugfix: sys.exit(None) prints None to console. PythonSystemExitException.GetExitCode now returns non-integer values and the caller has to handle it appropriately. > > Bugfix: PythonEngine.Evaluate does not work with EngineOptions.ClrDebuggingEnabled. > > Added EngineModule.Import to match PythonEngine.Import which only worked with the DefaultModule. > > Bugfix: CreateLambda throws NullReferenceException if the expression includes a division operator > > Bugfix: Names for generic parameters of CreateLambda and CreateMethod don't follow same pattern as existing FX generic types > > Python 2.5 Feature: with Statement > > Bugfix: CodePlex 1075 - Type Error is not raised > > Bugfix: nt.unlink not deleting file properly > > Bugfix: issue in the marshal module (enable test_marshal.cs) > > Bugfix: date.strftime does not show good data > > Bugfix: COM interop: duplicate entries of __class__ (and __doc__, __init__ etc) in dir(com object) result > > Bugfix: Wrong exception when opening read-only file for write. > > Implemented cPickle module and made associated changes to the runtime. > > Bugfix: 1090 - del sys._getframe > > Add APP ID Icon to ipy.exe and ipyw.exe > > Bugfix: Deleting a class attribute should raise an error > > Bugfix: implement socket.getaddrinfo to ~90% fidelity of CPython > > Add AllowPartiallyTrustedCallers attribute to IronPython.dll and IronMath.dll > > > > _______________________________________________ > > users mailing list > > users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > -- > Once in a Redmoon > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From mark.john.rees at gmail.com Wed Jul 26 04:41:28 2006 From: mark.john.rees at gmail.com (Mark Rees) Date: Wed, 26 Jul 2006 12:41:28 +1000 Subject: [IronPython] speed In-Reply-To: <000801c6b05b$3336cde0$c100a8c0@luis> References: <000801c6b05b$3336cde0$c100a8c0@luis> Message-ID: Yes the speed improvement in RC1 is much appreciated. I am doing an IronPython presentation at the Sydney Python User Group tomorrow evening, and was expecting negative comments about IronPython Console launch time. RC1 has given a 2.5 speedup. Thanks. Mark On 7/26/06, Luis M. Gonzalez wrote: > So I see that Beta 9 was up to 12x slower, while the latest version is only > 3x slower. > Great speedup! > > Congratulations for the great job you and your team are doing (and thank > you!) > > Luis From t-clacul at microsoft.com Wed Jul 26 04:42:01 2006 From: t-clacul at microsoft.com (Lee Culver) Date: Tue, 25 Jul 2006 19:42:01 -0700 Subject: [IronPython] IronPython and Swig In-Reply-To: <7AD436E4270DD54A94238001769C22272F38E1103D@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <529C8DA84B5B364FB86BB4DC8707508B01BEFB26@RED-MSG-80.redmond.corp.microsoft.com> Actually if this is a Python-based swig DLL then it won't work at all. IronPython does not support loading of CPython based modules as of yet. You'd have to ask the team if this is eventually planned. Trying to do so will result in: >>> from pyogre import ogre Traceback (most recent call last): File , line 0, in ##37 File [snip]\IronPython-1.0-Beta9\Lib\pyogre\ogre.py, line 4, in Initialize File , line 0, in __import__##7 ImportError: No module named _ogre Since IronPython can't load .pyd files. If swig was used to generate a C# library (instead of a Python library), then it can be compiled into a DLL assembly and loaded exactly as Dino says below... -Lee -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Tuesday, July 25, 2006 5:43 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython and Swig You'll need to tell us about the DLL first: import clr clr.AddReference('_myDll') import someNamespaceOrTypeFrom_myDll then we'll be able to load types & namespaces from it. ________________________________________ From: users-bounces at lists.ironpython.com On Behalf Of Lyle Thompson Sent: Tuesday, July 25, 2006 5:42 PM To: users at lists.ironpython.com Subject: [IronPython] IronPython and Swig Hi All, I have a C++ DLL that I wrapped with Swig. Inside the python wrapper it imports the DLL, i.e. "import _myDll". In IronPython, I get the error: ImportError: No Module named _myDll. I have made sure that the directory with my DLL is in both my PATH and PYTHONPATH. Does IronPython not support this usage of the import statement? Thanks, Lyle _______________________________________________ users mailing list users at lists.ironpython.com http://lists.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 redmoon17 at gmail.com Wed Jul 26 05:08:00 2006 From: redmoon17 at gmail.com (Kevin Chu) Date: Wed, 26 Jul 2006 11:08:00 +0800 Subject: [IronPython] IronPython 1.0 RC1 is Released In-Reply-To: References: <7AD436E4270DD54A94238001769C22272F38A14DD8@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <41d7f4a90607251931p56f84a30g8c471d31f7805586@mail.gmail.com> Message-ID: <41d7f4a90607252008r71b12ae8k2bbfeaf47148357e@mail.gmail.com> I try this md5.py,but throw an exception! >>> import md5 >>> m=md5.new() Traceback (most recent call last): File , line 0, in ##12 File D:\TECH\IronPython\Lib\md5.py, line 31, in new File D:\TECH\IronPython\Lib\md5.py, line 15, in __init__ TypeError: multiple overloads of Create could match () Create() Create() 2006/7/26, Mark Rees : > As an interim solution our friend Seo has an implementation of md5 for > IronPython. > > http://sparcs.kaist.ac.kr/~tinuviel/fepy/lib/ > > On 7/26/06, Kevin Chu wrote: > > I am glade to hear about this greate news! > > Especially, it implemented a large number of the standard CPython > > built-in modules. > > But I found md5 module is not implemented yet! > > > > 2006/7/26, Dino Viehland : > > > Hello IronPython Community, > > > > > > We have just released IronPython 1.0 RC1. We're anticipating that this build will be the same as 1.0 final unless we hear otherwise. We're looking for any feedback, but in particular we'd like to know of any blocking issues discovered against this build or fundamental language incompatibilities. Please try out the latest build over the next 2 weeks and let us know if you encounter any issues as soon as possible. Additionally, if there are any 1.01 Alpha bugs on CodePlex that are blocking you please bring these to our attention so we can take a second look at them. > > > > > > Our goal for IronPython 1.0 is to be compatible with CPython 2.4 We've fixed all known language incompatibilities and implemented a large number of the standard CPython built-in modules with a focus on those most used. RC1 includes one new module that hasn't shipped previous (cPickle). We do have some issues remaining but we believe these will not affect compatability with CPython. In addition RC1 has several new 2.5 Python features that can be enabled with the experimental switch -X:Python25, but by default these are disabled: > > > > > > a. PEP 308: Conditional Expressions > > > b. PEP 343: The 'with' statement. (as per PEP 343, you need to do 'from __future__ import with_statement' for enabling 'with' statement ) > > > c. Other Language Changes > > > 1. The dict type has a new hook for letting subclasses provide a default value with '__missing__' method. > > > 2. Both 8-bit and Unicode strings have new partition(sep) and rpartition(sep) methods. > > > 3. The startswith() and endswith() methods of string types now accept tuples of strings to check for. > > > 4. The min() and max() built-in functions gained a 'key' keyword parameter. > > > 5. Two new built-in functions, any() and all(), evaluate whether an iterator contains any true or false values. > > > 6. The list of base classes in a class definition can now be empty. > > > > > > You can download the release from: http://www.CodePlex.com/IronPython > > > > > > We'd like to thank everyone in the community for your bug reports and suggestions that helped make this a better release: audespc, Jonathan Jacobs, Lee Culver, Luis M. Gonzalez, Miguel de Icaza, Mike Raath, paparipote, Sanghyeon Seo, and Vincent Wehren. > > > > > > Thanks and keep in touch, > > > The IronPython Team > > > > > > More complete list of changes and bug fixes: > > > ============================================ > > > Bugfix: 824 - IP Fails to trap AttributeError from __getattr__ > > > Bugfix: 825 - weakref.proxy needs all special methods > > > Bugfix: test_descr: two class init issues > > > Bugfix: test_descr: minor negative cases we're missing (classmethod, __cmp__, __get__, read-only properties) > > > Bugfix: test_descr: dict compat issues > > > Bugfix: test_descr: four minor issues (wrong except on invalid format string, hex is uppercase, moduletype, Ellipsis) > > > Bugfix: 872 - NullRef exception in finally w/o yield > > > ClrModule.Path was deprecated, to be removed in Beta 7, but it's still there > > > Also removed sys.LoadAssemblyXXX methods > > > Tutorial Update: Added some bulletproofing to pyevent.py so that you could only add callable objects to events, quietly handle removing handlers that aren't there, and r > > > emoved some old/unused code. > > > Tutorial Update: Added comments to winforms to explain what it was doing and why > > > Bugfix: 348 RE_Pattern.match matches start-of-string too optimistically when endpos is specified > > > Bugfix: 438 os functions raise wrong exception types > > > Bugfix: 897 Memory leak in ClrModule > > > Bugfix: 901 SystemError when deriving from a parent class and a grandparent class with __slots__ > > > Bugfix: 813 Builtin eval with dict subclass as locals does not work as in CPython 2.4 > > > Bugfix: Add filename, lineno, offset and text to SyntaxError Exception when dealing with pure Python > > > Bugfix: test_sys: Implement various missing sys functions WAS: Implement sys.settrace function > > > Bugfix: cpython supports backslash to concat long string? > > > Bugfix: clr.LoadAssemblyByName and LoadAssemblyByPartialName publish the assembly > > > Bugfix: MethodBinder: choose which explicitly implemetned interface methods with the same name > > > Bugfix: implement type.mro()Bugfix: test_isinstance: Assertion triggered for test case calling isinstance with a class that has no __bases__ attribute > > > Tutorial Update: Tweaks to text for winforms and avalon exercises. > > > Added test cases for COM interop > > > Bugfix: 1018 - Function call with expanded argument list passes values incorrectly > > > Bugfix: AddReference* APIs eat exceptionsBugfix: Some of the ClrModule.LoadAssemblyXxx methods swallow exceptions from the Assembly APIs they call, making debugging difficult > > > Bugfix: 940 - Cannot cast OldClass to DynamicType exception when importing xml.dom.minidom > > > Bugfix: 922 - __getitem__ is no longer callable w/ multiple indexesBugfix: 930 - Performance degradation between beta 8 and 9 doing multi-dimensional array copies > > > Bugfix: CodeDom: Ignore empty Indent and always force it to indent > > > Bugfix: 871 - Overriding __call__ on type exposes Caller ContextBugfix: 921 - FancyRepr only splits on \n > > > Bugfix: 895 - cmp() on recursive structures produces uncaught StackOverflowException and kills interpreter > > > Bugfix: Strange behavior of MonthCalendar control causes cascading message boxes in the tutorial on Embedding IronPython > > > Bugfix: - test_descr: three super() issues, Super had a bunch of issues - > > > #1) Super.__get__ would return an instance of Super not an instance of whatever type Super is > > > #2) Super was passing the wrong values for the descriptor get, resulting in the property's __get__ doing useful work > > > #3) If we're not looking up in a subclass of what super is a super for, then we should search the real type of the insta > > > nce, skipping the 1st class in the MRO > > > #4) Super on super - ran into this one while writing the tests, our repr would stack overflow > > > #5) Super __new__ / __init__ was wrong - __new__ is a NOP which yields an empty super, __init__ re-initializes the super > > > and can be called multiple times > > > #6) Our IDynamicObject implementation for Super wasn't reporting the right thing for subclasses > > > Bugfix: test_descr: issues with __str__ __repr__ and subclasses of str > > > Tutorial Update: Updated tutorial with a new exercise. > > > Bugfix: test_descr: four __slots__ issues > > > Bugfix: 1029 - Can't access __builtins__ when runing method compiled with PythondEngine.CompileMethod > > > Bugfix: test_file.py failing on CPython---seems like a bug with our "seek" implementation > > > Bugfix: Exception.__str__() exception message differs from the message given by CPython > > > Test updates: Improvments to tests to ensure they pass on both IronPython & CPython > > > Bugfix: Add ISlice interface to IronMath.dll > > > Bugfix: If the count argument to re.subn is omitted or 0 then all occurrences should be replaced > > > Bugfix: 1054 - IPy Runtime crashes making COM call with missing arguments > > > Bugfix: System.Char.Parse('c') in set(['c']) -- fails > > > Python 2.5 feature: __MISSING__ on dict > > > Bugfix: 894 - Cannot implement an interface that defines an event > > > Bugfix: COM Interop: regression - missing some methods > > > Bugfix: We seem to be boxing the return value (bool) of 'a' == 'a' every time we call it > > > Performance fixes for areas where we were 2-10x slower than CPython: > > > 10x boost to tuple slicing perf by using code on object[] rather than on generic Array and smaller boost to List slicing with same code. > > > > > > ~2x boost to builtin and clr method lookup perf with two steps > > > 1. Using a customized immutable SymbolId based HashTable > > > 2. Not checking the type of self when we know it's ours > > > The performance of looking up methods on builtin and clr types is barely noticeable in pystone and parrotbench, but should be noticeable in many real-world apps and other benchmarks. This impacts every method call to either a .NET type or a builtin Python type - which are the same thing in IronPython. > > > > > > Also simplified and sped-up Function and OldClass binding rules > > > Tutorial Update: Output of dir(FileSystemEventArgs) > > > Tutorial Update: Added TypedCode sample for Tutorial 2 Task 3 > > > Tutorial Update: Fixed obsolete method calls in code sample of Tutorial 6, Exercise 2, Task 1&3 > > > Bugfix: 758 - Some invalid input doesn't report error in the console > > > Bugfix: 776 - datetime.strptime doesn't allow extra non-whitespace characters in format string > > > Bugfix: 904 - Ctrl-Z improperly expected for EOF on Unix > > > Bugfix: 936 - RE_Match.start doesn't accept group name > > > Bugfix: 1015 - Exception stack not filtered/formatted when exception occurs on a different thread > > > Improved help's display & __doc__ of built-in functions & properties > > > Bugfix: sys.exit(None) prints None to console. PythonSystemExitException.GetExitCode now returns non-integer values and the caller has to handle it appropriately. > > > Bugfix: PythonEngine.Evaluate does not work with EngineOptions.ClrDebuggingEnabled. > > > Added EngineModule.Import to match PythonEngine.Import which only worked with the DefaultModule. > > > Bugfix: CreateLambda throws NullReferenceException if the expression includes a division operator > > > Bugfix: Names for generic parameters of CreateLambda and CreateMethod don't follow same pattern as existing FX generic types > > > Python 2.5 Feature: with Statement > > > Bugfix: CodePlex 1075 - Type Error is not raised > > > Bugfix: nt.unlink not deleting file properly > > > Bugfix: issue in the marshal module (enable test_marshal.cs) > > > Bugfix: date.strftime does not show good data > > > Bugfix: COM interop: duplicate entries of __class__ (and __doc__, __init__ etc) in dir(com object) result > > > Bugfix: Wrong exception when opening read-only file for write. > > > Implemented cPickle module and made associated changes to the runtime. > > > Bugfix: 1090 - del sys._getframe > > > Add APP ID Icon to ipy.exe and ipyw.exe > > > Bugfix: Deleting a class attribute should raise an error > > > Bugfix: implement socket.getaddrinfo to ~90% fidelity of CPython > > > Add AllowPartiallyTrustedCallers attribute to IronPython.dll and IronMath.dll > > > > > > _______________________________________________ > > > users mailing list > > > users at lists.ironpython.com > > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > > > > > -- > > Once in a Redmoon > > _______________________________________________ > > users mailing list > > users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- Once in a Redmoon From mark.john.rees at gmail.com Wed Jul 26 05:14:20 2006 From: mark.john.rees at gmail.com (Mark Rees) Date: Wed, 26 Jul 2006 13:14:20 +1000 Subject: [IronPython] md5.py throws exception Message-ID: On 7/26/06, Kevin Chu wrote: > I try this md5.py,but throw an exception! > > >>> import md5 > >>> m=md5.new() > Traceback (most recent call last): > File , line 0, in ##12 > File D:\TECH\IronPython\Lib\md5.py, line 31, in new > File D:\TECH\IronPython\Lib\md5.py, line 15, in __init__ > TypeError: multiple overloads of Create could match () > Create() > Create() It worked in previous betas, but hadn't tested against RC1 yet. Let me have a look and see if I can fix. Mark From Martin.Maly at microsoft.com Wed Jul 26 05:55:54 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Tue, 25 Jul 2006 20:55:54 -0700 Subject: [IronPython] md5.py throws exception In-Reply-To: Message-ID: This appears to be a bug in IronPython. I tried with Beta 8 and 9 and they both worked, RC fails. I've filed the bug on CodePlex. It is a good one to look at for the final release. Thanks for the report! Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Mark Rees Sent: Tuesday, July 25, 2006 8:14 PM To: Discussion of IronPython Subject: [IronPython] md5.py throws exception On 7/26/06, Kevin Chu wrote: > I try this md5.py,but throw an exception! > > >>> import md5 > >>> m=md5.new() > Traceback (most recent call last): > File , line 0, in ##12 > File D:\TECH\IronPython\Lib\md5.py, line 31, in new > File D:\TECH\IronPython\Lib\md5.py, line 15, in __init__ > TypeError: multiple overloads of Create could match () > Create() > Create() It worked in previous betas, but hadn't tested against RC1 yet. Let me have a look and see if I can fix. Mark _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From mark.john.rees at gmail.com Wed Jul 26 05:57:16 2006 From: mark.john.rees at gmail.com (Mark Rees) Date: Wed, 26 Jul 2006 13:57:16 +1000 Subject: [IronPython] TypeError: multiple overloads of Create could match() Message-ID: On 7/26/06 in another thread, Kevin Chu wrote: > I try this md5.py,but throw an exception! > > >>> import md5 > >>> m=md5.new() > Traceback (most recent call last): > File , line 0, in ##12 > File D:\TECH\IronPython\Lib\md5.py, line 31, in new > File D:\TECH\IronPython\Lib\md5.py, line 15, in __init__ > TypeError: multiple overloads of Create could match () > Create() > Create() The MD5 class has 2 overloads for the Create method Create() Create(str) In Beta 9: m = MD5.Create() worked but in RC1 it gives the error Kevin reported. I get a similar error if I do: m = MD5.Create("MD5") Is this a bug? Regards Mark From mark.john.rees at gmail.com Wed Jul 26 05:59:36 2006 From: mark.john.rees at gmail.com (Mark Rees) Date: Wed, 26 Jul 2006 13:59:36 +1000 Subject: [IronPython] md5.py throws exception In-Reply-To: References: Message-ID: Thanks. Ignore my other post reporting the same thing, mailing list seems a little slow at distributing things at the moment. On 7/26/06, Martin Maly wrote: > This appears to be a bug in IronPython. I tried with Beta 8 and 9 and they both worked, RC fails. I've filed the bug on CodePlex. It is a good one to look at for the final release. > > Thanks for the report! > > Martin > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Mark Rees > Sent: Tuesday, July 25, 2006 8:14 PM > To: Discussion of IronPython > Subject: [IronPython] md5.py throws exception > > On 7/26/06, Kevin Chu wrote: > > I try this md5.py,but throw an exception! > > > > >>> import md5 > > >>> m=md5.new() > > Traceback (most recent call last): > > File , line 0, in ##12 > > File D:\TECH\IronPython\Lib\md5.py, line 31, in new > > File D:\TECH\IronPython\Lib\md5.py, line 15, in __init__ > > TypeError: multiple overloads of Create could match () > > Create() > > Create() > > It worked in previous betas, but hadn't tested against RC1 yet. Let me > have a look and see if I can fix. > > 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 textdirected at gmail.com Wed Jul 26 06:55:01 2006 From: textdirected at gmail.com (HEMMI, Shigeru) Date: Wed, 26 Jul 2006 13:55:01 +0900 Subject: [IronPython] ImportError: No module named parser In-Reply-To: <7AD436E4270DD54A94238001769C22272CDFD25F57@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <7AD436E4270DD54A94238001769C22272CDFD25F57@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: Thanks for the response, Dino. FYI, what I wanted to use is miniconf 1.0.1 written by Sylvain Fourmanoit: http://cheeseshop.python.org/pypi/miniconf/1.0.1 Regards, 2006/7/26, Dino Viehland : > Well, it's only a problem if you need the parser module :) I've opened CodePlex work item 1347 for this - http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkItemId=1347 - it'll have to wait until after 1.0 at this point though because we're too close to the 1.0 release. We've also had a similar request for better quality checking tools support which rely on the parser module so this is starting to look more compelling. Thanks for reporting this. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of HEMMI, Shigeru > Sent: Tuesday, July 25, 2006 12:19 AM > To: Discussion of IronPython > Subject: [IronPython] ImportError: No module named parser > > In IP, parser - an interface to Python's internal parser, is not implemented. > Is it a problem or not? > > IronPython 1.0.60712 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. > >>> import parser > Traceback (most recent call last): > File , line 0, in ##3 > File , line 0, in __import__##7 > ImportError: No module named parser > >>> > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.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 lcm at spiralcomms.com Wed Jul 26 08:27:39 2006 From: lcm at spiralcomms.com (Cheemeng) Date: Wed, 26 Jul 2006 14:27:39 +0800 Subject: [IronPython] 'DataGridView' object has no attribute 'BeginInit' Message-ID: <44C70B5B.7000603@spiralcomms.com> hi IP team, the DataGridView object has no attribute BeginInit this is previously fix in 1.0 beta4 I think. cheemeng From Martin.Maly at microsoft.com Wed Jul 26 08:47:45 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Tue, 25 Jul 2006 23:47:45 -0700 Subject: [IronPython] 'DataGridView' object has no attribute 'BeginInit' In-Reply-To: <44C70B5B.7000603@spiralcomms.com> Message-ID: BeginInit is an explicitly implemented interface (ISupportInitialize) method on the DataGridView class. To call it, you need to use the explicit syntax: grid = DataGridView( ... ) ISupportInitialize.BeginInit(grid) In this case we wanted to preserve the nature of explicitly implemented interface methods and allow them to be called in this manner only. Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Cheemeng Sent: Tuesday, July 25, 2006 11:28 PM To: users at lists.ironpython.com Subject: [IronPython] 'DataGridView' object has no attribute 'BeginInit' hi IP team, the DataGridView object has no attribute BeginInit this is previously fix in 1.0 beta4 I think. cheemeng _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From raathm at gmail.com Wed Jul 26 09:52:46 2006 From: raathm at gmail.com (Mike Raath) Date: Wed, 26 Jul 2006 09:52:46 +0200 Subject: [IronPython] Bug in urllib? Message-ID: <664260580607260052u59bdee70x15d378ade8c12c3c@mail.gmail.com> I'm getting an error trying to use urllib - AttributeError: 'socket' object has no attribute 'makefile' Using 1.0 RC1. Not sure if this has ever worked - get NotImplementedError: getaddrinfo() is not currently implemented in the Beta 9. >>> import sys >>> sys.path.append("C:\\Python24\\Lib") >>> import urllib >>> f = urllib.urlopen("http://www.microsoft.com") Traceback (most recent call last): File , line 0, in ##151 File C:\Python24\Lib\urllib.py, line 82, in urlopen File C:\Python24\Lib\urllib.py, line 194, in open File C:\Python24\Lib\urllib.py, line 316, in open_http File C:\Python24\Lib\httplib.py, line 1150, in getreply File C:\Python24\Lib\httplib.py, line 863, in getresponse File C:\Python24\Lib\httplib.py, line 275, in __init__ AttributeError: 'socket' object has no attribute 'makefile' Same on CPython 2.4 gives: >>> import sys >>> sys.path.append("C:\\Python24\\Lib") >>> import urllib >>> f = urllib.urlopen("http://www.microsoft.com") >>> print f.read() (etc.....) -------------- next part -------------- An HTML attachment was scrubbed... URL: From korpse-ironpython at kaydash.za.net Wed Jul 26 10:44:03 2006 From: korpse-ironpython at kaydash.za.net (Jonathan Jacobs) Date: Wed, 26 Jul 2006 10:44:03 +0200 Subject: [IronPython] __future__ is a little too magic for its own good Message-ID: <44C72B53.9050808@kaydash.za.net> IronPython 1.0.60725 on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> with Traceback (most recent call last): File , line 0, in ##3 NameError: name 'with' not defined >>> from __future__ import with_statement Traceback (most recent call last): File , line 0, in ##4 File , line 0, in __import__##8 ImportError: No module named __future__ >>> with Traceback (most recent call last): SyntaxError: unexpected token (, line 1) This appears to happen with every other __future__ import I tried. P.S. Icons! Wheeeeee!!! -- Jonathan From korpse-ironpython at kaydash.za.net Wed Jul 26 10:45:34 2006 From: korpse-ironpython at kaydash.za.net (Jonathan Jacobs) Date: Wed, 26 Jul 2006 10:45:34 +0200 Subject: [IronPython] __future__ is a little too magic for its own good In-Reply-To: <44C72B53.9050808@kaydash.za.net> References: <44C72B53.9050808@kaydash.za.net> Message-ID: <44C72BAE.1040702@kaydash.za.net> Jonathan Jacobs wrote: > This appears to happen with every other __future__ import I tried. Actually, I suppose this is because I don't have the Python stdlib in my path. So ignore that. :) > P.S. Icons! Wheeeeee!!! This still applies. -- Jonathan From korpse-ironpython at kaydash.za.net Wed Jul 26 10:45:34 2006 From: korpse-ironpython at kaydash.za.net (Jonathan Jacobs) Date: Wed, 26 Jul 2006 10:45:34 +0200 Subject: [IronPython] __future__ is a little too magic for its own good In-Reply-To: <44C72B53.9050808@kaydash.za.net> References: <44C72B53.9050808@kaydash.za.net> Message-ID: <44C72BAE.1040702@kaydash.za.net> Jonathan Jacobs wrote: > This appears to happen with every other __future__ import I tried. Actually, I suppose this is because I don't have the Python stdlib in my path. So ignore that. :) > P.S. Icons! Wheeeeee!!! This still applies. -- Jonathan From max.bolingbroke at resolversystems.com Wed Jul 26 12:30:48 2006 From: max.bolingbroke at resolversystems.com (Max Bolingbroke) Date: Wed, 26 Jul 2006 11:30:48 +0100 Subject: [IronPython] ActiveX Winfowms and IronPython In-Reply-To: References: Message-ID: <44C74458.9090102@resolversystems.com> ?????? ?????????? wrote: > Is there any way to add any ActiveX controls to WinForm in IronPython > code? Hi, The procedure should be similar to that used in C#. There are details about that here: http://www.codeproject.com/csharp/importactivex.asp. Basically, all you need to do is generate a managed wrapper for the ActiveX component using one of the tools in the .NET SDK: AxImp /source activex_control_path_name Once you have this wrapper, you import it into IronPython in the usual way (clr.AddReference), and can create instances of the control (you can browse the assembly that has been generated to find the control class using dir() in IronPython or the SDK tool ildasm) and add it to your windows form with ease. Please note, however, that this is all theory: I haven't actually tried doing this, but I can't see any obstacles to this working. That said, there may very will be some issues here, so I'd be interested to hear how you get on! Hope this helps, Max From jvm_cop at spamcop.net Wed Jul 26 16:24:24 2006 From: jvm_cop at spamcop.net (J. Merrill) Date: Wed, 26 Jul 2006 10:24:24 -0400 Subject: [IronPython] profiling ipy apps In-Reply-To: <44C6B12D.5050007@twinsun.com> References: <44C6B12D.5050007@twinsun.com> Message-ID: <7.0.1.0.2.20060726101929.06df6dd8@wheresmymailserver.com> You could use a third-party product like Red-Gate software's "ANTS Profiler" -- http://red-gate.com/products/ants_profiler/index.htm There's a 14-day trial, and it's a lot cheaper than Team Suite (one copy is $295, 10 copies are <$160 per user). Buying hint: at the end of each month, the sales folks would like to get the sale into this month's activity and could likely be convinced to give you the "one year maintenance and support" for free (normally $74). At 08:02 PM 7/25/2006, Arman Bostani wrote >Hello all, > >Is there a recommended process for profiling ipy applications? >Understandably, the cpython profile module doesn't work (no >sys.setprofile). Also, CLR Profiler isn't geared towards performance >analysis. So, do I need to somehow run my ipy applications under VS >2005 Team Suite? > >Thanks, >-arman J. Merrill / Analytical Software Corp From slide.o.mix at gmail.com Wed Jul 26 16:31:40 2006 From: slide.o.mix at gmail.com (Slide) Date: Wed, 26 Jul 2006 07:31:40 -0700 Subject: [IronPython] Hosting question Message-ID: I have been playing around with embedding IronPython into an application to provide scripting support for my .NET application. One thing that I have noticed is that to get the output from the interpreter you have to use EvalToConsole. So to capture the input, I have to use SetStandardOut to some memory stream, etc, etc. I played with Boo prior to IronPython and they had a cool feature of the interactive interpreter where there was an event for when the interpreter printed something to its standard output, so to get the output it was as easy as adding an event handler to that event. Is there anything in the works like this, or should I just continue piping the output to a memory stream and go from there? Thanks From kristof.wagemans at gmail.com Wed Jul 26 18:07:32 2006 From: kristof.wagemans at gmail.com (Kristof Wagemans) Date: Wed, 26 Jul 2006 18:07:32 +0200 Subject: [IronPython] PythonEngine.EvaluateAs and future division Message-ID: <000001c6b0cd$9b284650$0f01a8c0@notebook> The following code gives different results. Is this expected or a bug? IronPython.Compiler.Options.Division = IronPython.Compiler.DivisionOption.New; PythonEngine _pe = new PythonEngine(); _pe.Execute("result1 = 1/2"); double result1 = Convert.ToDouble(_pe.Globals["result1"]); double result2 = _pe.EvaluateAs("1/2"); result1 = 0.5 result2 = 0.0 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jvm_cop at spamcop.net Wed Jul 26 19:20:23 2006 From: jvm_cop at spamcop.net (J. Merrill) Date: Wed, 26 Jul 2006 13:20:23 -0400 Subject: [IronPython] When does data binding occur? In-Reply-To: <51c8a7be0607251025o1f392152o5ffcb18e5dc96714@mail.gmail.co m> References: <51c8a7be0607251025o1f392152o5ffcb18e5dc96714@mail.gmail.com> Message-ID: <7.0.1.0.2.20060726132005.06d80b30@wheresmymailserver.com> Do you call DataBind ? At 01:25 PM 7/25/2006, jeff sacksteder wrote >In my __init__ method, I create a DataGridview and set it's datasource to a BindingSource previously created. If the very last line of my __init__ gets the 'Rows' property of the DGV, it is an empty collection. I can get other attributes( like 'Name') without any problem. If I get 'Rows' from outside the __init__ method, I see what I expect. > >Is the binding delayed until the method returns? Is there anyway to force the Rows to be populated so that that can be examined/manipulated before returning? J. Merrill / Analytical Software Corp From riltim at gmail.com Wed Jul 26 19:17:14 2006 From: riltim at gmail.com (Tim Riley) Date: Wed, 26 Jul 2006 13:17:14 -0400 Subject: [IronPython] NET Attributes. Message-ID: Is it possible to use .NET attributes in IronPython? For example I have C# code that looks like: [CommandMethod("MyCommand", CommandFlags.Modal)] public static void RunMyCommand() { 'code here } Can I do something similiar in IP? I'll take anything. -------------- next part -------------- An HTML attachment was scrubbed... URL: From t-bruch at microsoft.com Wed Jul 26 19:04:37 2006 From: t-bruch at microsoft.com (Bruce Christensen) Date: Wed, 26 Jul 2006 10:04:37 -0700 Subject: [IronPython] Bug in urllib? In-Reply-To: <664260580607260052u59bdee70x15d378ade8c12c3c@mail.gmail.com> References: <664260580607260052u59bdee70x15d378ade8c12c3c@mail.gmail.com> Message-ID: <3581AA168D87A2479D88EA319BDF7D32FF785A@RED-MSG-80.redmond.corp.microsoft.com> This is a bug. It has never worked-although it would be great if it did. As noted in socket.__doc__, socket.makefile() (which urllib.urlopen() depends on) is not implemented. We're aware of the problem, and I've filed a bug at http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkIt emId=1368 to track it. Here's the long technical explanation why makefile() is missing: CPython actually implements the socket module in two parts: _socket.pyd (the main implementation written in C) and socket.py (a thin wrapper written in Python). We originally planned to implement only the _socket module (in C#) and have people use it with the standard socket.py module. However, we discovered that socket.py depends on CPython's refcounting garbage collector work correctly, and so we had to modify our socket module to work without socket.py. Unfortunately, makefile() is one of the things that socket.py provides, and we haven't had time yet to implement it. --Bruce From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Mike Raath Sent: Wednesday, July 26, 2006 12:53 AM To: Discussion of IronPython Subject: [IronPython] Bug in urllib? I'm getting an error trying to use urllib - AttributeError: 'socket' object has no attribute 'makefile' Using 1.0 RC1. Not sure if this has ever worked - get NotImplementedError: getaddrinfo() is not currently implemented in the Beta 9. >>> import sys >>> sys.path.append("C:\\Python24\\Lib") >>> import urllib >>> f = urllib.urlopen("http://www.microsoft.com ") Traceback (most recent call last): File , line 0, in ##151 File C:\Python24\Lib\urllib.py, line 82, in urlopen File C:\Python24\Lib\urllib.py, line 194, in open File C:\Python24\Lib\urllib.py, line 316, in open_http File C:\Python24\Lib\httplib.py, line 1150, in getreply File C:\Python24\Lib\httplib.py, line 863, in getresponse File C:\Python24\Lib\httplib.py, line 275, in __init__ AttributeError: 'socket' object has no attribute 'makefile' Same on CPython 2.4 gives: >>> import sys >>> sys.path.append("C:\\Python24\\Lib") >>> import urllib >>> f = urllib.urlopen(" http://www.microsoft.com ") >>> print f.read() (etc.....) -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Maly at microsoft.com Wed Jul 26 19:58:21 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Wed, 26 Jul 2006 10:58:21 -0700 Subject: [IronPython] NET Attributes. In-Reply-To: Message-ID: Unfortunately, no. Adding .NET attributes on Python classes in IronPython is not possible. Somewhat similar Pythonic thing is function and method decorators: @command("MyCommand", CommandFlags.Modal) def RunMyCommand(): .... However, this will not interoperate well with .NET since .NET is not aware of the decorator mechanism. For more information, you can check out: http://docs.python.org/whatsnew/node6.html There is another option to use function doc strings, but that would be more complicated to use and I'd probably use it as one of the last resorts. Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Tim Riley Sent: Wednesday, July 26, 2006 10:17 AM To: Discussion of IronPython Subject: [IronPython] NET Attributes. Is it possible to use .NET attributes in IronPython? For example I have C# code that looks like: [CommandMethod("MyCommand", CommandFlags.Modal)] public static void RunMyCommand() { 'code here } Can I do something similiar in IP? I'll take anything. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jsacksteder at gmail.com Wed Jul 26 20:10:09 2006 From: jsacksteder at gmail.com (jeff sacksteder) Date: Wed, 26 Jul 2006 14:10:09 -0400 Subject: [IronPython] When does data binding occur? In-Reply-To: <7.0.1.0.2.20060726132005.06d80b30@wheresmymailserver.com> References: <51c8a7be0607251025o1f392152o5ffcb18e5dc96714@mail.gmail.com> <7.0.1.0.2.20060726132005.06d80b30@wheresmymailserver.com> Message-ID: <51c8a7be0607261110m49d7e837l9856ac5327e08840@mail.gmail.com> > > Do you call DataBind ? No, Call it on what? The Datagridview? -------------- next part -------------- An HTML attachment was scrubbed... URL: From t-milich at microsoft.com Wed Jul 26 20:19:26 2006 From: t-milich at microsoft.com (Milind Chabbi) Date: Wed, 26 Jul 2006 11:19:26 -0700 Subject: [IronPython] __future__ is a little too magic for its own good In-Reply-To: <44C72B53.9050808@kaydash.za.net> Message-ID: <23DBEB0E12CBAB4582C50AB3F3DF2C960B0D1B43@RED-MSG-42.redmond.corp.microsoft.com> Hi Jonathan, You may be getting this error because you do not have __future__.py in the path. See the following examples: 1. When you do not have __future__.py C:\ip2\IronPython\Public\Src\Test>ip IronPython 1.0.2396 on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> from __future__ import division Traceback (most recent call last): File , line 0, in ##1 File , line 0, in __import__##5 ImportError: No module named __future__ 2. create a file __future__.py with content below( or use the attached one): division=1 with_statement=1 now, invoke ironpython C:\ip2\IronPython\Public\Src\Tests>ip IronPython 1.0.2396 on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> from __future__ import division >>> #you still can not import with_statement since it is Python25 feature >>> from __future__ import with_statement Traceback (most recent call last): SyntaxError: future feature is not defined: with_statement (, line 1) You still get error for with_statement because, it is enabled only with -X:Python25 switch. 3. Now invoke ironpython with -X:Python25 and you can import with_statement also. C:\ip2\IronPython\Public\Src\Tests>ip -X:Python25 IronPython 1.0.2396 on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> from __future__ import with_statement >>> Hope this helps. Thanks -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jonathan Jacobs Sent: Wednesday, July 26, 2006 1:44 AM To: IronPython List Subject: [IronPython] __future__ is a little too magic for its own good IronPython 1.0.60725 on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> with Traceback (most recent call last): File , line 0, in ##3 NameError: name 'with' not defined >>> from __future__ import with_statement Traceback (most recent call last): File , line 0, in ##4 File , line 0, in __import__##8 ImportError: No module named __future__ >>> with Traceback (most recent call last): SyntaxError: unexpected token (, line 1) This appears to happen with every other __future__ import I tried. P.S. Icons! Wheeeeee!!! -- Jonathan _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -------------- next part -------------- A non-text attachment was scrubbed... Name: __future__.py Type: application/octet-stream Size: 28 bytes Desc: __future__.py URL: From t-milich at microsoft.com Wed Jul 26 20:19:26 2006 From: t-milich at microsoft.com (Milind Chabbi) Date: Wed, 26 Jul 2006 11:19:26 -0700 Subject: [IronPython] __future__ is a little too magic for its own good In-Reply-To: <44C72B53.9050808@kaydash.za.net> Message-ID: <23DBEB0E12CBAB4582C50AB3F3DF2C960B0D1B43@RED-MSG-42.redmond.corp.microsoft.com> Hi Jonathan, You may be getting this error because you do not have __future__.py in the path. See the following examples: 1. When you do not have __future__.py C:\ip2\IronPython\Public\Src\Test>ip IronPython 1.0.2396 on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> from __future__ import division Traceback (most recent call last): File , line 0, in ##1 File , line 0, in __import__##5 ImportError: No module named __future__ 2. create a file __future__.py with content below( or use the attached one): division=1 with_statement=1 now, invoke ironpython C:\ip2\IronPython\Public\Src\Tests>ip IronPython 1.0.2396 on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> from __future__ import division >>> #you still can not import with_statement since it is Python25 feature >>> from __future__ import with_statement Traceback (most recent call last): SyntaxError: future feature is not defined: with_statement (, line 1) You still get error for with_statement because, it is enabled only with -X:Python25 switch. 3. Now invoke ironpython with -X:Python25 and you can import with_statement also. C:\ip2\IronPython\Public\Src\Tests>ip -X:Python25 IronPython 1.0.2396 on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> from __future__ import with_statement >>> Hope this helps. Thanks -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jonathan Jacobs Sent: Wednesday, July 26, 2006 1:44 AM To: IronPython List Subject: [IronPython] __future__ is a little too magic for its own good IronPython 1.0.60725 on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> with Traceback (most recent call last): File , line 0, in ##3 NameError: name 'with' not defined >>> from __future__ import with_statement Traceback (most recent call last): File , line 0, in ##4 File , line 0, in __import__##8 ImportError: No module named __future__ >>> with Traceback (most recent call last): SyntaxError: unexpected token (, line 1) This appears to happen with every other __future__ import I tried. P.S. Icons! Wheeeeee!!! -- Jonathan _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -------------- next part -------------- A non-text attachment was scrubbed... Name: __future__.py Type: application/octet-stream Size: 28 bytes Desc: __future__.py URL: From raathm at gmail.com Wed Jul 26 21:43:15 2006 From: raathm at gmail.com (Mike Raath) Date: Wed, 26 Jul 2006 21:43:15 +0200 Subject: [IronPython] Bug in urllib? In-Reply-To: <3581AA168D87A2479D88EA319BDF7D32FF785A@RED-MSG-80.redmond.corp.microsoft.com> References: <664260580607260052u59bdee70x15d378ade8c12c3c@mail.gmail.com> <3581AA168D87A2479D88EA319BDF7D32FF785A@RED-MSG-80.redmond.corp.microsoft.com> Message-ID: <664260580607261243u20375982ic3e865f14cff46c2@mail.gmail.com> Thanks Bruce - it's not a huge prob for me right now - I was just trying to come up with a benchmark script for you guys to use to test BeautifulSoup performance. Will look at doing it with text files rather than urls tomorrow. On 7/26/06, Bruce Christensen wrote: > > This is a bug. It has never worked?although it would be great if it did. > As noted in socket.__doc__, socket.makefile() (which urllib.urlopen() > depends on) is not implemented. We're aware of the problem, and I've filed a > bug at > http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkItemId=1368to track it. > > > > Here's the long technical explanation why makefile() is missing: CPython > actually implements the socket module in two parts: _socket.pyd (the main > implementation written in C) and socket.py (a thin wrapper written in > Python). We originally planned to implement only the _socket module (in C#) > and have people use it with the standard socket.py module. However, we > discovered that socket.py depends on CPython's refcounting garbage > collector work correctly, and so we had to modify our socket module to work > without socket.py. Unfortunately, makefile() is one of the things that > socket.py provides, and we haven't had time yet to implement it. > > > > --Bruce > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Mike Raath > *Sent:* Wednesday, July 26, 2006 12:53 AM > *To:* Discussion of IronPython > *Subject:* [IronPython] Bug in urllib? > > > > I'm getting an error trying to use urllib - AttributeError: 'socket' > object has no attribute 'makefile' Using 1.0 RC1. Not sure if this has > ever worked - get NotImplementedError: getaddrinfo() is not currently > implemented in the Beta 9. > > >>> import sys > >>> sys.path.append("C:\\Python24\\Lib") > >>> import urllib > >>> f = urllib.urlopen("http://www.microsoft.com ") > Traceback (most recent call last): > File , line 0, in ##151 > File C:\Python24\Lib\urllib.py, line 82, in urlopen > File C:\Python24\Lib\urllib.py, line 194, in open > File C:\Python24\Lib\urllib.py, line 316, in open_http > File C:\Python24\Lib\httplib.py, line 1150, in getreply > File C:\Python24\Lib\httplib.py, line 863, in getresponse > File C:\Python24\Lib\httplib.py, line 275, in __init__ > AttributeError: 'socket' object has no attribute 'makefile' > > Same on CPython 2.4 gives: > >>> import sys > >>> sys.path.append("C:\\Python24\\Lib") > >>> import urllib > >>> f = urllib.urlopen(" http://www.microsoft.com") > >>> print f.read() > > > > > > > (etc.....) > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Wed Jul 26 23:31:57 2006 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Wed, 26 Jul 2006 22:31:57 +0100 Subject: [IronPython] NET Attributes. In-Reply-To: References: Message-ID: <44C7DF4D.30907@voidspace.org.uk> Martin Maly wrote: > > Unfortunately, no. Adding .NET attributes on Python classes in > IronPython is not possible. > > Somewhat similar Pythonic thing is function and method decorators: > > @command(?MyCommand?, CommandFlags.Modal) > > def RunMyCommand(): > > ?. > > However, this will not interoperate well with .NET since .NET is not > aware of the decorator mechanism. > > For more information, you can check out: > http://docs.python.org/whatsnew/node6.html > > There is another option to use function doc strings, but that would be > more complicated to use and I?d probably use it as one of the last > resorts. > However if you need to mark a class as serializable (or use any other .NET attribute), you just can't do it from IronPython at the moment. :-( Fuzzyman http://www.voidspace.org.uk/python/index.shtml > Martin > > ------------------------------------------------------------------------ > > *From:* users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] *On Behalf Of *Tim Riley > *Sent:* Wednesday, July 26, 2006 10:17 AM > *To:* Discussion of IronPython > *Subject:* [IronPython] NET Attributes. > > Is it possible to use .NET attributes in IronPython? For example I > have C# code that looks like: > > [CommandMethod("MyCommand", CommandFlags.Modal)] > public static void RunMyCommand() > { > 'code here > } > > Can I do something similiar in IP? I'll take anything. > > ------------------------------------------------------------------------ > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From jvm_cop at spamcop.net Thu Jul 27 00:20:45 2006 From: jvm_cop at spamcop.net (J. Merrill) Date: Wed, 26 Jul 2006 18:20:45 -0400 Subject: [IronPython] When does data binding occur? In-Reply-To: <51c8a7be0607261110m49d7e837l9856ac5327e08840@mail.gmail.co m> References: <51c8a7be0607251025o1f392152o5ffcb18e5dc96714@mail.gmail.com> <7.0.1.0.2.20060726132005.06d80b30@wheresmymailserver.com> <51c8a7be0607261110m49d7e837l9856ac5327e08840@mail.gmail.com> Message-ID: <7.0.1.0.2.20060726181210.0452eec0@wheresmymailserver.com> Oops, my bad. DataBind is apparently only available in ASP.Net apps. There, it makes the data binding happen when you want it to (in the page processing model); in Windows Forms apps, I knew it happens by itself -- but I thought you could get it to happen earlier, as you seemed to need, by calling it (on the DataGridView). At 02:10 PM 7/26/2006, jeff sacksteder wrote >Do you call DataBind ? > > >No, Call it on what? The Datagridview? J. Merrill / Analytical Software Corp -------------- next part -------------- An HTML attachment was scrubbed... URL: From redmoon17 at gmail.com Thu Jul 27 05:38:16 2006 From: redmoon17 at gmail.com (Kevin Chu) Date: Thu, 27 Jul 2006 11:38:16 +0800 Subject: [IronPython] md5 builtins module Message-ID: <41d7f4a90607262038h8c525ceo7db1a89c6c97e6af@mail.gmail.com> yesterday,we talked about missing md5 module. first,I found RC1 without md5 module, second,I found md5.py that be provide by Seo(http://sparcs.kaist.ac.kr/~tinuviel/fepy/lib/) is not working . so,I write a builtin module ,put it into source,and compile it. md5 module can work ! below is md5 module's code: ======================================= using System; using System.Collections.Generic; using System.Text; using IronPython.Runtime; using System.Security.Cryptography; using System.Runtime.InteropServices; [assembly: PythonModule("md5", typeof(IronPython.Modules.PythonMD5))] namespace IronPython.Modules { [PythonType("md5")] public class PythonMD5 { private MD5 _provider; private readonly Encoding raw = Encoding.GetEncoding("iso-8859-1"); private byte[] empty; public PythonMD5() { _provider = MD5.Create(); empty = raw.GetBytes(""); } public PythonMD5(string arg) : this() { this.Update(arg); } internal PythonMD5(MD5 provider) : this() { _provider = provider; } [PythonName("new")] public static PythonMD5 PythonNew([DefaultParameterValue(null)] string arg) { PythonMD5 obj; if (arg == null) obj = new PythonMD5(); else obj = new PythonMD5(arg); return obj; } [PythonName("md5")] public static PythonMD5 PythonNew2([DefaultParameterValue(null)] string arg) { return PythonMD5.PythonNew(arg); } [PythonName("update")] public void Update(string arg) { byte[] bytes = raw.GetBytes(arg); _provider.TransformBlock(bytes, 0, bytes.Length, bytes, 0); } [PythonName("digest")] public string Digest() { _provider.TransformFinalBlock(empty, 0, 0); return raw.GetString(_provider.Hash); } [PythonName("hexdigest")] public string HexDigest() { _provider.TransformFinalBlock(empty, 0, 0); string hexString = ""; foreach (byte b in empty) { hexString += b.ToString("X2"); } return hexString; } [PythonName("copy")] public PythonMD5 Clone() { PythonMD5 obj = new PythonMD5(this._provider); return obj; } } } =================================== I test it using example in Python Library Reference, test code is: =================================== For example, to obtain the digest of the string 'Nobody inspects the spammish repetition': >>> import md5 >>> m = md5.new() >>> m.update("Nobody inspects") >>> m.update(" the spammish repetition") >>> m.digest() '\xbbd\x9c\x83\xdd\x1e\xa5\xc9\xd9\xde\xc9\xa1\x8d\xf0\xff\xe9' More condensed: >>> md5.new("Nobody inspects the spammish repetition").digest() '\xbbd\x9c\x83\xdd\x1e\xa5\xc9\xd9\xde\xc9\xa1\x8d\xf0\xff\xe9' ====================================== a suggestion: you should notice that I write a static method "PythonNew2",because I would like to implement this: md5( [arg]) For backward compatibility reasons, this is an alternative name for the new() function. therefore I have to write reduplicate method,but if PythonName attribute can accept multi args,the problem can be solved easily. -- Once in a Redmoon From redmoon17 at gmail.com Thu Jul 27 06:00:31 2006 From: redmoon17 at gmail.com (Kevin Chu) Date: Thu, 27 Jul 2006 12:00:31 +0800 Subject: [IronPython] run edna-0.6 , thread exception Message-ID: <41d7f4a90607262100s6f95accby704971a875952b77@mail.gmail.com> after I implement md5 module by myself,I can successful run edna-0.6 . but when browse edna site,it throws exception ============================ D:\TECH\edna-0.6>D:\TECH\IronPython\ipy.exe D:\TECH\edna-0.6\edna.py edna: Ogg Vorbis support disabled, to enable it you will need to install the "py ogg" and the "pyvorbis" modules edna: serving on port 8080... ---------------------------------------- Exception happened during processing of request from ('10.60.200.98', 1774) Traceback (most recent call last): File "d:\python24\lib\SocketServer.py", line 472, in process_request t = threading.Thread(target = self.process_request_thread, TypeError: __new__() got an unexpected keyword argument 'args' ---------------------------------------- ============================= -- Once in a Redmoon From mark.john.rees at gmail.com Thu Jul 27 06:40:24 2006 From: mark.john.rees at gmail.com (Mark Rees) Date: Thu, 27 Jul 2006 14:40:24 +1000 Subject: [IronPython] md5 builtins module In-Reply-To: <41d7f4a90607262038h8c525ceo7db1a89c6c97e6af@mail.gmail.com> References: <41d7f4a90607262038h8c525ceo7db1a89c6c97e6af@mail.gmail.com> Message-ID: Great work Kevin. It's my understanding that the IP team want to overtime make more of the standard library modules that rely on compiled extensions part of the IP Module.cs. So you have done one for them. The bigger issue that was discovered when you tried running Seo's md5.py is the IP's way of handling overloaded methods is broken in RC1 in some cases. I know that there is the same problem calling some other .NET libraries as well. On 7/27/06, Kevin Chu wrote: > yesterday,we talked about missing md5 module. > first,I found RC1 without md5 module, > second,I found md5.py that be provide by > Seo(http://sparcs.kaist.ac.kr/~tinuviel/fepy/lib/) is not working . > so,I write a builtin module ,put it into source,and compile it. > md5 module can work ! > > below is md5 module's code: > > ======================================= > using System; > using System.Collections.Generic; > using System.Text; > using IronPython.Runtime; > using System.Security.Cryptography; > using System.Runtime.InteropServices; > > [assembly: PythonModule("md5", typeof(IronPython.Modules.PythonMD5))] > namespace IronPython.Modules > { > [PythonType("md5")] > public class PythonMD5 > { > private MD5 _provider; > private readonly Encoding raw = Encoding.GetEncoding("iso-8859-1"); > private byte[] empty; > > public PythonMD5() > { > _provider = MD5.Create(); > empty = raw.GetBytes(""); > } > > public PythonMD5(string arg) > : this() > { > this.Update(arg); > } > > internal PythonMD5(MD5 provider) > : this() > { > _provider = provider; > } > [PythonName("new")] > public static PythonMD5 > PythonNew([DefaultParameterValue(null)] string arg) > { > PythonMD5 obj; > if (arg == null) > obj = new PythonMD5(); > else > obj = new PythonMD5(arg); > return obj; > } > [PythonName("md5")] > public static PythonMD5 > PythonNew2([DefaultParameterValue(null)] string arg) > { > return PythonMD5.PythonNew(arg); > } > [PythonName("update")] > public void Update(string arg) > { > byte[] bytes = raw.GetBytes(arg); > _provider.TransformBlock(bytes, 0, bytes.Length, bytes, 0); > } > [PythonName("digest")] > public string Digest() > { > _provider.TransformFinalBlock(empty, 0, 0); > return raw.GetString(_provider.Hash); > } > [PythonName("hexdigest")] > public string HexDigest() > { > _provider.TransformFinalBlock(empty, 0, 0); > string hexString = ""; > foreach (byte b in empty) > { > hexString += b.ToString("X2"); > } > return hexString; > } > [PythonName("copy")] > public PythonMD5 Clone() > { > PythonMD5 obj = new PythonMD5(this._provider); > return obj; > } > } > } > =================================== > I test it using example in Python Library Reference, > test code is: > =================================== > For example, to obtain the digest of the string 'Nobody inspects the > spammish repetition': > > > >>> import md5 > >>> m = md5.new() > >>> m.update("Nobody inspects") > >>> m.update(" the spammish repetition") > >>> m.digest() > '\xbbd\x9c\x83\xdd\x1e\xa5\xc9\xd9\xde\xc9\xa1\x8d\xf0\xff\xe9' > > More condensed: > > > >>> md5.new("Nobody inspects the spammish repetition").digest() > '\xbbd\x9c\x83\xdd\x1e\xa5\xc9\xd9\xde\xc9\xa1\x8d\xf0\xff\xe9' > > ====================================== > a suggestion: > you should notice that I write a static method "PythonNew2",because I > would like to implement this: > > md5( [arg]) > For backward compatibility reasons, this is an alternative name for > the new() function. > > therefore I have to write reduplicate method,but if PythonName > attribute can accept multi args,the problem can be solved easily. > > -- > Once in a Redmoon > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From haiboluo at exchange.microsoft.com Thu Jul 27 07:14:59 2006 From: haiboluo at exchange.microsoft.com (Haibo Luo) Date: Wed, 26 Jul 2006 22:14:59 -0700 Subject: [IronPython] run edna-0.6 , thread exception In-Reply-To: <41d7f4a90607262100s6f95accby704971a875952b77@mail.gmail.com> Message-ID: This is valid bug. I will open a bug in codeplex: Seems the argument name of "args" is giving our KwArgBinder a hard time. To workaround this for now, you may try rename "args" in Thread.__init__ to other, such as "args2". Thanks for the report. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Kevin Chu Sent: Wednesday, July 26, 2006 9:01 PM To: Discussion of IronPython Subject: [IronPython] run edna-0.6 , thread exception after I implement md5 module by myself,I can successful run edna-0.6 . but when browse edna site,it throws exception ============================ D:\TECH\edna-0.6>D:\TECH\IronPython\ipy.exe D:\TECH\edna-0.6\edna.py edna: Ogg Vorbis support disabled, to enable it you will need to install the "py ogg" and the "pyvorbis" modules edna: serving on port 8080... ---------------------------------------- Exception happened during processing of request from ('10.60.200.98', 1774) Traceback (most recent call last): File "d:\python24\lib\SocketServer.py", line 472, in process_request t = threading.Thread(target = self.process_request_thread, TypeError: __new__() got an unexpected keyword argument 'args' ---------------------------------------- ============================= -- Once in a Redmoon _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From KBjorke at nvidia.com Thu Jul 27 07:55:04 2006 From: KBjorke at nvidia.com (Kevin Bjorke) Date: Wed, 26 Jul 2006 22:55:04 -0700 Subject: [IronPython] Working Beta7 WinForms Code fails under RC1 In-Reply-To: Message-ID: <590FCAE72E27D54CA1EADE7293BB444F04422BBD@hqemmail04.nvidia.com> I have these two lines which worked well under Beta7: cb = Drawing2D.ColorBlend() cb.Colors = [c,hilight,c,c] Now I get an error saying "expecting list got array" ?? ----------------------------------------------------------------------------------- This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. ----------------------------------------------------------------------------------- From Martin.Maly at microsoft.com Thu Jul 27 08:06:08 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Wed, 26 Jul 2006 23:06:08 -0700 Subject: [IronPython] Working Beta7 WinForms Code fails under RC1 In-Reply-To: <590FCAE72E27D54CA1EADE7293BB444F04422BBD@hqemmail04.nvidia.com> Message-ID: I wonder if the exception string is off a little. What it probably should say is "expecting array, got list". We no longer have automatic conversion from list to array. We have one from tuple to array, but not from list. You can construct the array explicitly: System.Array[element_type](anything_enumerable) Does this work? Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Kevin Bjorke Sent: Wednesday, July 26, 2006 10:55 PM To: Discussion of IronPython Subject: [IronPython] Working Beta7 WinForms Code fails under RC1 I have these two lines which worked well under Beta7: cb = Drawing2D.ColorBlend() cb.Colors = [c,hilight,c,c] Now I get an error saying "expecting list got array" ?? ----------------------------------------------------------------------------------- This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. ----------------------------------------------------------------------------------- _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From raathm at gmail.com Thu Jul 27 08:15:19 2006 From: raathm at gmail.com (Mike Raath) Date: Thu, 27 Jul 2006 08:15:19 +0200 Subject: [IronPython] speed In-Reply-To: References: <000801c6b05b$3336cde0$c100a8c0@luis> Message-ID: <664260580607262315h76da983fra77b06c671af0f18@mail.gmail.com> An issue on CodePlex - http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkItemId=651- was raised on my behalf to do with performance using BeautifulSoup (a forgiving HTML parser). Here's a simple test which does the parsing and the "prettifying" - the process where BeautifulSoup rewrites the HTML in an attempt to make it well-formed. The benchmark processes 2 different urls, loads them into BeautifulSoup and then reads out the "pretty" (or better-formed) html. I can't use urllib because it's apparently not been implemented (see http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkItemId=1368) so what I've done is two scripts. makeFiles.py script, which should be run in CPython, reads the urls and writes them to files. test.py is the actual benchmark, and the other one is the actual benchmark. The code for both is at the end of this message These are the results I'm getting: CPython 2.4 ------------------ ran test_getHtml in 0.00 seconds ran test_load in 0.28 seconds ran test_prettify in 0.05 seconds ran benchmark in 0.33 seconds IronPython 1.0 RC1 ---------------------------- ran test_getHtml in 0.04 seconds ran test_load in 2.49 seconds ran test_prettify in 0.24 seconds ran benchmark in 2.77 seconds So you can see that IronPython is significantly slower than CPython on BeautifulSoup parsing. #---- makeFiles.py import urllib def test_getHtml(url): f = urllib.urlopen(url) html = f.read() f.close() return html def saveFile(fName, data): f = open(fName, "w") f.write(data) f.close() return urls = ["http://news.bbc.co.uk/2/hi/middle_east/5213602.stm", " http://www.cnn.com/2006/US/07/25/highway.shootings.ap/index.html"] files = ["c:\\bbc.html", "c:\\cnn.html"] i = 0 for url in urls: fName = files[i] i += 1 data = test_getHtml(url) saveFile(fName, data) #test.py #----------------------------------------------------------------------------------------------------------------- #| Code Start #----------------------------------------------------------------------------------------------------------------- import sys sys.path.append("C:\\Python24\\Lib") from BeautifulSoup import BeautifulSoup import time def test_getFile(fileName): f = open(fileName, "r") html = f.read() f.close() return html def test_load(html): s = BeautifulSoup(html) return s def test_prettify(s): t = s.prettify() return t files = ["c:\\bbc.html", "c:\\cnn.html"] testCount = 2 benchmarkStart = time.clock() time_getHtml = 0 time_load = 0 time_prettify = 0 for i in range(testCount): for file in files: fName = files[i] testStart = time.clock() html = test_getFile(fName) testEnd = time.clock() time_getHtml += testEnd - testStart testStart = time.clock() s = test_load(html) testEnd = time.clock() time_load += testEnd - testStart testStart = time.clock() t = test_prettify(s) testEnd = time.clock() time_prettify += testEnd - testStart benchmarkEnd = time.clock() print 'ran test_getHtml in \t%.2f seconds' % (time_getHtml) print 'ran test_load in \t%.2f seconds' % (time_load) print 'ran test_prettify in \t%.2f seconds' % (time_prettify) print 'ran benchmark in \t%.2f seconds' % (benchmarkEnd - benchmarkStart) #----------------------------------------------------------------------------------------------------------------- #| Code End #----------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From raathm at gmail.com Thu Jul 27 08:17:57 2006 From: raathm at gmail.com (Mike Raath) Date: Thu, 27 Jul 2006 08:17:57 +0200 Subject: [IronPython] speed In-Reply-To: <664260580607262315h76da983fra77b06c671af0f18@mail.gmail.com> References: <000801c6b05b$3336cde0$c100a8c0@luis> <664260580607262315h76da983fra77b06c671af0f18@mail.gmail.com> Message-ID: <664260580607262317j3f5e6ee3v73fec42d585aab4d@mail.gmail.com> "test.py is the actual benchmark, and the other one is the actual benchmark. The code for both is at the end of this message" Should read "test.py is the actual benchmark. The code for both is at the end of this message" -------------- next part -------------- An HTML attachment was scrubbed... URL: From KBjorke at nvidia.com Thu Jul 27 08:20:38 2006 From: KBjorke at nvidia.com (Kevin Bjorke) Date: Wed, 26 Jul 2006 23:20:38 -0700 Subject: [IronPython] Working Beta7 WinForms Code fails under RC1 In-Reply-To: Message-ID: <590FCAE72E27D54CA1EADE7293BB444F04422BBE@hqemmail04.nvidia.com> That was correct! Sadly now I'm getting an error when I trry to access a Windwos Forms Panel DefaultFont property. The line g.DrawString(self.block.name,self.DefaultFont, bb, Point(4, 2)) (g is a Graphics object -- this DID work under Beta 7!) Results in the error get_DefaultFont() takes exactly -1 arguments (-1 given) ? -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Martin Maly Sent: Wednesday, July 26, 2006 11:06 PM To: Discussion of IronPython Subject: Re: [IronPython] Working Beta7 WinForms Code fails under RC1 I wonder if the exception string is off a little. What it probably should say is "expecting array, got list". We no longer have automatic conversion from list to array. We have one from tuple to array, but not from list. You can construct the array explicitly: System.Array[element_type](anything_enumerable) Does this work? Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Kevin Bjorke Sent: Wednesday, July 26, 2006 10:55 PM To: Discussion of IronPython Subject: [IronPython] Working Beta7 WinForms Code fails under RC1 I have these two lines which worked well under Beta7: cb = Drawing2D.ColorBlend() cb.Colors = [c,hilight,c,c] Now I get an error saying "expecting list got array" ?? ------------------------------------------------------------------------ ----------- This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. ------------------------------------------------------------------------ ----------- _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Martin.Maly at microsoft.com Thu Jul 27 08:53:50 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Wed, 26 Jul 2006 23:53:50 -0700 Subject: [IronPython] Hosting question In-Reply-To: Message-ID: Have you tried using the PythonEngine.Evaluate, PythonEngine.Execute or PythonEngine.EvaluateAs methods? Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Slide Sent: Wednesday, July 26, 2006 7:32 AM To: Discussion of IronPython Subject: [IronPython] Hosting question I have been playing around with embedding IronPython into an application to provide scripting support for my .NET application. One thing that I have noticed is that to get the output from the interpreter you have to use EvalToConsole. So to capture the input, I have to use SetStandardOut to some memory stream, etc, etc. I played with Boo prior to IronPython and they had a cool feature of the interactive interpreter where there was an event for when the interpreter printed something to its standard output, so to get the output it was as easy as adding an event handler to that event. Is there anything in the works like this, or should I just continue piping the output to a memory stream and go from there? Thanks _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Martin.Maly at microsoft.com Thu Jul 27 09:33:55 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Thu, 27 Jul 2006 00:33:55 -0700 Subject: [IronPython] Working Beta7 WinForms Code fails under RC1 In-Reply-To: <590FCAE72E27D54CA1EADE7293BB444F04422BBE@hqemmail04.nvidia.com> Message-ID: This is really interesting error message. I am going to file a bug for us to look into this for the final release. My guess is that the bug here may be that we get confused by the static property being accessed with "self" argument. Could you try accessing the property as Control.DefaultFont ? Thanks Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Kevin Bjorke Sent: Wednesday, July 26, 2006 11:21 PM To: Discussion of IronPython Subject: Re: [IronPython] Working Beta7 WinForms Code fails under RC1 That was correct! Sadly now I'm getting an error when I trry to access a Windwos Forms Panel DefaultFont property. The line g.DrawString(self.block.name,self.DefaultFont, bb, Point(4, 2)) (g is a Graphics object -- this DID work under Beta 7!) Results in the error get_DefaultFont() takes exactly -1 arguments (-1 given) ? -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Martin Maly Sent: Wednesday, July 26, 2006 11:06 PM To: Discussion of IronPython Subject: Re: [IronPython] Working Beta7 WinForms Code fails under RC1 I wonder if the exception string is off a little. What it probably should say is "expecting array, got list". We no longer have automatic conversion from list to array. We have one from tuple to array, but not from list. You can construct the array explicitly: System.Array[element_type](anything_enumerable) Does this work? Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Kevin Bjorke Sent: Wednesday, July 26, 2006 10:55 PM To: Discussion of IronPython Subject: [IronPython] Working Beta7 WinForms Code fails under RC1 I have these two lines which worked well under Beta7: cb = Drawing2D.ColorBlend() cb.Colors = [c,hilight,c,c] Now I get an error saying "expecting list got array" ?? ------------------------------------------------------------------------ ----------- This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. ------------------------------------------------------------------------ ----------- _______________________________________________ users mailing list users at lists.ironpython.com http://lists.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 kristof.wagemans at gmail.com Thu Jul 27 15:14:46 2006 From: kristof.wagemans at gmail.com (Kristof Wagemans) Date: Thu, 27 Jul 2006 15:14:46 +0200 Subject: [IronPython] Debugging support PythonEngine Message-ID: <000001c6b17e$a2cdcdb0$0f01a8c0@notebook> I have been experimenting with the debugging support for the PythonEngine. When I use the following code I have several problems. PythonEngine _pe; EngineOptions options = new EngineOptions(); options.ClrDebuggingEnabled = true; _pe = new PythonEngine(options); _pe.ExecuteFile(@"