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

Dtypes should know their return type #300

Closed scott-griffiths closed 8 months ago

scott-griffiths commented 9 months ago

Each dtype has a particular return type (int, str, float, Bits, etc.) but it's not immediately obvious and leads to some clunky code in places where any of the types could be returned.

It might be useful in terms of code organisation to record the return type as part of the dtype definition. If we then add a new one, such as Decimal, it won't need any extra refactoring.

scott-griffiths commented 8 months ago

Done in main branch for 4.2.