[IronPython] IronPython 2.6 CodePlex Source Update

2009-08-21 Thread merllab
This is an automated email letting you know that sources have recently been pushed out. You can download these newer sources directly from http://ironpython.codeplex.com/SourceControl/changeset/view/58283. MODIFIED SOURCES $/IronPython/IronPython_Main/Src/IronPython/Compiler/RunnableS

Re: [IronPython] How to get stack traces from runtime exception with using generators.

2009-08-21 Thread Dino Viehland
Can you include the generator code? If I do: using System; using Microsoft.Scripting.Hosting; using IronPython.Hosting; public class Test { public static void Main(string[] args) { var engine = Python.CreateEngine(); try { engine.Execute(@" def f(): raise Exc

[IronPython] Spurious warning when executing modules with -m

2009-08-21 Thread Michael Foord
Create a Python file called foo.py containing nothing but "import os". Execute it with "python -m foo" and "ipy.exe -m foo" (Python 2.6 and IronPython 2.6 B2). C:\compile\testing>python -m foo C:\compile\testing>ipy.exe -m foo :1: RuntimeWarning: Parent module '' not found while handling abso

Re: [IronPython] Spurious warning when executing modules with -m

2009-08-21 Thread Dino Viehland
runpy is setting __package__ to an empty string. Looks like CPython doesn't warn when the string is empty because if I do: import runpy x = runpy.run_module('foo', run_name = '__main__', alter_sys=True) CPython doesn't warn. So the fix is easy enough. But it's interesting CPython no longer call

Re: [IronPython] Spurious warning when executing modules with -m

2009-08-21 Thread Michael Foord
As quick as ever Dino. :-) Thanks Michael Dino Viehland wrote: runpy is setting __package__ to an empty string. Looks like CPython doesn't warn when the string is empty because if I do: import runpy x = runpy.run_module('foo', run_name = '__main__', alter_sys=True) CPython doesn't warn. So

[IronPython] Constructors & inheriting from standard .NET classes

2009-08-21 Thread Zach Crowell
I am unable to inherit from .NET classes which do not define a parameterless constructor. Is this expected behavior? Is there another way to make this inheritance work? Here's a simple case. using System; namespace Test { public class Base { public Base(int i) {

Re: [IronPython] Constructors & inheriting from standard .NET classes

2009-08-21 Thread Dino Viehland
You need to override and call the base __new__ instead of __init__. .NET has a simpler construction model than Python does and __new__ is what best corresponds to .NET constructors. class Derived(Test.Base): def __new__(cls, i): return Test.Base.__new__(cls, i) d = Derived() From

Re: [IronPython] Constructors & inheriting from standard .NET classes

2009-08-21 Thread Michael Foord
Zach Crowell wrote: I am unable to inherit from .NET classes which do not define a parameterless constructor. Is this expected behavior? Is there another way to make this inheritance work? Here's a simple case. using System; namespace Test { public class Base {

Re: [IronPython] Constructors & inheriting from standard .NET classes

2009-08-21 Thread Michael Foord
Dino Viehland wrote: You need to override and call the base __new__ instead of __init__. .NET has a simpler construction model than Python does and __new__ is what best corresponds to .NET constructors. class Derived(Test.Base): def __new__(cls, i): return Test.Base.__new__(cls, i

Re: [IronPython] Constructors & inheriting from standard .NET classes

2009-08-21 Thread Dino Viehland
Yes, you're right, too much copying and pasting :) > -Original Message- > From: users-boun...@lists.ironpython.com [mailto:users- > boun...@lists.ironpython.com] On Behalf Of Michael Foord > Sent: Friday, August 21, 2009 4:45 PM > To: Discussion of IronPython > Subject: Re: [IronPython] Co

Re: [IronPython] Constructors & inheriting from standard .NET classes

2009-08-21 Thread Zach Crowell
Thanks. -Original Message- From: users-boun...@lists.ironpython.com [mailto:users-boun...@lists.ironpython.com] On Behalf Of Dino Viehland Sent: Friday, August 21, 2009 16:52 To: Discussion of IronPython Subject: Re: [IronPython] Constructors & inheriting from standard .NET classes Yes,