kutsurak / python-bitstring

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

Disallow auto initialisation from integer except in constructor #110

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
To create 100 zero bits you can use

    a = BitArray(100)

This is fine, but it can get confusing when initialising with an int is used 
outside the constructor.

    >>> a = BitArray([0])
    >>> a == 1
    True
    >>> a += 1  # adds a zero bit to the end
    >>> a += 0  # does nothing

Suggest that this auto initialisation be disallowed. Even I sometimes get 
confused by this and I wrote it...

Original issue reported on code.google.com by dr.scott...@gmail.com on 29 May 2011 at 4:07

GoogleCodeExporter commented 9 years ago
This is rather awkward to do in practice, so I've decided against doing it.

Original comment by dr.scott...@gmail.com on 21 Nov 2011 at 11:02