-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
bpo-33927: Pass stdin and stdout are default arguments to argpars infile/outfile #11992
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
Conversation
Argparse can handle default value as stdin and stdout for parameters as file type (infile, outfile).
@tirkarthi: Do you want to review this change? |
@vstinner Change looks good to me. While reviewing this PR seems like a similar change is also done at least for stdout in #7865 at https://github.com/python/cpython/pull/7865/files#diff-e94945dd18482591faf1e294b029a6afR25 . It assigns '-' by default and replaces '-' with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
@csabella: Do you want to merge this PR? IMHO the commit title and description should be edited. At least to remove "[Skip issue] " :-)
This PR looks simpler than PR #7865. |
Hi, I think #7865 is a bugfix and not a new feature and this PR does not fix the link bpo issue as far as I can tell |
Hi @4383, can you clarify how is this related to the linked b.p.o report? |
@remilapeyre @vstinner mine isn't a bpo or a fix or something like that. But mine can help to a little bit to reduce the code complexity on #7865 by avoiding to check |
Ok, thanks for the clarification! There is an issue to use two This means that when
I think it's not possible to use two |
@remilapeyre yeah good point I guess is a little bit more proper to assume that the default value is the Thoughts? |
With an |
@remilapeyre And you can continue your fix by removing Cf. my comments on yours #7865 |
I have made the requested changes; please review again |
Thanks for making the requested changes! @vstinner: please review the changes made to this pull request. |
Thanks, I merged your PR. |
Argparse can handle default value as stdin and stdout for parameters
as a file type (infile, outfile).
https://bugs.python.org/issue33927