'str' object has no attribute 'intersection' and unhashable set

dieter dieter at handshake.de
Wed Oct 5 03:39:55 EDT 2016


meInvent bbird <jobmattcon at gmail.com> writes:
... not looking at the details ...

"'str' object has not attribute 'intersection'": apparently,
something is really a string (an 'str') while you expect it to be a set.

"unhashable set": maybe, you try to put a set into another set (or a dict;
or somewhere else where hashability is necessary). A "set" itself is
unhashable (like many mutable standard data types); you may consider to use
"frozenset" in those cases (of course, a "frozenset" is immutable, i.e.
cannot be changed after creation).




More information about the Python-list mailing list