def __getslice__(self, start, end):
        "return bits slice from start to end (n-0)"
        mask = 2**(end - start + 1) -1
        return ((self._d >> start) & mask)
return bits slice from start to end (n-0)
recipes/Python/578922_bitfield_rev2/recipe-578922.py