def get_bit(self, i):
    """
    Get bit i (or zero if i >= len(self)).
    """
    i = int(i)
    if i >= len(self):
      return 0
    return self[i]

    Get bit i (or zero if i >= len(self)).
    
recipes/Python/440658_Memory_compacted_list_of_bits/recipe-440658.py