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

shlex.split: allow TextIO and deprecate None #11451

Merged
merged 1 commit into from
Feb 19, 2024
Merged

Conversation

Avasam
Copy link
Collaborator

@Avasam Avasam commented Feb 19, 2024

Whilst working on a setuptools stubs update (namely in setuptools.command.easy_install.CommandSpec.from_param), I noticed that shlex.split didn't allow TextIO like shlex.shlex.__init__ does. And that passing None can be allowed (but deprecated) until Python 3.12.

Unless s being anything else than a str is an accidental implementation detail that should be hidden away.

Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@srittau
Copy link
Collaborator

srittau commented Feb 19, 2024

Just a general note: TextIO isn't an ideal annotation for parameters (similar to BinaryIO and IO). Usually, a protocol is a better option. That said, as this is only forwarded, this is better than leaving it out.

@srittau srittau merged commit bb6613f into python:main Feb 19, 2024
57 checks passed
@Avasam Avasam deleted the shlex.split branch February 19, 2024 05:19
@Avasam Avasam mentioned this pull request Feb 22, 2024
2 tasks
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

Successfully merging this pull request may close these issues.

3 participants