'Convert a FeatureProfile object to an integer bitfield.
>>> profile.to_int()
66'

def to_int(self):

    features = 0
    for (i, v) in enumerate(reversed(self.values())):
        features |= (bool(v) << i)
    return features
