Jun-02-2021, 07:55 AM
(Jun-01-2021, 07:21 PM)lsepolis123 Wrote: from pcpartpicker import API
You have any idea, how to print api.supported_parts where
api = API()
You have any idea, how fix TypeError: unhashable type: 'list'??????????????
Python 3.8.6 (c:\users\lwdls\appdata\local\programs\python\python38\python.exe)
>>> %Run pcpartpicker5.py
Traceback (most recent call last):
File "D:\DOWNLOADS\Textbooks - Source Code\Python 3 Thonny IDE\pcpartpicker5.py", line 4, in <module>
from pcpartpicker import API
TypeError: unhashable type: 'list'
>>>
Now this is just a guess, but I would guess that a list is not a hashable entity.
From:
https://docs.python.org/3/glossary.html#term-hashable
Quote:Most of Python’s immutable built-in objects are hashable; mutable containers (such as lists or dictionaries) are not; immutable containers (such as tuples and frozensets) are only hashable if their elements are hashable. Objects which are instances of user-defined classes are hashable by default. They all compare unequal (except with themselves), and their hash value is derived from their id().
Yep, lists are not hashable.