TypeError: unhashable type: 'list'
ronald.kevin.burton at gmail.com
ronald.kevin.burton at gmail.com
Mon Dec 22 18:10:18 EST 2014
I am getting an exception that the traceback looks like:
------------------------------------------------------------
Traceback (most recent call last):
File "C:\Projects\QA\robot_20141103\resources\assessment_utilities.py", line 29, in create_new_project
program = customer.add(program_code)
File "C:\Projects\QA\robot_20141103\resources\assessment_customer.py", line 589, in add
program = ProgramMaker.Code2Program(program_code, self)
File "C:\Projects\QA\robot_20141103\resources\programmaker.py", line 25, in Code2Program
'ASSESS_PPL' : PPL(customer)
File "C:\Projects\QA\robot_20141103\resources\ppl.py", line 20, in __init__
MeasureMaker.Code2Measure('Furnace Whistle', self)
TypeError: unhashable type: 'list'
------------------------------------------------------------
My problem is that I am not sure what the problem is. I can check the type of 'self' which is an object and the string 'Furnace Whistle' is obviously not a list. The static function 'MeasureMaker.Code2Measure' is a simple factory:
class MeasureMaker:
def Code2Measure(measure_code, core):
try:
return {
...
'Furnace Whistle': FurnaceWhistle(core)
}[measure_code]
except KeyError as error:
return None
Code2Measure = staticmethod(Code2Measure)
What is the 'list' that is in the exception? Or how do I find out?
Thank you.
Kevin
More information about the Python-list
mailing list