Pull to refresh

Вышел IronPython 2.6 CTP для .NET 4.0 Beta 1

Lumber room
Главная новость релиза — интеграция с динамическими объектами .NET 4


        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])
        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
Total votes 7: ↑5 and ↓2 +3
Views 263
Comments Comments 1

Please pay attention