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

Should None be an acceptable default_section parameter of configparser.ConfigParser #12700

Open
Avasam opened this issue Sep 28, 2024 · 1 comment

Comments

@Avasam
Copy link
Collaborator

Avasam commented Sep 28, 2024

Since this is typing related, I'll ask here before adding to cpython's 5k+ issues.

In pypa/setuptools#4604 (comment) (read this comment for more details) , I found a usage of configparser.ConfigParser(default_section=None, delimiters=("=",)) seemingly to not have a default section.

The documentation doesn't make any mention of leveraging that behaviour. So we're left wondering if the parameter type should be updated (along as a request for cpython's doc to make it explicit), use "" instead, or just type-ignoring it, marking as using undocumented behaviour.

@srittau
Copy link
Collaborator

srittau commented Sep 30, 2024

If it works and is in use, we should probably add this to our stubs. Looking at the CPython code, that this works looks incidental, but changing it on CPython's would break code, and would most likely need a deprecation period.

I can see adding a @deprecated marker to a None overload, though, depending on what the CPython authors say.

@Avasam Avasam changed the title Should None an acceptable default_section parameter of configparser.ConfigParser Should None be an acceptable default_section parameter of configparser.ConfigParser Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants