Shifts each bit in the bitstring to the right by the given amount. String length is preserved:: BitString("101") >> 1 == BitString("010")
(self, amount: int)
| 234 | ) |
| 235 | |
| 236 | def __rshift__(self, amount: int) -> BitString: |
| 237 | """Shifts each bit in the bitstring to the right by the given amount. |
| 238 | String length is preserved:: |
| 239 | |
| 240 | BitString("101") >> 1 == BitString("010") |
| 241 | """ |
| 242 | return BitString(self[:-amount], False).zfill(width=len(self)) |
| 243 | |
| 244 | def __invert__(self) -> BitString: |
| 245 | """Inverts (~) each bit in the |