You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
typedef std::map<std::array<int, 3>, int> array_int_map; leads to TypeError: unhashable type: 'list' in Python. I know this is because std::list is a list in Python and std::map corresponds to the dict in Python where dict type requires the key to be a hashable type which list is not. But I do not know how to deal with it. I tried std::unordered_map with a hash function, but it did not work.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
typedef std::map<std::array<int, 3>, int> array_int_map
; leads to TypeError: unhashable type: 'list' in Python. I know this is because std::list is a list in Python and std::map corresponds to the dict in Python where dict type requires the key to be a hashable type which list is not. But I do not know how to deal with it. I tried std::unordered_map with a hash function, but it did not work.Beta Was this translation helpful? Give feedback.
All reactions