Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
serhiy-storchaka opened this issue May 21, 2022 · 3 comments
Open

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

serhiy-storchaka opened this issue May 21, 2022 · 3 comments
Labels
expert-sqlite3 type-feature

Comments

@serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented May 21, 2022

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.

@serhiy-storchaka serhiy-storchaka added type-feature expert-sqlite3 labels May 21, 2022
@erlend-aasland
Copy link
Contributor

@erlend-aasland erlend-aasland commented May 21, 2022

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

Can we enhance AC with such functionality first?

@serhiy-storchaka
Copy link
Member Author

@serhiy-storchaka serhiy-storchaka commented May 22, 2022

Can we enhance AC with such functionality first?

It would be not easy. 😫

@erlend-aasland
Copy link
Contributor

@erlend-aasland erlend-aasland commented May 22, 2022

It would be not easy. 😫

That I assumed 🙂 Do you have a coarse outline in mind of how such a change could be implemented?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
expert-sqlite3 type-feature
Projects
Status: Backwards compatibility issues
Development

No branches or pull requests

2 participants