-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Python member operation does not work on lists because of overloaded ndarray equality #10400
Comments
How do you propose we fix this? Overloading And if we want to keep that behavior, then there is no way to fix this.
Caching non-hashable (mutable) values is a bad idea, because the value can change after you cache them. |
Is Django has a slightly alternative approach with their query constructor language. They have something called x[E(x)==10] = 0 Slightly more verbose, but very clear that you are comparing elements of |
When you also want to include The django-style approach is an interesting one, but it would be dangerously easy to write |
Hm, if we fix But this does not hold true for |
Changing the definition of |
One more surprising results:
Bam:
This prevents the use of general caching code which stores values in the cache. (List is used here to support non-hashable values and because this example is extracted from a stack-based algorithm.)
The text was updated successfully, but these errors were encountered: