SciTools/cartopy — pull request #307 by esc24 (2013-07-31 15:17:17+00:00)
Title: Added __hash__ to Projection

Under Python 3.3 if you define ```__eq__``` but no ```__hash__``` your object is unhashable by default. From the docs:

"A class that overrides ```__eq__()``` and does not define ```__hash__()``` will have its ```__hash__()``` implicitly set to None."

Projections need to be hashable for them to be used by matplotlib so I added a ```__hash__```. Whilst I can now produce fantastic looking plots with coastlines under python 3.3 I get the following test failure:

```======================================================================
FAIL: test_hash (cartopy.tests.test_crs.TestCRS)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/edward.campbell/cartopy/lib/cartopy/tests/test_crs.py", line 37, in test_hash
self.assertNotEqual(hash(stereo), hash(north))
AssertionError: 8249766656978016100 == 8249766656978016100
```

On closer examination ```test_hash``` demands that
```python
stereo = ccrs.Stereographic(90)
north = ccrs.NorthPolarStereo()
self.assertEqual(stereo, north)
self.assertNotEqual(hash(stereo), hash(north))
```

This is in direct conflict with the requirement in the python docs:

"The only required property is that objects which compare equal have the same hash value"

This PR defines a ```__hash__``` methods for ```cartopy.crs.Projection``` and also **flips the logic in the test**. I suspect the existing hash behaviour was intentional so this change will break something.