scott-griffiths / bitstring

A Python module to help you manage your bits
https://bitstring.readthedocs.io/en/stable/index.html
MIT License
401 stars 67 forks source link

More configurable default options for pp #335

Open scott-griffiths opened 2 months ago

scott-griffiths commented 2 months ago

The width, sep and offset in pp all have defaults. These could be moved to

bitstring.options.pp_width = 120
bitstring.options.pp_sep = ' '
bitstring.options.pp_show_offset = True

This should be a separate feature request, but it's related: It would also be good to add a bit_width option to pp. This would specify the number of bits to show on each line, and would override the width. I'm finding that in practice this would be a more useful thing to have.