[IronPython] Announcing IronPython 2.6 CTP for .NET 4.0 Beta 2
Dino Viehland
dinov at microsoft.com
Wed Oct 21 22:30:56 CEST 2009
Hello Python Community,
We're quite pleased to announce the release of "IronPython 2.6 CTP for .NET 4.0 Beta 2". This is our third preview of IronPython running under the Dynamic Language Runtime that is built directly into a .NET 4.0 release! As before, this release allows you to use IronPython objects and types as .NET 4.0 dynamic objects from within C# and Visual Basic code. This release is extremely similar to IronPython 2.6 RC 1. Please also note that "IronPython 2.6 CTP for .NET 4.0 Beta 2" will run only under .NET 4.0 Beta 2.
Here's a small example showing just how powerful the new dynamic feature is for taking advantage of dynamic language functionality in statically typed languages:
<mock.py>
import random, math
class Mock(object):
def __getattr__(self, key):
"""Mock objects of this type will dynamically implement any requested member"""
return random.choice(["hello world", math.pi])
</mock.py>
<dynamic_demo.cs>
using System;
using IronPython.Hosting;
using Microsoft.Scripting.Hosting;
public class dynamic_demo {
static void Main() {
var ipy = Python.CreateRuntime();
dynamic mock = ipy.UseFile("mock.py");
dynamic m = mock.Mock();
//The Python Mock type dynamically implements any member that is requested of it
System.Console.WriteLine(m.the_csharp_compiler_cannot_possbily_know_this_member_exists_at_compile_time);
}
}
<dynamic_demo.cs>
To try out this preview release:
1. Install some variant of .NET 4.0 Beta 2 or Visual Studio 2010 Beta 2. E.g., http://www.microsoft.com/downloads/details.aspx?FamilyID=9f5e8774-c8dc-4ff6-8285-03a4c387c0db&displaylang=en
2. Install IronPython 2.6 CTP for .NET 4.0 Beta 2.msi from http://ironpython.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=28125
3. Follow any of the many dynamic walkthroughs online. http://blogs.msdn.com/vbteam/archive/2008/12/17/walkthrough-dynamic-programming-in-visual-basic-10-0-and-c-4-0-lisa-feigenbaum.aspx would be a good start
Have fun!
The IronPython Team
More information about the Ironpython-users
mailing list