Conversation
|
I wouldn't rely only on hashes, which seems far too risky. But you're also right that relying on types may be overly restrictive. How about |
|
Aha, this is even better: x in {y} |
To clarify, "hashable" does not imply only using the hash value. Typically, it also implies using equality as well, hence why I don't think we should only use hash values. In general, I think it's probably okay to relax the type check. This definitely needs to go in the release notes, because I wouldn't be surprised if this change breaks some code somewhere (unlikely, but possible). |
Make sense and I really like |
|
LGTM. I like it! Thanks @madsbk |
|
@mrocklin, I think this is ready to be merged. |
|
Black recently updated. I think that Tom resolved this on the Dask side with #6568 . Pushing an empty commit to trigger CI |
This PR makes
subs()compare hashes of keys instead of comparing type and equality of tuple items.This follows the graph specification:
"A key is any hashable value that is not a task", which implies that different typed keys that hashes to the same value are the same key?.This is motivated by my work on culling where keys containing
intandnumpy.intare substituted.Finally, I expect this to be slightly faster than the current implementation.
black dask/flake8 dask