bpo-42064: Move `sqlite3` exceptions to global state, part 1 of 2 by erlend-aasland · Pull Request #26745 · python/cpython
I just remembered that all the connection object keeps borrowed references to all the sqlite3 exception types
I see the connection type is created with PyType_FromModuleAndSpec, so connections hold a reference to the module through their type. (So the module is kept alive and the connections can borrow from it safely).
But, borrowed references tend to be confusing – you always have to think about things like this, even in the future as changes made in seemingly unrelated parts.
Is it worth it to update them to strong references? Or just one strong reference to the module?