Python’s complaining because the inner set
objects are mutable and thus not hashable. The solution is to use frozenset
for the inner sets, to indicate that you have no intention of modifying them.
More Related Contents:
- Extract first item of each sublist
- How to use a dot “.” to access members of dictionary?
- How is set() implemented?
- Understanding nested list comprehension
- Python: How to match nested parentheses with regex?
- Best way to find the intersection of multiple sets?
- What makes sets faster than lists?
- defaultdict of defaultdict?
- Add list to set
- Are sets ordered like dicts in python3.6
- How to compare a list of lists/sets in python?
- Search for a key in a nested Python dictionary
- How to use dot notation for dict in python?
- What is the purpose of collections.ChainMap?
- Why aren’t Python sets hashable?
- Subtracting two lists in Python
- Why don’t Python sets preserve insertion order?
- Accessing items in an collections.OrderedDict by index
- Key-ordered dict in Python
- Which is faster and why? Set or List?
- Change values in dict of nested dicts using items in a list?
- Python set interpetation of 1 and True
- Why does updating one dictionary object affect other?
- How to sort Counter by value? – python
- Accessing values nested within dictionaries
- How does a Python set([]) check if two objects are equal? What methods does an object need to define to customise this?
- How do nested functions work in Python?
- Making a sequence of tuples unique by a specific element
- performing set operations on custom classes in python
- Generate all subsets of size k (containing k elements) in Python