[Python.NET] bug in managed object usage handling within a module.

Stan Pinte stan at phidani.be
Mon Mar 21 17:30:33 CET 2005


    hello,

I will try to describe my problem in an abstract way...

I have the following C# objects:

namespace Foo
{
    abstract class A
    class B : A
}

namespace Bar
{
    class C
    {
       static object createInstance(A argument)
       {
          ...
        }
    }
}

when I do the following in a module located below the current directory
(example: functional/testfoobar.py) , it gives me an error:

import sys
sys.path.append('bin')
rom CLR.System.Reflection import Assembly
Assembly.LoadWithPartialName("foobar")
from CLR.Bar import C
from CLR.Foo import A,B

x = B()
assert isinstance(x, A)
h = C.createInstance(x) --> TypeError: no method matches given arguments

while if I do it in a module located in the current directory (the top
level of the sources), it works all right. What is strange is that
assert isinstance(x, A) works all right in both cases, it just fails on
the last line...and it properly recognize static method of class C...

If really needed, I can try to engineer a compilable test case... it is
some work though...

let me know,

thanks,

Stan.







More information about the PythonDotNet mailing list