May 17th 2016: version 3.1.5 released

  • Support initialisation from an array.
  • Added a separate LICENSE file.
Assets 2

@scott-griffiths scott-griffiths released this Jun 23, 2016 · 6 commits to master since this release


March 19th 2016: version 3.1.4 released

This is another bug fix release.

  • Fix for bitstring types when created directly from other bitstring types.
  • Updating contact, website details.
Assets 2

@scott-griffiths scott-griffiths released this Jun 23, 2016 · 22 commits to master since this release


March 4th 2014: version 3.1.3 released

This is another bug fix release.

  • Fix for problem with prepend for bitstrings with byte offsets in their data store.
Assets 2

@scott-griffiths scott-griffiths released this Jun 23, 2016 · 26 commits to master since this release


April 18th 2013: version 3.1.2 released

This is another bug fix release.

  • Fix for problem where unpacking bytes would by eight times too long
Assets 2

@scott-griffiths scott-griffiths released this Jun 23, 2016 · 33 commits to master since this release


March 21st 2013: version 3.1.1 released

This is a bug fix release.

  • Fix for problem where concatenating bitstrings sometimes modified method's arguments
Assets 2

@scott-griffiths scott-griffiths released this Jun 23, 2016 · 37 commits to master since this release


February 26th 2013: version 3.1.0 released

This is a minor release with a couple of new features and some bug fixes.

New 'pad' token

This token can be used in reads and when packing/unpacking to indicate that
you don't care about the contents of these bits. Any padding bits will just
be skipped over when reading/unpacking or zero-filled when packing.

>>> a, b = s.readlist('pad:5, uint:3, pad:1, uint:3')

Here only two items are returned in the list - the padding bits are ignored.

New clear and copy convenience methods

These methods have been introduced in Python 3.3 for lists and bytearrays,
as more obvious ways of clearing and copying, and we mirror that change here.

t = s.copy() is equivalent to t = s[:], and s.clear() is equivalent to del s[:].

Other changes

  • Some bug fixes.
Assets 2

@scott-griffiths scott-griffiths released this Jun 23, 2016 · 46 commits to master since this release


February 7th 2012: version 3.0.2 released

This is a minor update that fixes a few bugs.

  • Fix for subclasses of bitstring classes behaving strangely (Issue 121).
  • Fix for excessive memory usage in rare cases (Issue 120).
  • Fixes for slicing edge cases.

There has also been a reorganisation of the code to return it to a single
'bitstring.py' file rather than the package that has been used for the past
several releases. This change shouldn't affect users directly.

Assets 2
Feb 6, 2012
Tagging 3.0.2 release

@scott-griffiths scott-griffiths released this Jun 23, 2016 · 63 commits to master since this release


November 21st 2011: version 3.0.1 released

This release fixed a small but very visible bug in bitstring printing.

Assets 2

@scott-griffiths scott-griffiths released this Jun 23, 2016 · 66 commits to master since this release


November 21st 2011: version 3.0.0 released

This is a major release which breaks backward compatibility in a few places.

Backwardly incompatible changes

Hex, oct and bin properties don't have leading 0x, 0o and 0b

If you ask for the hex, octal or binary representations of a bitstring then
they will no longer be prefixed with 0x, 0o or 0b. This was done as it
was noticed that the first thing a lot of user code does after getting these
representations was to cut off the first two characters before further
processing.

>>> a = BitArray('0x123')
>>> a.hex, a.oct, a.bin
('123', '0443', '000100100011')

Previously this would have returned ('0x123', '0o0443', '0b000100100011')

This change might require some recoding, but it should all be simplifications.

ConstBitArray renamed to Bits

Previously Bits was an alias for ConstBitStream (for backward compatibility).
This has now changed so that Bits and BitArray loosely correspond to the
built-in types bytes and bytearray.

If you were using streaming/reading methods on a Bits object then you will
have to change it to a ConstBitStream.

The ConstBitArray name is kept as an alias for Bits.

Stepping in slices has conventional meaning

The step parameter in __getitem__, __setitem__ and __delitem__ used to act
as a multiplier for the start and stop parameters. No one seemed to use it
though and so it has now reverted to the conventional meaning for containers.

If you are using step then recoding is simple: s[a:b:c] becomes s[a*c:b*c].

Some examples of the new usage:

>>> s = BitArray('0x0000')
s[::4] = [1, 1, 1, 1]
>>> s.hex
'8888'
>>> del s[8::2]
>>> s.hex
'880'

New features

New readto method

This method is a mix between a find and a read - it searches for a bitstring
and then reads up to and including it. For example:

>>> s = ConstBitStream('0x47000102034704050647')
>>> s.readto('0x47', bytealigned=True)
BitStream('0x47')
>>> s.readto('0x47', bytealigned=True)
BitStream('0x0001020347')
>>> s.readto('0x47', bytealigned=True)
BitStream('0x04050647')

pack function accepts an iterable as its format

Previously only a string was accepted as the format in the pack function.
This was an oversight as it broke the symmetry between pack and unpack.
Now you can use formats like this:

fmt = ['hex:8', 'bin:3']
a = pack(fmt, '47', '001')
a.unpack(fmt)
Assets 2