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
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
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
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
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
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)
{
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
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
{
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
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
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,
11 matches
Mail list logo