kutsurak / python-bitstring

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

1 and 0 should be valid bool values #106

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Currently these both fail:

    BitArray('bool=1')
    pack('bool', 0)

as they require the bool to be 'True' or 'False'. Would be nice to allow them.

Care is needed with the string 'False'...

    BitArray('bool=False')  # a 0 bit
    pack('bool', False)     # a 0 bit
    pack('bool', 'False')   # ??? bool('False') is True

Original issue reported on code.google.com by dr.scott...@gmail.com on 27 Feb 2011 at 4:12

GoogleCodeExporter commented 9 years ago
Done in r.890.

Original comment by dr.scott...@gmail.com on 6 Apr 2011 at 2:49