Files
codeql/python/ql/src/Functions/IncorrectRaiseInSpecialMethod.py
2018-11-19 15:10:42 +00:00

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