The fix for this is pretty simple.  It's going into 2.1 as we speak, and I'll 
port it back to the 2.0.x branch.  Unfortunately at this point I don't think 
it'll make it into 2.0 final.

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Glenn Jones
Sent: Tuesday, December 09, 2008 8:37 AM
To: Discussion of IronPython
Subject: [IronPython] subclasses of list with __mul__ defined

Hi guys,

Another issue from our upgrade to IPy2:
class thing(list):
    def __init__(self, value):
        self.value = value

    def __mul__(self, other):
        return self.value * other
t1 = thing(3.0)
print t1 * 3.0

results in:

Traceback (most recent call last):
  File "testmat.py", line 12, in testmat.py
  File "Microsoft.Scripting.Core", line unknown, in New
  File "Microsoft.Scripting.Core", line unknown, in New
  File "Microsoft.Scripting.Core", line unknown, in ValidateArgumentTypes
ValueError: Expression of type 'System.Double' cannot be used for constructor 
parameter of type 'System.Object'


This has the potential to cause us significant pain since a third-party (pure 
python) library that we use relies on this behaving correctly.

We'll raise this as a bug on codeplex.

Thanks
Glenn & Tom
_______________________________________________
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to