Skip to content

Remove frozenset() call from dataclass augmentation code - #567

Merged
inducer merged 5 commits into
mainfrom
no-frozenset-in-hash
Dec 10, 2024
Merged

Remove frozenset() call from dataclass augmentation code#567
inducer merged 5 commits into
mainfrom
no-frozenset-in-hash

Conversation

@inducer

@inducer inducer commented Dec 10, 2024

Copy link
Copy Markdown
Owner

No description provided.

Comment thread pytato/array.py
except AttributeError:
pass

h = hash(frozenset({attr_tuple_hash}))

Copy link
Copy Markdown
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
Copy Markdown
Contributor

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
Copy Markdown
Contributor

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
Copy Markdown
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
@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