python: Add legacy hash function from traits.