def __setitem__(self,index,value):
        "set bit value for that index (n-0)"
        value    = (value&1)<<index
        mask     = (1)<<index
        self._d  = (self._d & ~mask) | value
set bit value for that index (n-0)
recipes/Python/578922_bitfield_rev2/recipe-578922.py