kutsurak / python-bitstring

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

Initialise from bytes object #90

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Only applicable to Python 3 (as bytes is a synonym for str in Python 2),
but would be nice to do

>>> s = Bits(b'qwerty')

instead of 

>>> s = Bits(bytes=b'qwerty')

Note that the current behaviour is not nice at all. The bytes is iterable
and so each byte gets cast to a bool - not what would be expected!

Original issue reported on code.google.com by dr.scott...@gmail.com on 4 May 2010 at 6:09

GoogleCodeExporter commented 9 years ago
Done in revision 714. Also allowed bytearray auto initialisation, for Python 2 
and 3.

Original comment by dr.scott...@gmail.com on 23 May 2010 at 1:28