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

Remove frozenset() call from dataclass augmentation code #567

Merged
merged 5 commits into from
Dec 10, 2024

Conversation

inducer
Copy link
Owner

@inducer inducer commented Dec 10, 2024

No description provided.

@@ -371,7 +371,7 @@ def {cls.__name__}_hash(self):
except AttributeError:
pass

h = hash(frozenset({attr_tuple_hash}))
Copy link
Owner Author

Choose a reason for hiding this comment

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

@matthiasdiener It looks like this was there from the beginning, but I can't figure out why. Any thoughts?

It blew up with the release of numpy 2.2, failling like this: https://github.com/inducer/pytools/actions/runs/12245644757/job/34159956196.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Huh, this is very strange. This part of the code in #521 was inspired by inducer/pymbolic#125, which does not have a frozenset() call. Not sure at the moment why I added it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I suspect calling frozenset() here is wrong in any case, since not everything might be hashable?

Copy link
Owner Author

Choose a reason for hiding this comment

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

I agree, it should not be here.

@inducer inducer force-pushed the no-frozenset-in-hash branch from 87a2ca8 to cef8b50 Compare December 10, 2024 03:58
@inducer inducer force-pushed the no-frozenset-in-hash branch from cef8b50 to 42c5be3 Compare December 10, 2024 04:09
@inducer inducer merged commit 48e8d61 into main Dec 10, 2024
9 of 11 checks passed
@inducer inducer deleted the no-frozenset-in-hash branch December 10, 2024 05:57
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