kutsurak / python-bitstring

Automatically exported from code.google.com/p/python-bitstring
0 stars 0 forks source link

Make pack a method for BitString #84

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Instead of current

>>> s = pack(...)  # returns a BitString

make it return a Bits object.

Then have a method in BitString so that you can say

>>> s2 = BitString()
>>> s2.pack(...)

This allows either a Bits or BitString to be created, removing the current
asymmetry.

The packed data can be appended on to for BitStrings, allowing them to be
constructed in pieces.

>>> s2.pack('more stuff...')

So we'd have a pack function that returned a Bits, and a BitString.pack
method that modified in-place and returned None. Confusing? Maybe.

Original issue reported on code.google.com by python.bitstring@googlemail.com on 25 Mar 2010 at 3:39

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Functionality covered by the encode method described on the wiki (EncodeDecode).

Original comment by python.bitstring@googlemail.com on 12 Apr 2010 at 8:32