Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System.Array ordering comparisons are not working #1822

Open
slozier opened this issue Dec 2, 2024 · 0 comments
Open

System.Array ordering comparisons are not working #1822

slozier opened this issue Dec 2, 2024 · 0 comments
Labels
.NET interop Issues relating to how IronPython interacts with .NET types regression

Comments

@slozier
Copy link
Contributor

slozier commented Dec 2, 2024

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

@slozier slozier added .NET interop Issues relating to how IronPython interacts with .NET types regression labels Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
.NET interop Issues relating to how IronPython interacts with .NET types regression
Projects
None yet
Development

No branches or pull requests

1 participant