<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Adding objects to set or dictionary: equality and hashing]]></title><description><![CDATA[<p dir="auto">Yesterday <a href="https://programming.dev/post/54997527" rel="nofollow ugc">my exercise</a> got downvoted, probably because its point was unclear. I'd like to try again with this reworked exercise. Hope you'll like this one better.</p>
<ul>
<li><a href="https://memory-graph.com/#codeurl=https%3A%2F%2Fraw.githubusercontent.com%2Fbterwijn%2Fmemory_graph_videos%2Frefs%2Fheads%2Fmain%2Fexercises%2Fother2.py&amp;play=" rel="nofollow ugc">Solution</a></li>
<li><a href="https://docs.python.org/3/reference/datamodel.html#object.__hash__" rel="nofollow ugc">Explanation</a>: “User-defined classes have <code>__eq__()</code> and <code>__hash__()</code> methods by default (inherited from the object class); with them, all objects compare unequal (except with themselves) and <code>x.__hash__()</code> returns an appropriate value such that <code>x == y</code> implies both that <code>x is y</code> and <code>hash(x) == hash(y)</code>.”</li>
</ul>
<p dir="auto">#Python #memory_graph #Equality #Hashing</p>


<div class="row mt-3"><div class="col-12 mt-3"><img class="img-thumbnail" src="https://programming.dev/pictrs/image/9355bcb5-7bf8-4111-99ed-daf21a34ecdc.png" alt="Link Preview Image" /></div></div>]]></description><link>https://forum.ieu.app/topic/241a49da-d43e-4f97-91da-0703ac3d5186/adding-objects-to-set-or-dictionary-equality-and-hashing</link><generator>RSS for Node</generator><lastBuildDate>Sat, 05 Sep 2026 22:35:59 GMT</lastBuildDate><atom:link href="https://forum.ieu.app/topic/241a49da-d43e-4f97-91da-0703ac3d5186.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 14 Aug 2026 10:03:13 GMT</pubDate><ttl>60</ttl></channel></rss>