Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Python
Why is dictionary.keys() a list and not a set?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Mike Meyer, post: 1850792"] You're shifting the emphasis from hashable back to mutable, which is the problem that I'm trying to fix. The mutability - or immutability - of an object is irrelevant to the question of whether or not they can be a dictionary key/set element. The critical property is that they are hashable. *Most* immutable builtin types are hashable, and no builtin mutable types are hashable, which deserves a mention. Once you get away from the builtins, mutability simply stops mattering. Giving mutability top billing is simply wrong. Ordinary lists aren't Python classes. Um, actually, I pointed that out (possibly as well), and included it in one of the earlier versions. I was contemplating moving it elsewhere, and accidently left it out. It certainly deserves mention somewhere; I'm just not sure that here is the right place. Along with __hash__ seems more appropriate. <mike [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Python
Why is dictionary.keys() a list and not a set?
Top