kutsurak / python-bitstring

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

Properties shouldn't have leading 0x, 0o, 0b. #100

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Not sure on this, but from the usage I've seen the first thing that often gets 
done after a bin property is used is that the initial '0b' gets chopped off. 

e.g.

>>> b += s.bin[2:]

I guess that if you are asking for bin then you already know that '001' is 3 
bits, and if you ask for hex you know that it is 12 bits, so the identifier at 
the start is a bit redundant.

Also when you create a bitstring you can use hex='001' or bin='001' without the 
'0b' or '0x' so that's still consistent.

This will break some code (and lots of incidental documentation) so it's 
definitely a version 3 feature, if it should get done at all.

Original issue reported on code.google.com by dr.scott...@gmail.com on 23 Jan 2011 at 7:38

GoogleCodeExporter commented 9 years ago

Original comment by dr.scott...@gmail.com on 23 Jan 2011 at 7:39

GoogleCodeExporter commented 9 years ago
Done in r.915. Docs still to do though.

Original comment by dr.scott...@gmail.com on 10 Jul 2011 at 5:59