Make consistent with dict implementation.

Add hash method implementation.