This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Roy Williams
Recipients Roy Williams
Date 2016-09-23.17:59:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1474653593.44.0.212461111184.issue28260@psf.upfronthosting.co.za>
In-reply-to
Content
I am investigating a migration to Python 3, and to facilitate this we are using the -3 flag as decribed here: https://docs.python.org/3/howto/pyporting.html#prevent-compatibility-regressions . When using this flag I encountered
some issues inside of mock itself.

Python 3 now requires you to implement __hash__ if you implement __eq__. See https://docs.python.org/3.6/reference/datamodel.html#object.%5F%5Fhash%5F%5F .

{mock.ANY}  # Fine in Python 2, Throws in Python 3

I've created a PR that explicitly sets the __hash__ method on these objects as None to ensure the behavior is consistent in Python 3 as well as Python 2.  The folks over at testing-in-python suggested I submit a bug here first and then the fix can be backported to testing-cabal/mock

https://github.com/testing-cabal/mock/pull/378
History
Date User Action Args
2016-09-23 17:59:53Roy Williamssetrecipients: + Roy Williams
2016-09-23 17:59:53Roy Williamssetmessageid: <1474653593.44.0.212461111184.issue28260@psf.upfronthosting.co.za>
2016-09-23 17:59:53Roy Williamslinkissue28260 messages
2016-09-23 17:59:52Roy Williamscreate