Skip to content

Make optional parameters of sqlite3.connect() keyword-only #93057

Closed
@serhiy-storchaka

Description

@serhiy-storchaka

sqlite3.connect() has a large number of parameters: 1 required and 7 optional. It is much more convenient to pass optional arguments by keyword, because you can pass only values which differs from default. And if you pass positional arguments, it is easy to make an error and pass value as wrong argument.

It is recommended to make optional rarely used arguments keyword-only. I do not think it will break much code, but we need a deprecation period for this.

The problem is that sqlite3.connect() was converted to Argument Clinic, and it was much easier to add deprecation warning in the old code.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic-sqlite3triagedThe issue has been accepted as valid by a triager.type-featureA feature request or enhancement

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions