[IronPython] Inheritance from a c# subclass

2007-08-04 Thread Ori
Hello, I have a public subclass in an assembly I reference. I want to create a new python class which inherits from the subcalss. I tried: from MyNamespace import MyClass.MySubClass class PyClass(MyClass.MySubClass) but I got the following compile error: unexpected token . Is there a way to

[IronPython] avoiding using the keyword 'self'

2007-08-04 Thread Ori
Hello, I have a python class which inherits from some other (c#) class. Something like: from MyNamespace import MyClass class PyClass(MyClass) def myMethod(self) return self.PropertyFormInheritedClass I don't understand why I have to write the self. prefix - the context is the inherited

Re: [IronPython] avoiding using the keyword 'self'

2007-08-04 Thread Michael Foord
Ori wrote: Hello, I have a python class which inherits from some other (c#) class. Something like: from MyNamespace import MyClass class PyClass(MyClass) def myMethod(self) return self.PropertyFormInheritedClass You appear to have a syntax error here (which may be the answer

Re: [IronPython] avoiding using the keyword 'self'

2007-08-04 Thread Ori
I guess the answer is no, and I must explicitly use the 'self.' prefix. About the syntax error - you are right, there is one in the post, but it has nothing to do with ineriting from a sub-class Ori wrote: Hello, I have a python class which inherits from some other (c#) class. Something

[IronPython] .NET can see Python classes?

2007-08-04 Thread Darren Govoni
Hi, Can .NET see python defined classes or objects? I define a class in Python but one of my .NET classes tries to find it via reflection and it cannot. I saw a post about this that is over a year old saying it was not then supported. Could this possible in IP 2.0? thank you,

Re: [IronPython] .NET can see Python classes?

2007-08-04 Thread Ori
you can try the following code: PythonEngine engine = new PythonEngine(); EngineModule module = engine.CreateModule(); engine.Execute(handleCode(code, def), module); # code contains definition for python class 'PyClass' UserType ptype = module.Globals[PyClass] as UserType; object obj =