Skip to content

Add stub for subprocess.list2cmdline function #1898

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

Merged
merged 2 commits into from
Mar 2, 2018

Conversation

miggaiowski
Copy link
Contributor

Typeshed doesn't have this function, and it's not even documented. Found this about it: https://github.com/python/cpython/blob/master/Lib/subprocess.py#L161

Code using this list2cmdline made mypy complain.

@gvanrossum
Copy link
Member

The comment suggests that it's intentionally undocumented. I don't see a reason to sanction its use in typeshed. If you want it public you're going to have to petition on bugs.python.org for that first.

@miggaiowski
Copy link
Contributor Author

What if we add a comment here saying this is not sanctioning its use, but merely fixing typing errors for code already using it.
This function is undocumented, but it's not marked as private that shouldn't be used externally (there are mentions about it in the documentation).

@gvanrossum
Copy link
Member

It is clearly meant to be private. The comment you linked to states it is an implementation detail. I really don't want this in the stubs. You can put a # type: ignore on it if you really feel your code is correct.

@miggaiowski
Copy link
Contributor Author

After reading the issue referencing this PR, should I update it with a comment and reopen this?

@gvanrossum
Copy link
Member

Sure, we'll reconsider the PR.

@gvanrossum gvanrossum reopened this Mar 1, 2018
@gvanrossum gvanrossum merged commit a8465da into python:master Mar 2, 2018
@gvanrossum
Copy link
Member

Thanks!

yedpodtrzitko pushed a commit to yedpodtrzitko/typeshed that referenced this pull request Jan 23, 2019
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.

2 participants