class Species(collections.namedtuple('SpeciesBase', 'species_id height ...')):
    __slots__ = ()
_cache_lock = threading.Lock()
_cache = {}

def __new__(cls, species_id):
    species_id = operator.index(species_id)
try:
    with cls._cache_lock:
        return cls._cache[species_id]
except KeyError:
    pass
Attempting to replicate Python's string interning functionality for non-strings