[IronPython] Takes at least 8 arguments (8 given)

Dino Viehland dinov at exchange.microsoft.com
Tue May 30 18:34:49 CEST 2006


Oh, and we should allow a float -> int conversion, assuming there is no better conversion available.  We're actually looking into changing our dispatch rules to more closely mimic C#'s rules.

The error messages here are particularly bad - we already have one bug to improve the error messages for optimized methods, I'll update that w/ the suggestion to include the bad parameter.  Unfortunately we currently just try and match CPython's error messages, but they're not rich enough for calling complex .NET methods.


-----Original Message-----
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jonathan Jacobs
Sent: Tuesday, May 30, 2006 9:12 AM
To: Discussion of IronPython
Subject: Re: [IronPython] Takes at least 8 arguments (8 given)

Tomi Valkeinen wrote:
> I didn't read your code, but I got the same error from my code and the
> reason was that one of the arguments to the method being called was of
> wrong type. The error message didn't help much finding that bug =).
> Perhaps you have the same problem.

I've run into this a few times too. The exception should be a little more informative about what's wrong with your N arguments (or get a different exception, indicating the issue a little more clearly.)

I usually get caught out when I pass a float instead of an integer. I'm wondering whether it is viable for IronPython to check whether converting the
parameter(s) to the intended type (eg. float -> int) is something that might work, and if so use that. It could be that I'm just lazy but this is how C# works.

--
Jonathan

When you meet a master swordsman,
show him your sword.
When you meet a man who is not a poet,
do not show him your poem.
                 -- Rinzai, ninth century Zen master _______________________________________________
users mailing list
users at lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com



More information about the Ironpython-users mailing list