Skip to content

Conversation

@BCSharp
Copy link
Member

@BCSharp BCSharp commented Apr 8, 2025

It's a bit strange that the addition operator preserves the subclass type but multiplication and copy doesn't.

CompareUtil.Push(this);
try {
res = ((IStructuralEquatable)new PythonTuple(this)).GetHashCode(comparer);
res = ((IStructuralEquatable)new PythonTuple(GetObjectArray())).GetHashCode(comparer);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we want PythonTuple.MakeTuple instead of the constructor? Not even sure when this code path gets called anyway?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we want PythonTuple.MakeTuple instead of the constructor?

Yes!

Not even sure when this code path gets called anyway?

IDK either, it is not being tested by any of our tests. I have tested GetObjectArray in vitro. I guess it's there so that deque plays nicely with the rest of the .NET containers.

@BCSharp BCSharp merged commit 8122f8a into IronLanguages:main Apr 14, 2025
15 of 17 checks passed
@BCSharp BCSharp deleted the deque_add branch April 14, 2025 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants