[issue45512] [sqlite3] simplify "isolation level"

Erlend E. Aasland report at bugs.python.org
Mon Nov 8 03:51:09 EST 2021


Erlend E. Aasland <erlend.aasland at innova.no> added the comment:

IMO, GH-29053 improves readability, mainly because of these factors:

- Argument Clinic now takes care of the ref count dance, and as a bonus, it is more self-documenting (stating clearly that it accepts str and None)
- Begin statement validation has been refactored out, which IMO helps understanding how isolation level and begin statement is related
- The isolation level setter is now greatly simplified; it fits well in a screenful, there are fewer ref count dances
- Using get_begin_statement() is much less noisier than the previous string compare code in pysqlite_connection_set_isolation_level()


The only thing that still bugs me is the "magical" 6 byte offset needed to convert between isolation level and begin statement. Perhaps a set of conversion functions would make it more readable.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45512>
_______________________________________


More information about the Python-bugs-list mailing list