Re: [IronPython] Extension methods in python

2008-11-06 Thread Dino Viehland
e, object value) { this[name] = value; } From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Marty Nelson Sent: Thursday, November 06, 2008 8:02 PM To: Discussion of IronPython Subject: Re: [IronPython] Extension methods in python Like a Christmas tree. __

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
iha Valencic Sent: Thursday, November 06, 2008 9:08 AM To: Discussion of IronPython Subject: Re: [IronPython] Extension methods in python Marty, from what I understand you are passing a variable into python engine and want extension methods there? You can use something like that: import clr imp

Re: [IronPython] Extension methods in python

2008-11-06 Thread Marty Nelson
nt: Thursday, November 06, 2008 9:08 AM To: Discussion of IronPython Subject: Re: [IronPython] Extension methods in python Marty, from what I understand you are passing a variable into python engine and want extension methods there? You can use something like that: import clr import System cla

Re: [IronPython] Extension methods in python

2008-11-06 Thread Miha Valencic
Marty, from what I understand you are passing a variable into python engine and want extension methods there? You can use something like that: import clr import System class MyString(System.String): pass; def ToFoo(self): return self.upper()+' FooBarBaz' a = MyString("Hello world!"); p

Re: [IronPython] Extension methods in python

2008-11-05 Thread Dino Viehland
gt; "hello world"); and then back in Python: a.foo() prints hello world. Probably not what you're looking for but it's all that is there today :( From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Marty Nelson Sent: Wednesday, November 05, 2008 3:59 PM To: Di

Re: [IronPython] Extension methods in python

2008-11-05 Thread Marty Nelson
>> If it's an object defined in Python you can usually attach methods directly to the object or it's Python type. So how would this work? Let's say I had injested a variable into the scope from c#: scope.SetVarialble("widget", "hello world") Can I do something in python so that I can

Re: [IronPython] Extension methods in python

2008-11-05 Thread Dino Viehland
If it's an object defined in Python you can usually attach methods directly to the object or it's Python type. But otherwise we have no support for automatically adding .NET extension methods to existing types currently. It is a frequent request and we will probably get to it at some point. F