gh-93057: Deprecate positional use of optional sqlite3.connect() params by erlend-aasland 路 Pull Request #107948 路 python/cpython (original) (raw)

There is an issue here. Positional parameters are only deprecated in the Connection constructor. But we want also to deprecate them in connect(). Currently you can bypass the deprecations if use the Connection subclass:

class MyConnection(Connection):
    def __init__(self, database, timeout=5.0, ...):
        super().__init__(database, timeout=timeout, ...)

connect(":memory:", 10.0, ..., factory=MyConnection)

But if we add the second deprecation warning in connect(), we will get two deprecation warning.