Re: [IronPython] How do I test if a variable is defined?

2008-11-06 Thread Tony Meyer
If you're running some sort of checker (pylint, pychecker) over this, you might get a warning about the name line not doing anything. To avoid that, you'll sometimes see a variant like this: try: unused = name except NameError: # variable 'name' is not defined. Except then PyLint

Re: [IronPython] IronPython 2: Bug in Indexing (Blocker)

2008-11-06 Thread Michael Foord
Dino Viehland wrote: Thanks for the report. I've opened CodePlex bug #19350 to track this (http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=19350). I believe the fix is actually pretty simple and we'll discuss whether we'll take it for 2.0 final at our Friday team meeting.

Re: [IronPython] Ironclad problem, with which someone here may be able to help

2008-11-06 Thread William Reade
Thanks Dino -- it seems that if I use ipy with -X:MTA, I can no longer reproduce the problem. However, this bothers me a bit: I'm not competent to follow all the consequences here, but this situation seems to imply that Ironclad won't be usable safely from any STA thread. Is this an intended

Re: [IronPython] Latest Hosting Documentation

2008-11-06 Thread Curt Hagenlocher
http://compilerlab.members.winisp.net/dlr-spec-hosting.pdf (PDF) or http://compilerlab.members.winisp.net/dlr-spec-hosting.doc (Word) On Thu, Nov 6, 2008 at 5:41 AM, Slide [EMAIL PROTECTED] wrote: Can someone point me to the latest hosting docs? Thanks, slide -- slide-o-blog

Re: [IronPython] Ironclad problem, with which someone here may be able to help

2008-11-06 Thread Curt Hagenlocher
When you run with -X:MTA, is the object now being finalized on a thread other than thread #2? On Thu, Nov 6, 2008 at 7:01 AM, William Reade [EMAIL PROTECTED]wrote: Thanks Dino -- it seems that if I use ipy with -X:MTA, I can no longer reproduce the problem. However, this bothers me a bit: I'm

[IronPython] Latest Hosting Documentation

2008-11-06 Thread Slide
Can someone point me to the latest hosting docs? Thanks, slide -- slide-o-blog http://slide-o-blog.blogspot.com/ ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Re: [IronPython] Ironclad problem, with which someone here may be able to help

2008-11-06 Thread William Reade
Finalization still happens on thread 2, and I see no evidence of thread 1 any more; my main thread now appears to have id 3. Curt Hagenlocher wrote: When you run with -X:MTA, is the object now being finalized on a thread other than thread #2? On Thu, Nov 6, 2008 at 7:01 AM, William Reade

[IronPython] trivial long() bug

2008-11-06 Thread William Reade
CPy: long('') Traceback (most recent call last): File stdin, line 1, in module ValueError: invalid literal for long() with base 10: '' IPy: long('') 0L ___ Users mailing list Users@lists.ironpython.com

Re: [IronPython] Ironclad problem, with which someone here may be able to help

2008-11-06 Thread Dino Viehland
In MTA mode we'll create a new thread which is thread 3 - thread 1 will just be hanging around waiting for it to exit. Unfortunately w/o a separate EXE we can't avoid the separate thread. I've pinged the CLR dev who owns interop these days to see if he's ever seen anything like this.

Re: [IronPython] trivial long() bug

2008-11-06 Thread Dino Viehland
Thanks, I've filed this as CodePlex #19363 (http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=19363) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of William Reade Sent: Thursday, November 06, 2008 8:58 AM To: Discussion of IronPython

[IronPython] Porting from CPython: Figuring out the calling code's directory

2008-11-06 Thread Ori Peleg
Hi, I'm porting Testoob to IronPython and have a module function that needs to know the filename where the code calling it is defined. In CPython I get the current frame with sys._getframe(), then climb the stack with frame.f_back until I find a different file: def _first_external_frame():

Re: [IronPython] Porting from CPython: Figuring out the calling code's directory

2008-11-06 Thread Dino Viehland
The short answer is no – we realize frames is a common request and I do have a prototype implementation of them. We’re still working on our 2.1 planning but it might be available there w/ a command line option or it might be something we could port to 2.0.1. The longer answer would be

Re: [IronPython] Ironclad problem, with which someone here may be able to help

2008-11-06 Thread Dino Viehland
Do you know if numpy is using COM anywhere? Or does Ironclad use COM for any of its interop? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of William Reade Sent: Thursday, November 06, 2008 6:01 AM To: Discussion of IronPython Subject: Re: [IronPython]

Re: [IronPython] Extension methods in python

2008-11-06 Thread Dino Viehland
By custom class you mean a class you've written? And then you want it to light up with dynamic languages? From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Marty Nelson Sent: Thursday, November 06, 2008 7:18 PM To: Discussion of IronPython Subject: Re: [IronPython] Extension

Re: [IronPython] Extension methods in python

2008-11-06 Thread Marty Nelson
Like a Christmas tree. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dino Viehland Sent: Thursday, November 06, 2008 7:20 PM To: Discussion of IronPython Subject: Re: [IronPython] Extension methods in python By custom class you mean a

Re: [IronPython] Extension methods in python

2008-11-06 Thread Dino Viehland
Ok, you don’t want extension methods, you want a dynamic object, and the good and bad news is there are a few options ☺ Let's start with the correct options first. If you can change the base class the easiest thing to do would be to subclass Microsoft.Scripting.Actions.Dynamic. Then you can