256 Kilobytes

Answers in Scripting and Automation | By Some Guy

Published 1 year agoSun, 16 Dec 2018 09:34:42 -0800

603 views, 0 RAMs, and 2 comments

Tags: Python, Errors, List, Programming, Unhashable Type

Profile Photo - Some Guy Some Guy
🗎 3224 🗨 43 🐏 31

I am trying to learn python and as I was writing a script I came upon the error "Typeerror: unhashable type: 'list'"? I don't understand what is causing this error. Can someone explain this to me?

Download more RAM. 🐏 ⨉ 0 Posted by Some Guy 1 year ago 🕓 Posted at 16 December, 2018 09:34 AM PST

This is a patsy account used by the 256 Kilobytes staff to seed content. 

Profile Photo - Default aldrinjohn
🗎 0 🗨 1 🐏 1

The hash() is a built-in python method, used to return a unique number . This can be applied to any user-defined object which won’t get changed once initialized. This property is used mainly in dictionary keys .

TypeError: unhashable type: 'list' usually means that you are trying to use a list as an hash argument. For ex. when you use a list as a key in the dictionary , this cannot be done because lists can't be hashed. The standard way to solve this issue is to cast a list to a tuple .

Users Who Have Downloaded More RAM:
August R. Garcia (1 year ago)
🐏 ⨉ 1
Posted by aldrinjohn 1 year ago 🕓 Posted at 11 February, 2019 02:35 AM PST
Profile Photo - August R. Garcia August R. Garcia LARPing as a Sysadmi... Portland, OR
🗎 213 🗨 1117 🐏 337
Site Owner

Ran into this like five minutes ago and found this fucking thread in the SERPs. What a shitty fucking thread that did not answer my question. Anyway, the answer was to change this:

data = {"whatever" : "value"} 
data.update({"Handlers",  t}) 

To this:

data = {"whatever" : "value"} 
data.update({"Handlers" : t}) 

Specifically, the comma should have been a colon. Which was basically a syntax error. Although this error could also be caused like eighty million things in other contexts.

Download more RAM. 🐏 ⨉ 0 Posted by August R. Garcia 7 months ago 🕓 Posted at 05 September, 2019 07:50 AM PDT

Sir, I can do you a nice SEO.

Post a New Comment

To leave a comment, login to your account or create an account.

Do you like having a good time?

Read Quality Articles

Read some quality articles. If you can manage to not get banned for like five minutes, you can even post your own articles.

View Articles →

Argue with People on the Internet

Use your account to explain why people are wrong on the Internet forum.

View Forum →

Vandalize the Wiki

Or don't. I'm not your dad.

View Wiki →

Ask and/or Answer Questions

If someone asks a terrible question, post a LMGTFY link.

View Answers →

Make Some Money

Hire freelancers and/or advertise your goods and/or services. Hire people directly. We're not a middleman or your dad. Manage your own business transactions.

Register an Account
You can also login to an existing account or recover your password. All use of this site is subject to terms outlined in the terms of service and privacy policy.