michalc / sqlite-s3-query

Python functions to query SQLite files stored on S3
MIT License
251 stars 15 forks source link

feat: more clearly robust finalizing without O(N) operations #26

Closed michalc closed 2 years ago

michalc commented 2 years ago

The possibility exists that multiple statements could point to the same memory address, say if one were finalised and then another created that had the same address. This could have been fine in the code, but it's more clearly robust to use a new object() for each pointer, since multiple that are equal to each other cannot exist at the same time in Python.

Since objects are hashable, then also a dictionary can be used, which results in constant time access to statements rather than O(N). Probably really unlikely to have any sort of high number of statements live at the same time, but you never know...