Skip to content

Commit fe92f0d

Browse files
authored
Add __hash__ method for permissions.OperandHolder class (#9417)
`OperandHolder` is not hashable, so need to add `__hash__` method
1 parent fbdab09 commit fe92f0d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

rest_framework/permissions.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ def __eq__(self, other):
5454
self.op2_class == other.op2_class
5555
)
5656

57+
def __hash__(self):
58+
return hash((self.operator_class, self.op1_class, self.op2_class))
59+
5760

5861
class AND:
5962
def __init__(self, op1, op2):

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy