mirror of
https://github.com/github/codeql.git
synced 2025-12-25 13:16:33 +01:00
17 lines
338 B
Python
17 lines
338 B
Python
#Incorrect unhashable class
|
|
class MyMutableThing(object):
|
|
|
|
def __init__(self):
|
|
pass
|
|
|
|
def __hash__(self):
|
|
raise NotImplementedError("%r is unhashable" % self)
|
|
|
|
#Make class unhashable in the standard way
|
|
class MyCorrectMutableThing(object):
|
|
|
|
def __init__(self):
|
|
pass
|
|
|
|
__hash__ = None
|