-
Notifications
You must be signed in to change notification settings - Fork 81
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
Add __hash__ method to Substance class #226
Conversation
Two questions:
Looking through the rest of the classes in |
The idea behind only hashing these fields, was that |
We can hash the "tuple of the sorted items", e.g.: |
I agree and made the change, should i fix the spelling error stopping CI as well? |
Thank you.
No need to fix the spelling (only if you want to), the CI config needs some
love, but we can address that in another PR.
…On Sun, Feb 25, 2024, 17:52 Daniel Nettelfield ***@***.***> wrote:
We can hash the "tuple of the sorted items", e.g.:
tuple(sorted(some_dict.items())). Another alternative (maybe a separate
issue, and not necessarily adressed in this PR), would be to use
frozendict from PyPI.
I agree and made the change, should i fix the spelling error stopping CI
as well?
—
Reply to this email directly, view it on GitHub
<#226 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADWUMHOD7FXLMPFWPURKC3YVNT45AVCNFSM6AAAAABDYIJOGWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRSHE4TOOJQHA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
All right, i'll leave it for another PR |
Whats the status? I really need this for a project, can it be merged soon? |
Thank you @DNIIBOY , much appreciated! |
Allow substances to be used in dictionaries, sets etc. by including a hash method in the class.