Skip to content

Instantly share code, notes, and snippets.

@roylee0704
Created May 15, 2016 11:39
Show Gist options
  • Save roylee0704/ecac45dbe8a4f7494d6a4e7bee73c856 to your computer and use it in GitHub Desktop.
Save roylee0704/ecac45dbe8a4f7494d6a4e7bee73c856 to your computer and use it in GitHub Desktop.
Python prehash implementation of custom type.
class CustomType:
def __init__(self,name,location,length):
self.name = name
self.location = location
self.length = length
def __hash__(self):
return hash((self.name, self.location))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment