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!");
print a.ToFoo();



That would print "HELLO WORLD! FooBarBaz.

You can't put methods on System.String though, but you can create new object
from System.String...

Miha

2008/11/5 Marty Nelson <[EMAIL PROTECTED]>

>  Is there the equivalent of extension method in python?  I want to put a
> variable into the script scope and create extension methods for it.  Does
> this make sense and is it possible?
>
_______________________________________________
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to