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

Add levels to dtype definitions in the dtype register #331

Closed scott-griffiths closed 1 month ago

scott-griffiths commented 2 months ago

The problem I'm trying to solve here is that we have lots of dtypes, and possibly want to add more and allow user-defined ones. This can mean that it's hard to show them all together without confusing the user. In the manual we already distinguish between the 'main' dtypes and the more esoteric ones.

Perhaps attaching a level to dtypes can be helpful:

Level 1: The fundamental ones. u, i, f, b, o, h, bytes. Level 2: The variants. uintne, floatbe, intle etc. Maybe later the reverse ones uint_r etc. Level 3: The esoteric. se, bfloat, e3m2mxfp, p3binary8 etc.

Future user defined ones can choose their own level? Or be level 4?

I'm not sure if 'level' is a good name for this.

scott-griffiths commented 1 month ago

No longer planned. The way it will work in bitformat makes this a bit redundant.