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 naive __hash__ from SageObject #18246
Comments
Commit: |
New commits:
|
Branch: public/18246 |
This comment has been minimized.
This comment has been minimized.
comment:3
I am fixing it. |
comment:4
As expected everything breaks. What do we do? |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:6
You should raise a |
comment:7
|
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
comment:10
Most of the time, it is very easy to fix. But I had to implement a lot
which I guess is close from the default Python implementation. |
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
comment:12
Let us see how much patchbot is happy... |
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
Author: Vincent Delecroix |
Changed commit from |
comment:37
Fails on ARM
|
Commit: |
Last 10 new commits:
|
Changed branch from |
comment:39
I actually don't like these changes: -class VectorPartitions(Parent, UniqueRepresentation):
+class VectorPartitions(UniqueRepresentation, Parent): Why does Also can someone explain to me why are |
comment:40
Replying to @tscrim:
Because
In order to get the MRO right,
Once all default hashes have been deleted and no classes in the MRO of Parent offer a hash function, the order doesn't matter. Until then,
The code is hard to follow, but in general, if enumeration somewhere involves a set or a dictionary, then results depend heavily on the hash used and the order in which the dictionary was constructed. I'd expect that a changed hash causes things to be enumerated in a different order (because a set or dict is storing its entries in a different order somewhere) |
comment:42
Looks good, tests pass, very desirable change. Thanks! |
Changed reviewer from Volker Braun to Volker Braun, Nils Bruin |
Changed branch from public/18246 to |
Changed branch from |
comment:45
More random test failures:
|
comment:49
Hoping this is the only failure... |
Changed branch from public/18246 to |
Hashing is a critical function in Python. In several places, objects do use the generic
__hash__
fromSageObject
or a badly implemented one that makes everything slow. For example:See also #19016 for a ticket with the same purpose (with
Element
instead ofSageObject
).CC: @nathanncohen
Component: coercion
Author: Vincent Delecroix
Branch/Commit:
5627a1d
Reviewer: Volker Braun, Nils Bruin
Issue created by migration from https://trac.sagemath.org/ticket/18246
The text was updated successfully, but these errors were encountered: