Skip to content

System.Array ordering comparisons are not working #1822

@slozier

Description

@slozier

System.Array ordering comparisons are raising a SystemError.

For example:

import System
assert System.Array[System.Int32]([0]) < System.Array[System.Int32]([1])

currently raises

SystemError: Compare

Note that this used to work in 2.7. At the very least it, if we don't want to support it, it should be raising a TypeError.

Also, trying to compare arrays of different lengths we get a ValueError:

import System
System.Array[System.Int32]([0]) < System.Array[System.Int32]([1,2])

ValueError: Object is not a array with the same number of elements as the array to compare it to.
Parameter name: other

I'm guessing this error comes from the .NET comparison? Probably preferable to not throw if we're going to be supporting ordering comparisons.

#1821

Metadata

Metadata

Assignees

No one assigned

    Labels

    .NET interopIssues relating to how IronPython interacts with .NET typesregression

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions