Changes between Initial Version and Version 1 of Ticket #36233, comment 2


Ignore:
Timestamp:
Mar 6, 2025, 2:32:10 PM (3 days ago)
Author:
Simon Charette

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #36233, comment 2

    initial v1  
    1 I'm not sure if this relates to a particular version of Python or SQLite (I tested with Python 3.12.3 and `sqlite3.sqlite_version` of 3.46) and if it now implements the `decimal` data type differently but it appears to be returning an `int` instance when there are no floating values and in this case the quantization is completely unnecessary. Here's a demonstration of how the code could be adapted to take that into consideration.
     1I'm not sure if this relates to a particular version of Python or SQLite (I tested with Python 3.12.3 and `sqlite3.sqlite_version` of 3.46) and if it now implements the `decimal` data type differently but it appears to be returning an `int` instance when there are no floating values (like it's the case for `decimal_places=0`) and in this case the quantization is completely unnecessary. Here's a demonstration of how the code could be adapted to take that into consideration.
    22
    33{{{#!diff
     
    3131
    3232Note that I haven't put much thoughts into it but it seemed adequate to only apply float quantization when provided `float` instances?
     33
     34I'm unsure what the purpose of using `DecimalField(decimal_places=0)` over an `IntegerField` is though. Assuming there is one I assume the fact it's pretty niche why this issue has flew under the radar for so long.
     35
     36Could you elaborate on why this should be supported in the first place?
Back to Top