That was mouthful. This is for 1.1. (Running the following code on
2.0a2/Mono dies inside System.Reflection.Emit. Ugh.)

class C(object):
    def __str__(self):
        return 'C'

obj = C()
getattr(obj.__str__, 'attribute', None)

Result:

TypeError: Cannot cast from source type to destination type.

This is InvalidCastException.
IronPython/Runtime/calls/Function.cs has this comment on line 906:

public sealed partial class Method (snip) {
    //??? can I type this to Function
    private object func;

Apparently you can't... The error is thrown when you cast func to
PythonFunction, I think.

-- 
Seo Sanghyeon
_______________________________________________
users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to