<div dir="ltr">Submitted <a href="http://bugs.python.org/issue28260">http://bugs.python.org/issue28260</a> and the general concensious was to only fix this in the 2.6+ backport since this isn&#39;t a problem in Python 3, and the 2.6+ version has already diverged with it&#39;s dependence on six.</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 23, 2016 at 10:21 AM, Ian Cordasco <span dir="ltr">&lt;<a href="mailto:graffatcolmingov@gmail.com" target="_blank">graffatcolmingov@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Fri, Sep 23, 2016 at 12:06 PM, Roy Williams &lt;<a href="mailto:rwilliams@lyft.com">rwilliams@lyft.com</a>&gt; wrote:<br>
&gt; Hi all,<br>
&gt;<br>
&gt; I am investigating a migration to Python 3, and to facilitate this we are<br>
&gt; using the -3 flag as decribed here:<br>
&gt; <a href="https://docs.python.org/3/howto/pyporting.html#prevent-compatibility-regressions" rel="noreferrer" target="_blank">https://docs.python.org/3/<wbr>howto/pyporting.html#prevent-<wbr>compatibility-regressions</a><br>
&gt; . When using this flag I encountered some issues inside of mock itself.<br>
&gt;<br>
&gt; Python 3 now requires you to implement `__hash__` if you implement `__eq__`.<br>
&gt; See<br>
&gt; <a href="https://docs.python.org/3.6/reference/datamodel.html#object.%5F%5Fhash%5F%5F" rel="noreferrer" target="_blank">https://docs.python.org/3.6/<wbr>reference/datamodel.html#<wbr>object.%5F%5Fhash%5F%5F</a><br>
&gt; .<br>
&gt;<br>
&gt; ```python<br>
&gt; {mock.ANY}  # Fine in Python 2, Throws in Python 3<br>
&gt; ```<br>
&gt;<br>
&gt; We need to explicitly sets the `__hash__` method on these objects as `None`<br>
&gt; to ensure the behavior is consistent in Python 3 as well as Python 2.<br>
&gt;<br>
&gt; I&#39;ve put up a PR to fix this at<br>
&gt; <a href="https://github.com/testing-cabal/mock/pull/378" rel="noreferrer" target="_blank">https://github.com/testing-<wbr>cabal/mock/pull/378</a> , but I am unsure if this is<br>
&gt; the correct source of truth for Mock.<br>
<br>
</span>This is the backport to Python 2.6+ from the head of Python<br>
development. As I understand it, patches should go to <a href="http://bugs.python.org" rel="noreferrer" target="_blank">bugs.python.org</a><br>
first and then they will be backported to testing-cabal/mock on<br>
GitHub.<br>
<br>
Cheers,<br>
Ian<br>
</blockquote></div><br></div>