Skip to content

clr.accepts/clr.returns error issues #1205

Closed
@slozier

Description

@slozier

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions