glue-viz/glue — pull request #202 by astrofrog (2014-01-07 11:19:35+00:00)
Title: Restore Python 3 compatibility

With these changes, Glue will at least install and launch, but when trying to select a subset I still get the error:

```
Traceback (most recent call last):
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/matplotlib/backends/backend_qt4.py", line 261, in mouseReleaseEvent
FigureCanvasBase.button_release_event( self, x, y, button )
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/matplotlib/backend_bases.py", line 1808, in button_release_event
self.callbacks.process(s, event)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/matplotlib/cbook.py", line 528, in process
proxy(*args, **kwargs)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/matplotlib/cbook.py", line 406, in __call__
return mtd(*args, **kwargs)
File "/Volumes/Raptor/Library/Python/3.3/lib/python/site-packages/Glue-0.1.0-py3.3.egg/glue/qt/mouse_mode.py", line 195, in release
self._finish_roi(event)
File "/Volumes/Raptor/Library/Python/3.3/lib/python/site-packages/Glue-0.1.0-py3.3.egg/glue/qt/mouse_mode.py", line 156, in _finish_roi
self._roi_callback(self)
File "/Volumes/Raptor/Library/Python/3.3/lib/python/site-packages/Glue-0.1.0-py3.3.egg/glue/qt/widgets/scatter_widget.py", line 99, in apply_mode
return self.apply_roi(mode.roi())
File "/Volumes/Raptor/Library/Python/3.3/lib/python/site-packages/Glue-0.1.0-py3.3.egg/glue/qt/decorators.py", line 18, in result
return func(*args, **kwargs)
File "/Volumes/Raptor/Library/Python/3.3/lib/python/site-packages/Glue-0.1.0-py3.3.egg/glue/core/application_base.py", line 223, in apply_roi
self._session.command_stack.do(cmd)
File "/Volumes/Raptor/Library/Python/3.3/lib/python/site-packages/Glue-0.1.0-py3.3.egg/glue/core/command.py", line 98, in do
result = cmd.do(self._session)
File "/Volumes/Raptor/Library/Python/3.3/lib/python/site-packages/Glue-0.1.0-py3.3.egg/glue/core/command.py", line 224, in do
self.client.apply_roi(self.roi)
File "/Volumes/Raptor/Library/Python/3.3/lib/python/site-packages/Glue-0.1.0-py3.3.egg/glue/clients/scatter_client.py", line 255, in apply_roi
mode.update(self._data, subset_state, focus_data=focus)
File "/Volumes/Raptor/Library/Python/3.3/lib/python/site-packages/Glue-0.1.0-py3.3.egg/glue/core/edit_subset_mode.py", line 67, in update
self._combine_data(data, new_state, add_if_empty=doadd)
File "/Volumes/Raptor/Library/Python/3.3/lib/python/site-packages/Glue-0.1.0-py3.3.egg/glue/core/edit_subset_mode.py", line 35, in _combine_data
data.edit_subset = data.new_subset()
File "/Volumes/Raptor/Library/Python/3.3/lib/python/site-packages/Glue-0.1.0-py3.3.egg/glue/core/data.py", line 610, in new_subset
new_subset = Subset(self, color=color, label=label, **kwargs)
File "/Volumes/Raptor/Library/Python/3.3/lib/python/site-packages/Glue-0.1.0-py3.3.egg/glue/core/subset.py", line 54, in __init__
self.label = label # trigger disambiguation
File "/Volumes/Raptor/Library/Python/3.3/lib/python/site-packages/Glue-0.1.0-py3.3.egg/glue/core/subset.py", line 228, in __setattr__
object.__setattr__(self, attribute, value)
File "/Volumes/Raptor/Library/Python/3.3/lib/python/site-packages/Glue-0.1.0-py3.3.egg/glue/core/subset.py", line 92, in label
value = Registry().register(self, value, group=self.data)
File "/Volumes/Raptor/Library/Python/3.3/lib/python/site-packages/Glue-0.1.0-py3.3.egg/glue/core/registry.py", line 69, in register
has_obj = obj in reg
TypeError: unhashable type: 'Subset'
```

I don't quite understand yet why this would work in Python 2 but not Python 3.