Closed
Description
The error message for clr.accepts
and clr.returns
does not display types properly. For example:
import clr
@clr.accepts(int)
def test(x):
return x
test("a")
fails with
AssertionError: argument 0 has bad value (got IronPython.Runtime.Types.PythonType, expected IronPython.Runtime.Types.PythonType)
Similarly with returns
:
@clr.returns(int)
def test(x):
return x
test("a")
AssertionError: bad return value returned (expected IronPython.Runtime.Types.PythonType, got IronPython.Runtime.Types.PythonType)
Also, AssertionError
is an odd choice of error. Probably a TypeError
would be more appropriate?