This allows dictionaries to have Quantities as keys.
Added a __hash__ function to Quantity.
I'm sorry, but you can't use mutable objects as dictionary keys, even if they have a hash. http://docs.python.org/library/userdict.html :
This class is derived from the UserString above and redefines strings to be mutable. Mutable strings can’t be used as dictionary keys, because dictionaries require immutable objects as keys. The main intention of this class is to serve as an educational example for inheritance and necessity to remove (override) the hash() method in order to trap attempts to use a mutable object as dictionary key, which would be otherwise very error prone and hard to track down.