Deprecated methods

These methods were all present in the 1.0 release, but have now been deprecated to simplify the API as they have trivial alternatives and offer no extra functionality.

It is likely that they will be removed in version 2.0 so their use is discouraged.

Bits.advancebit()

Advances position by 1 bit.

Equivalent to s.pos += 1.

Bits.advancebits(bits)

Advances position by bits bits.

Equivalent to s.pos += bits.

Bits.advancebyte()

Advances position by 8 bits.

Equivalent to s.pos += 8.

Bits.advancebytes(bytes)

Advances position by 8*bytes bits.

Equivalent to s.pos += 8*bytes.

BitString.delete(bits[, pos])

Removes bits bits from the BitString at position pos.

Equivalent to del s[pos:pos+bits].

Bits.retreatbit()

Retreats position by 1 bit.

Equivalent to s.pos -= 1.

Bits.retreatbits(bits)

Retreats position by bits bits.

Equivalent to s.pos -= bits.

Bits.retreatbyte()

Retreats position by 8 bits.

Equivalent to s.pos -= 8.

Bits.retreatbytes(bytes)

Retreats position by bytes*8 bits.

Equivalent to s.pos -= 8*bytes.

Bits.seek(pos)

Moves the current position to pos.

Equivalent to s.pos = pos.

Bits.seekbyte(bytepos)

Moves the current position to bytepos.

Equivalent to s.bytepos = bytepos, or s.pos = bytepos*8.

Bits.slice([start, end, step])

Returns the BitString slice s[start*step : end*step].

It’s use is equivalent to using the slice notation s[start:end:step]; see __getitem__ for examples.

Bits.tell()

Returns the current bit position.

Equivalent to using the pos property as a getter.

Bits.tellbyte()

Returns the current byte position.

Equivalent to using the bytepos property as a getter.

BitString.truncateend(bits)

Remove the last bits bits from the end of the BitString.

Equivalent to del s[-bits:].

BitString.truncatestart(bits)

Remove the first bits bits from the start of the BitString.

Equivalent to del s[:bits].