Clean up sqlite3.Connection APIs · Issue #108278 · python/cpython (original) (raw)

Feature or enhancement

Has this already been discussed elsewhere?

https://discuss.python.org/t/clean-up-some-sqlite3-apis/32093

#87260 (comment)

Proposal:

The sqlite3.Connection class has groups of similar APIs with inconsistent parameter specs.

Create user-defined function APIs:

Set callback APIs:

For all APIs but create_function, I suggest to make all parameters positional-only; for create_function, I suggest to make the three first parameters positional-only:

Create user-defined function APIs:

Set callback APIs:

Obviously, create_window_function stays as it is.

UPDATE: I noticed the docs are wrong about create_collation; it's signature is actually create_collation(name, callable, /).

Linked PRs